Default tasks are now the rest of the tour, removing the helpIcons

from task columns
This commit is contained in:
Tyler Renelle 2012-07-07 13:58:56 -04:00
parent 64f071a94c
commit a4675defec
2 changed files with 32 additions and 37 deletions

View file

@ -31,20 +31,21 @@ getRoom = (page, model, userId) ->
model.refList "_rewardList", "_user.tasks", "_user.rewardIds"
unless model.get('_user.tasks')
model.push '_habitList', task for task in [
{type: 'habit', text: 'Take the stairs', notes: '', value: 0, up: true, down: true}
{type: 'habit', text: 'Nail-biting', notes: '', value: 0, up: true, down: true}
{type: 'habit', text: '1h Productive Work', notes: '<u>Habits: Constantly Track</u><br/>For some habits, it only makes sense to <b>gain</b> points (like this one).', value: 0, up: true, down: false}
{type: 'habit', text: 'Eat Junk Food', notes: 'For others, it only makes sense to <b>lose</b> points', value: 0, up: false, down: true}
{type: 'habit', text: 'Take The Stairs', notes: 'For the rest, both + and - make sense (stairs = gain, elevator = lose)', value: 0, up: true, down: true}
]
model.push '_dailyList', task for task in [
{type: 'daily', text: 'Exercise', notes: '', value: 0, completed: false }
{type: 'daily', text: '1 hour personal project', notes: '', value: 0, completed: false }
{type: 'daily', text: '1h Personal Project', notes: '<u>Dailies: Complete Once a Day</u><br/>At the end of each day, non-completed Dailies dock you points.', value: 0, completed: false }
{type: 'daily', text: 'Exercise', notes: 'If you are doing well, they turn green and are less valuable (experience, gold) and less damaging (HP). This means you can ease up on them for a bit.', value: 3, completed: false }
{type: 'daily', text: '45m Reading', notes: 'But if you are doing poorly, they turn red. The worse you do, the more valuable (exp, gold) and more damaging (HP) these goals become. This encourages you to focus on your shortcomings, the reds.', value: -10, completed: false }
]
model.push '_todoList', task for task in [
{type: 'todo', text: 'Call Frank', notes: '', value: 0, completed: false }
{type: 'todo', text: 'Buy a bike', notes: '', value: 0, completed: false }
{type: 'todo', text: 'Call Mom', notes: "<u>Todos: Complete Eventually</u><br/>Non-completed Todos won't hurt you, but they will become more valuable over time. This will encourage you to wrap up stale Todos.", value: -3, completed: false }
]
model.push '_rewardList', task for task in [
{type: 'reward', text: '1 Episode of Game of Thrones', notes: '', value: 20 }
{type: 'reward', text: 'Cake', notes: '', value: 10 }
{type: 'reward', text: '1 Episode of Game of Thrones', notes: '<u>Rewards: Treat Yourself!</u><br/>As you complete goals, you earn gold to buy rewards. Buy them liberally - rewards are integral in forming good habits.', value: 20 }
{type: 'reward', text: 'Cake', notes: 'But only buy if you have enough gold - you lose HP otherwise.', value: 10 }
]
# http://tibia.wikia.com/wiki/Formula
@ -179,15 +180,15 @@ ready (model) ->
tour.addStep
element: "#avatar"
title: "Welcome to HabitRPG"
content: "A habit-tracker which treats your goals like a Role Playing Game."
content: "Welcome to HabitRPG, a habit-tracker which treats your goals like a Role Playing Game."
tour.addStep
element: "#bars"
title: "Acheive goals and level up"
content: "As you accomplish goals, you level up and earn gold to spend on rewards. If you fail your goals, you lose hit points. Lose all your HP and you die."
content: "As you accomplish goals, you level up. If you fail your goals, you lose hit points. Lose all your HP and you die."
tour.addStep
element: "ul.habits"
title: "Habits"
content: "Habits are goals that you constantly monitor."
content: "Habits are goals that you constantly track."
placement: "bottom"
tour.addStep
element: "ul.dailys"
@ -204,6 +205,11 @@ ready (model) ->
title: "Rewards"
content: "As you complete goals, you earn gold to buy rewards. Buy them liberally - rewards are integral in forming good habits."
placement: "bottom"
tour.addStep
element: "ul.habits li:first-child"
title: "Hover over comments"
content: "Different task-types have special properties. Hover over each task's comment for more information. When you're ready to get started, delete the existing tasks and add your own."
placement: "right"
tour.start()
#TODO: implement this for completed tab

View file

@ -25,9 +25,7 @@
{/}
<div class="bar" style="width: {percent(_user.exp,_tnl)}%;"></div>
</div>
</td>
</tr>
<tr>
@ -49,8 +47,7 @@
{#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 -->
&nbsp;<a x-bind=click:endOfDayTally class="btn">Tally</a>
&nbsp;<a x-bind=click:endOfDayTally class="btn">Run Cron</a>
&nbsp;<a x-bind=click:loadDebugDefaults class="btn">Debuggin Defaults</a>
</div>
{/}
@ -61,26 +58,18 @@
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 -->
<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).">
<!--helpTitle & helpContent moved to tour -->
<app:taskColumn title="Habits">
<ul class='habits'>{#each _habitList as :task}<app:task />{/}</ul>
<app:newTask type=habit><input value={_newHabit} type="text" /></app:newTask>
</app:taskColumn>
<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)">
<app:taskColumn title="Daily">
<ul class='dailys'>{#each _dailyList as :task}<app:task />{/}</ul>
<app:newTask type=daily><input value={_newDaily} type="text" /></app:newTask>
</app:taskColumn>
<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.">
<app:taskColumn title="Todos" type="todo">
<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>
@ -106,10 +95,7 @@
{/}
</app:taskColumn>
<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.">
<app:taskColumn title="Rewards" type="reward">
<div id="money">{gold(_user.money)} <img src='/img/coin_single_gold.png'/> {silver(_user.money)} <img src='/img/coin_single_silver.png'/></div>
<ul class='rewards'>{#each _rewardList as :task}<app:task />{/}</ul>
<app:newTask type=reward><input value={_newReward} type="text" /></app:newTask>
@ -118,14 +104,15 @@
</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 %>-->
<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>
<!--removing for now, help-info in the tour instead-->
<!--<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>
@ -140,8 +127,7 @@
<li data-id={{:task.id}} class="task {taskClasses(:task.type, :task.completed, :task.value, _hideCompleted)}">
<pre>
<div class="task-meta-controls">
<!-- TODO make this a popover -->
<div class="hover-show">
<a x-bind=click:toggleTaskEdit><i class="icon-pencil"></i></a>
{#if :task.history}
@ -151,9 +137,12 @@
{/}
</div>
<!--<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>
{#if equal(:task.type,'reward')}
<span data-placement="left" data-content="{:task.notes}" data-original-title="{:task.text}" class='task-notes'><i class="icon-comment"></i></span>
{else}
<span data-content="{:task.notes}" data-original-title="{:task.text}" class='task-notes'><i class="icon-comment"></i></span>
{/}
{/}
</div>