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
< body >
< 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-20 22:58:04 +00:00
< li data-id = {{id}} class = "{taskClasses(.type, .completed)}" >
2012-06-10 00:57:35 +00:00
< label >
<!-- Habits -->
2012-06-20 22:58:04 +00:00
{#if equal(.type, 'habit')}
2012-06-20 21:30:21 +00:00
{#if up}< a data-id = {{id}} data-direction = up x-bind = click:vote > < img src = "img/add.png" / > < / a > {/}
{#if down}< a data-id = {{id}} data-direction = down x-bind = click:vote > < img src = "img/remove.png" / > < / a > {/}
2012-06-10 00:57:35 +00:00
<!-- Rewards -->
2012-06-20 22:58:04 +00:00
{else if equal(.type, 'reward')}
< a class = "vote-down buy-link" href = "#" > {.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-20 22:58:04 +00:00
< input type = "checkbox" checked = {.completed} / >
2012-06-10 00:57:35 +00:00
{/}
< i > < / i >
< / label >
2012-06-20 22:58:04 +00:00
< div x-bind = keydown:shortcuts contenteditable > {unescaped .text}< / div >
2012-06-10 00:57:35 +00:00
2012-06-20 23:20:39 +00:00
<!-- <span class="habit - text"><%= name %></span> -->
2012-06-10 00:57:35 +00:00
< div class = 'habit-meta' >
2012-06-20 23:20:39 +00:00
<!-- <a class="edit - link" href="#/<%= id %>/edit">Edit</a> -->
{#if .notes}
< a href = "#" rel = "popover" data-content = "{notes}" title = "{notes}" > < i class = "icon-comment" > < / i > < / a >
{/}
2012-06-10 00:57:35 +00:00
< / div >
2012-06-10 00:15:33 +00:00
< / li >
< newTask: nonvoid >
< form data-task-type = {{{type}}} x-bind = submit:addTask >
{{{content}}}
< input type = submit value = Add >
< / 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 >
{#each _habitList}< app:task / > {/}
< / app:taskList >
< app:newTask type = habit > < input class = new value = {_newHabit} > < / app:newTask >
< / div >
< div class = "span2" >
< app:taskList title = Dailies type = daily >
{#each _dailyList}< app:task / > {/}
< / app:taskList >
< app:newTask type = daily > < input class = new value = {_newDaily} > < / app:newTask >
< / div >
< div class = "span2" >
< app:taskList title = Todos type = todo >
{#each _todoList}< app:task / > {/}
< / 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 >
{#each _rewardList}< app:task / > {/}
< / 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 >