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 / >
2012-06-27 14:07:16 +00:00
< div id = "lvl" > < span class = "badge badge-info" > Lvl: {_user.lvl}< / span > < / div >
2012-06-26 13:23:16 +00:00
< / 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" >
2012-07-07 02:20:36 +00:00
{#if _user.history.exp}
2012-07-07 02:46:22 +00:00
< span class = "progress-text" >
< a x-bind = click:toggleChart data-chart-selector = "exp-chart" data-history-path = "_user.history.exp" > < i class = icon-signal > < / i > < / a > Exp: {round(_user.exp)} / {_tnl}
< / span >
2012-07-07 02:20:36 +00:00
{/}
2012-06-26 13:23:16 +00:00
< div class = "bar" style = "width: {percent(_user.exp,_tnl)}%;" > < / div >
< / div >
< / td >
2012-07-06 20:54:57 +00:00
2012-06-26 13:23:16 +00:00
< / tr >
2012-07-07 03:10:37 +00:00
< tr >
< td colspan = 2 >
< div id = "exp-chart" style = "display:none;" > < / div >
< / td >
< / tr >
2012-06-26 13:23:16 +00:00
< / 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" >
2012-07-06 19:16:26 +00:00
{#if _debug}
< div class = "alert" >
< i class = "icon-warning-sign" > < / i > < b > Debug Buttons< / b >
<!-- TODO: Implement on cron: this is meant to be run automatically once every night. See goo.gl/icdTT -->
< a x-bind = click:endOfDayTally class = "btn" > Tally< / a >
< a x-bind = click:loadDebugDefaults class = "btn" > Debuggin Defaults< / a >
< / div >
{/}
< a x-bind = click:toggleDebug style = "position:absolute;bottom:0;right:0;" > < i class = "icon-warning-sign" > < / i > < / a >
2012-06-26 13:24:12 +00:00
< 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-07-07 17:08:36 +00:00
< app:taskColumn
title="Habits"
helpTitle="Habits: Constantly Track."
helpContent="Some habits only makes sense to gain points (1h of productive work). Others only lose points (swearing). For the rest, both + and - make sense (stairs=gain, elevator=lose).">
2012-06-26 16:01:57 +00:00
< ul class = 'habits' > {#each _habitList as :task}< app:task / > {/}< / ul >
2012-06-27 15:04:10 +00:00
< app:newTask type = habit > < input value = {_newHabit} type = "text" / > < / app:newTask >
2012-07-07 17:08:36 +00:00
< / app:taskColumn >
2012-06-26 13:24:12 +00:00
2012-07-07 17:08:36 +00:00
< app:taskColumn
title="Daily"
helpTitle="Dailies: Complete Once Each Day"
helpContent="At the end of each day, non-completed Dailies dock you points. They also become more valueable (worth more experience). This wil push you to focus on the reds (the goals that are doing worse)">
2012-07-07 04:07:30 +00:00
< ul class = 'dailys' > {#each _dailyList as :task}< app:task / > {/}< / ul >
2012-06-27 15:04:10 +00:00
< app:newTask type = daily > < input value = {_newDaily} type = "text" / > < / app:newTask >
2012-07-07 17:08:36 +00:00
< / app:taskColumn >
2012-06-26 13:24:12 +00:00
2012-07-07 17:08:36 +00:00
< app:taskColumn
title="Todos" type="todo"
helpTitle="Todos: Complete Eventually"
helpContent="Non-completed TODOs won't dock you points, but they will become more valuable over time.">
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-27 15:04:10 +00:00
< app:newTask type = todo > < input value = {_newTodo} 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-29 14:16:02 +00:00
{#if _user.history.todos}
2012-07-07 02:46:22 +00:00
< a x-bind = click:toggleChart data-chart-selector = "todos-chart" data-history-path = "_user.history.todos" > < i class = icon-signal > < / i > < / a >
2012-06-29 14:16:02 +00:00
< div id = "todos-chart" style = "display:none;" > < / div >
{/}
2012-07-07 17:08:36 +00:00
< / app:taskColumn >
2012-06-26 13:24:12 +00:00
2012-07-07 17:08:36 +00:00
< app:taskColumn
title="Rewards" type="reward"
helpTitle="Rewards: Treat Yourself!"
helpContent="As you complete goals, you earn gold to buy rewards. Buy them liberally - rewards are integral in forming good habits.">
2012-06-27 14:09:04 +00:00
< div id = "money" > {gold(_user.money)} < img src = '/img/coin_single_gold.png' / > {silver(_user.money)} < img src = '/img/coin_single_silver.png' / > < / div >
2012-06-26 16:01:57 +00:00
< ul class = 'rewards' > {#each _rewardList as :task}< app:task / > {/}< / ul >
2012-06-27 15:04:10 +00:00
< app:newTask type = reward > < input value = {_newReward} type = "text" / > < / app:newTask >
2012-07-07 17:08:36 +00:00
< / app:taskColumn >
2012-06-26 13:24:12 +00:00
< / 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-07-07 17:08:36 +00:00
< taskColumn: nonvoid >
< div class = "span3 well {{{type}}}s" >
< span class = "help-icon" rel = "popover" data-placement = "bottom" data-original-title = "{{{helpTitle}}}" data-content = "{{{helpContent}}}" > < i class = "icon-question-sign" > < / i > < / span >
< h1 > {{{title}}}< / h1 >
{{{content}}}
< / div >
2012-06-26 13:24:12 +00:00
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-27 14:54:04 +00:00
< pre >
2012-06-29 02:32:19 +00:00
< div class = "task-meta-controls" >
2012-06-26 11:55:09 +00:00
<!-- TODO make this a popover -->
2012-06-26 14:41:08 +00:00
2012-06-29 02:32:19 +00:00
< div class = "hover-show" >
2012-06-29 13:45:50 +00:00
< a x-bind = click:toggleTaskEdit > < i class = "icon-pencil" > < / i > < / a >
2012-07-07 02:46:22 +00:00
{#if :task.history}
< a x-bind = click:toggleChart data-chart-selector = "{{:task.id}}-chart" data-hide-selector = "{{:task.id}}-edit" data-history-path = "_user.tasks.{{:task.id}}.history" >
< i class = "icon-signal" > < / i >
< / a >
{/}
2012-06-29 02:32:19 +00:00
< / div >
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-29 02:32:19 +00:00
< app:taskMeta / >
2012-06-27 14:54:04 +00:00
< / pre >
2012-06-10 00:15:33 +00:00
< / li >
2012-06-25 00:51:42 +00:00
2012-06-29 02:32:19 +00:00
< taskMeta: >
2012-06-25 01:51:13 +00:00
< div style = "display:none;" id = {{:task.id}}-edit >
2012-06-26 14:42:07 +00:00
< hr / >
2012-06-29 20:31:32 +00:00
< form x-bind = submit:toggleTaskEdit data-selector = "{{:task.id}}-edit" >
2012-06-27 13:48:47 +00:00
< div class = control-group >
< label > Text< / label > < input type = text value = {:task.text} / >
< label > Notes< / label > < textarea rows = 3 > {:task.notes}< / textarea >
2012-06-26 14:41:18 +00:00
< / div >
2012-06-27 13:48:47 +00:00
{#if equal(:task.type, 'habit')}
< 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 >
{/}
{#if equal(:task.type, 'reward')}
< div class = control-group >
< label > Price
< div class = "input-append" >
< input class = "span2" size = "16" type = "text" value = {:task.value} > < span class = "add-on" > Gold< / span >
< / div >
< / label >
< / div >
{/}
2012-06-29 01:22:24 +00:00
< button type = submit class = "btn" > Save< / button >
< button x-bind = click:del class = "btn btn-danger" > Delete< / button >
2012-06-27 13:48:47 +00:00
< / form >
2012-06-26 13:24:12 +00:00
< / div >
2012-06-08 18:57:27 +00:00
2012-06-29 08:33:09 +00:00
< div style = "display:none;" id = {{:task.id}}-chart > < / div >
2012-06-29 02:32:19 +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-07-06 20:44:09 +00:00
< script src = /underscore-min.js > < / script >
2012-07-07 16:31:51 +00:00
< script src = /jquery.cookie.js > < / script >
< script src = /bootstrap-tour.js > < / script >
2012-06-29 08:33:09 +00:00
< script type = "text/javascript" src = "https://www.google.com/jsapi" > < / script >
< script type = "text/javascript" >
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(function(){});
< / script >