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-26 13:23:16 +00:00
< 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" >
< div class = "progress progress-danger" >
< span class = "progress-text" > HP: {round(_user.hp)} / 50< / span >
< div class = "bar" style = "width: {percent(_user.hp,50)}%;" > < / div >
< / div >
< div class = "progress progress-warning" >
< span class = "progress-text" > Exp: {round(_user.exp)} / {_tnl}< / span >
< div class = "bar" style = "width: {percent(_user.exp,_tnl)}%;" > < / div >
< / div >
< / 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 >
2012-06-01 00:02:17 +00:00
2012-06-26 13:24:12 +00:00
< Body: >
< br / >
< div class = "container-fluid" >
< div class = "row-fluid" >
<!-- 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-26 16:01:57 +00:00
< div class = "span3" >
2012-06-26 14:22:01 +00:00
< h1 > Habits< / h1 >
2012-06-26 16:01:57 +00:00
< ul class = 'habits' > {#each _habitList as :task}< app:task / > {/}< / ul >
2012-06-26 14:22:01 +00:00
< app:newTask type = habit > < input value = {_newHabit} class = "input-medium" type = "text" / > < / app:newTask >
2012-06-26 13:24:12 +00:00
< / div >
2012-06-26 16:01:57 +00:00
< div class = "span3" >
2012-06-26 14:22:01 +00:00
< h1 > Dailies< / h1 >
2012-06-26 16:01:57 +00:00
< ul classes = 'dailys' > {#each _dailyList as :task}< app:task / > {/}< / ul >
2012-06-26 14:22:01 +00:00
< app:newTask type = daily > < input value = {_newDaily} class = "input-medium" type = "text" / > < / app:newTask >
2012-06-26 13:24:12 +00:00
< / div >
2012-06-26 16:01:57 +00:00
< div class = "span3" >
2012-06-26 20:55:41 +00:00
< h1 class = 'todos' > Todos< / h1 >
2012-06-26 14:22:01 +00:00
< div class = "tabbable" > <!-- Only required for left/right tabs -->
< ul class = "nav nav-tabs" >
< li class = "active" > < a href = "#tab1" data-toggle = "tab" > Remaining< / a > < / li >
< li > < a href = "#tab2" data-toggle = "tab" > Complete< / a > < / li >
< / ul >
< div class = "tab-content" >
< div class = "tab-pane active" id = "tab1" >
2012-06-27 13:37:36 +00:00
< ul class = 'todos' >
{#each _todoList as :task}< app:task / > {/}
< / ul >
2012-06-26 14:41:02 +00:00
< app:newTask type = todo > < input value = {_newTodo} class = "input-medium" type = "text" / > < / app:newTask >
2012-06-26 14:22:01 +00:00
< / div >
< div class = "tab-pane" id = "tab2" >
2012-06-27 13:37:36 +00:00
< ul class = 'completeds' >
{#each _todoList as :task}< app:task / > {/}
< / ul >
2012-06-26 14:22:01 +00:00
< / div >
< / div >
< / div >
2012-06-26 13:24:12 +00:00
< / div >
2012-06-26 16:01:57 +00:00
< div class = "span3" >
2012-06-26 20:55:41 +00:00
< h1 class = 'rewards' > Rewards< / h1 >
2012-06-26 13:24:12 +00:00
{gold(_user.money)} < img src = '/img/coin_single_gold.png' / > {silver(_user.money)} < img src = '/img/coin_single_silver.png' / >
2012-06-26 16:01:57 +00:00
< ul class = 'rewards' > {#each _rewardList as :task}< app:task / > {/}< / ul >
2012-06-26 14:22:01 +00:00
< app:newTask type = reward > < input value = {_newReward} class = "input-medium" type = "text" / > < / app:newTask >
2012-06-26 13:24:12 +00:00
< / div >
< / div >
< / div >
<!-- <% 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-26 14:22:01 +00:00
< newTask: nonvoid >
2012-06-26 12:56:57 +00:00
< form class = "form-inline" data-task-type = {{{type}}} x-bind = submit:addTask >
2012-06-26 14:22:01 +00:00
{{{content}}}
2012-06-26 12:56:57 +00:00
< input class = "btn" type = submit value = Add >
< / form >
2012-06-10 00:15:33 +00:00
< task: >
2012-06-27 13:37:36 +00:00
< li data-id = {{:task.id}} class = "task {taskClasses(:task.type, :task.completed, :task.value, _hideCompleted)}" >
2012-06-26 11:55:09 +00:00
< div class = "task-meta" >
<!-- TODO make this a popover -->
2012-06-26 14:41:08 +00:00
< a x-bind = click:toggleEdit data-selector = "{{:task.id}}-edit" class = "edit-link" > < i class = "icon-pencil" > < / i > < / a >
2012-06-26 11:55:09 +00:00
<!-- <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')}
2012-06-26 15:02:29 +00:00
< a x-bind = click:vote class = "buy-link" data-direction = down > {:task.value}< img src = "img/coin_single_gold.png" / > < / a >
2012-06-10 00:57:35 +00:00
<!-- Daily & Todos -->
{else}
2012-06-26 14:55:24 +00:00
< input type = "checkbox" checked = {:task.completed} x-bind = click:vote data-direction = {: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 >
2012-06-26 14:42:07 +00:00
< hr / >
2012-06-25 01:51:13 +00:00
< label > Text< input type = text value = {:task.text} / > < / label >
2012-06-26 14:32:56 +00:00
< label > Notes< textarea rows = 3 > {:task.notes}< / textarea > < / label >
2012-06-25 01:51:13 +00:00
{#if equal(:task.type, 'habit')}
2012-06-26 14:41:18 +00:00
< div class = "control-group" >
< label class = "checkbox inline" > < input type = checkbox checked = {:task.up} > Up< / label >
< label class = "checkbox inline" > < input type = checkbox checked = {:task.down} > Down< / label >
< / div >
2012-06-25 01:51:13 +00:00
{/}
2012-06-25 02:12:06 +00:00
{#if equal(:task.type, 'reward')}
2012-06-26 15:02:29 +00:00
< label > value< input type = text value = {:task.value} / > < / label >
2012-06-25 02:12:06 +00:00
{/}
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-26 13:24:12 +00:00
< / div >
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: >
2012-06-26 14:26:34 +00:00
< script src = /jquery.min.js > < / script >
< script src = /jquery-ui.min.js > < / script >
2012-06-26 14:25:27 +00:00
< script src = /bootstrap.min.js > < / script >
2012-06-21 01:28:33 +00:00