2012-04-27 02:03:01 +00:00
< Title: >
2012-06-20 22:42:48 +00:00
HabitRPG
2012-04-27 02:03:01 +00:00
< Header: >
2012-06-21 00:47:08 +00:00
< ui:connectionAlert >
2012-06-01 00:02:17 +00:00
2012-06-10 00:15:33 +00:00
< taskList: nonvoid >
< div class = "{{{type}}}s" >
< h1 > {{{title}}}< / h1 >
< div class = dragbox > < / div >
< div class = content >
< ul >
{{{content}}}
< / ul >
< / div >
< / div >
2012-06-08 18:57:27 +00:00
2012-06-10 00:15:33 +00:00
< task: >
2012-06-26 12:02:16 +00:00
< li data-id = {{:task.id}} class = "task {taskClasses(:task.type, :task.completed, :task.score)}" >
2012-06-26 11:55:09 +00:00
< div class = "task-meta" >
<!-- TODO make this a popover -->
< a x-bind = click:toggleEdit data-selector = "{{:task.id}}-edit" class = "edit-link" > Edit< / a >
<!-- <a class="edit - link" href="#/<%= id %>/edit">Edit</a> -->
{#if :task.notes}
< a href = "#" data-content = "{:task.notes}" data-original-title = "{:task.text}" class = 'task-notes' > < i class = "icon-comment" > < / i > < / a >
{/}
< / div >
< div class = "task-controls" >
2012-06-10 00:57:35 +00:00
<!-- Habits -->
2012-06-25 00:51:42 +00:00
{#if equal(:task.type, 'habit')}
{#if :task.up}< a data-direction = up x-bind = click:vote > < img src = "img/add.png" / > < / a > {/}
{#if :task.down}< a data-direction = down x-bind = click:vote > < img src = "img/remove.png" / > < / a > {/}
2012-06-10 00:57:35 +00:00
<!-- Rewards -->
2012-06-25 00:51:42 +00:00
{else if equal(:task.type, 'reward')}
< a class = "vote-down buy-link" href = "#" > {:task.price}< img src = "img/coin_single_gold.png" / > < / a >
2012-06-10 00:57:35 +00:00
<!-- Daily & Todos -->
{else}
<!-- TODO this was part of input below <%= done ? "class='vote - down' checked='checked'" : "class='vote - up'" %> -->
2012-06-25 00:51:42 +00:00
< input type = "checkbox" checked = {:task.completed} / >
2012-06-10 00:57:35 +00:00
{/}
< / div >
2012-06-26 11:55:09 +00:00
< div class = "task-text" x-bind = keydown:shortcuts contenteditable > {unescaped :task.text}< / div >
2012-06-25 02:35:04 +00:00
< app:editPopover / >
2012-06-10 00:15:33 +00:00
< / li >
2012-06-25 00:51:42 +00:00
2012-06-25 01:51:13 +00:00
< editPopover: >
< div style = "display:none;" id = {{:task.id}}-edit >
< label > Text< input type = text value = {:task.text} / > < / label >
< label > Notes< input type = textarea rows = 5 value = {:task.notes} / > < / label >
{#if equal(:task.type, 'habit')}
< label > < input type = checkbox checked = {:task.up} > < i > < / i > Up< / label >
< label > < input type = checkbox checked = {:task.down} > < i > < / i > Down< / label >
{/}
2012-06-25 02:12:06 +00:00
{#if equal(:task.type, 'reward')}
< label > Price< input type = text value = {:task.price} / > < / label >
{/}
2012-06-25 02:34:45 +00:00
< a x-bind = click:toggleEdit data-selector = "{{:task.id}}-edit" class = "btn" > Save< / a >
2012-06-25 02:12:06 +00:00
< a x-bind = click:del class = "btn btn-danger" > Delete< / a >
2012-06-25 01:51:13 +00:00
< / div >
2012-06-25 02:12:06 +00:00
2012-06-10 00:15:33 +00:00
< newTask: nonvoid >
< form data-task-type = {{{type}}} x-bind = submit:addTask >
{{{content}}}
2012-06-26 12:25:38 +00:00
< input class = "btn" type = submit value = Add >
2012-06-10 00:15:33 +00:00
< / form >
2012-04-27 02:03:01 +00:00
< Body: >
2012-06-20 22:15:38 +00:00
< div id = overlay > < / div >
< div id = "head" >
<!-- <% if current_user %> -->
< table id = "character" >
< tr >
< td id = "avatar" >
< img src = "/img/avatar/{_user.lvl}.png" / > < br / >
< b > < div id = "lvl" > Lvl: {_user.lvl}< / div > < / b >
< / td >
< td id = "bars" >
2012-06-20 22:34:15 +00:00
< div class = "progress progress-danger" >
< div class = "bar" style = "width: {percent(_user.hp,50)}%;" >
< span id = "hp" > HP: {round(_user.hp)} / 50< / span >
< / div >
2012-06-20 22:15:38 +00:00
< / div >
2012-06-20 22:34:15 +00:00
< div class = "progress progress-warning" >
< div class = "bar" style = "width: {percent(_user.exp,_tnl)}%;" >
< span id = "tnl" > Exp: {round(_user.exp)} / {_tnl}< / span >
< / div >
< / div >
2012-06-20 22:15:38 +00:00
< / div >
< / td >
< / tr >
< / table >
<!-- <% else %>
< h1 > HabitRPG< / h1 >
< p > A habit tracker app which treats your goals like a Role Playing Game. < a href = "https://github.com/lefnire/habitrpg#habitrpg" > More Information< / a > < / p >
< % end %>-->
< / div >
< br / >
< div class = "container-fluid" >
< div class = "row-fluid" >
2012-06-20 23:20:47 +00:00
<!-- would rather have one component: <app:taskList>, which handles taskList, task, and newTask. However,
can't pass references as paramters. so < app:taskList newModel = {_newHabit} list = {_habitList} > doesn't work
and have to pass those in via {{{content}}} instead -->
2012-06-20 22:15:38 +00:00
< div class = "span2" >
< app:taskList title = Habits type = habit >
2012-06-25 00:51:42 +00:00
{#each _habitList as :task}< app:task / > {/}
2012-06-20 22:15:38 +00:00
< / app:taskList >
< app:newTask type = habit > < input class = new value = {_newHabit} > < / app:newTask >
< / div >
< div class = "span2" >
< app:taskList title = Dailies type = daily >
2012-06-25 00:51:42 +00:00
{#each _dailyList as :task}< app:task / > {/}
2012-06-20 22:15:38 +00:00
< / app:taskList >
< app:newTask type = daily > < input class = new value = {_newDaily} > < / app:newTask >
< / div >
< div class = "span2" >
< app:taskList title = Todos type = todo >
2012-06-25 00:51:42 +00:00
{#each _todoList as :task}< app:task / > {/}
2012-06-20 22:15:38 +00:00
< / app:taskList >
< app:newTask type = todo > < input class = new value = {_newTodo} > < / app:newTask >
< / div >
< div class = "span2" >
{gold(_user.money)} < img src = '/img/coin_single_gold.png' / > {silver(_user.money)} < img src = '/img/coin_single_silver.png' / >
< app:taskList title = Rewards type = reward >
2012-06-25 00:51:42 +00:00
{#each _rewardList as :task}< app:task / > {/}
2012-06-20 22:15:38 +00:00
< / app:taskList >
< app:newTask type = reward > < input class = new value = {_newReward} > < / app:newTask >
< / div >
2012-06-10 00:28:58 +00:00
< / div >
2012-06-20 22:15:38 +00:00
< / div >
2012-06-20 23:20:47 +00:00
<!-- <% if !current_user %>
< %= link_to(image_tag("http://line6.com/images/connections/facebook-login-button.png", :alt => "Login with Facebook"), user_omniauth_authorize_path(:facebook)) %>
< % else %>-->
<!-- <% end %> -->
2012-06-08 18:57:27 +00:00
2012-06-10 00:28:58 +00:00
< Footer: >
< a href = "https://github.com/lefnire/habitrpg" > < img style = "z-index:11; position: absolute; top: 0; right: 0; border: 0;" src = "https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt = "Fork me on GitHub" > < / a >
2012-06-20 22:44:15 +00:00
<!-- <div id="footer">
< %if current_user %>
2012-06-10 00:28:58 +00:00
< p > < a href = "https://github.com/lefnire/habitrpg#habitrpg" > Help< / a > | < %= link_to "Logout", destroy_user_session_path, :method => :delete %>< / p >
2012-06-20 22:44:15 +00:00
< % end %>
2012-06-20 22:59:10 +00:00
< p > Copyright © 2012-< %= Time.now.year %> Tyler Renelle< / p >
2012-06-20 22:44:15 +00:00
< / div > -->
2012-06-08 18:57:27 +00:00
2012-04-27 17:04:44 +00:00
< Script s: >
< script src = https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js > < / script >
< script src = https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js > < / script >
2012-06-21 01:28:33 +00:00
< script src = http://twitter.github.com/bootstrap/assets/js/bootstrap-tooltip.js > < / script >