rewrite2 add in indivdual tasks

This commit is contained in:
Tyler Renelle 2013-08-25 11:47:10 -04:00
parent 99af649ea1
commit 9aa4a5a08a
11 changed files with 379 additions and 1500 deletions

View file

@ -1,3 +1,3 @@
{
"directory": "assets/bower_components"
"directory": "public/bower_components"
}

2
.gitignore vendored
View file

@ -6,7 +6,7 @@ node_modules
config.json
npm-debug.log
lib
assets/bower_components
public/bower_components
src/*/*.js
src/*/*.map

View file

@ -1,30 +1,30 @@
//@import "nib/vendor";
// Vendor Includes - include first so we can override
@import "../../../public/vendor/datepicker/css/datepicker.css";
@import "../../../public/vendor/datepicker/css/datepicker.css"
// Custom includes
@import "./female_sprites.styl";
@import "./male_sprites.styl";
@import "./shop_sprites.styl";
@import "./tasks.styl";
@import "./avatar.styl";
@import "./customizer.styl";
@import "./items.styl";
@import "./inventory.styl";
@import "./alerts.styl";
@import "../../../public/img/sprites/pet_sprites.css";
@import "../../../public/img/sprites/PetEggs.css";
@import "./helpers.styl";
@import "./responsive.styl";
@import "./header.styl";
@import "./filters.styl";
@import "./scrollbars.styl";
@import "./achievements.styl";
@import "./game-pane.styl";
@import "./backer.styl";
@import "./npcs.styl";
@import "./challenges.styl";
@import "./female_sprites.styl"
@import "./male_sprites.styl"
@import "./shop_sprites.styl"
@import "./tasks.styl"
@import "./avatar.styl"
@import "./customizer.styl"
@import "./items.styl"
@import "./inventory.styl"
@import "./alerts.styl"
@import "../../../public/img/sprites/pet_sprites.css"
@import "../../../public/img/sprites/PetEggs.css"
@import "./helpers.styl"
@import "./responsive.styl"
@import "./header.styl"
@import "./filters.styl"
@import "./scrollbars.styl"
@import "./achievements.styl"
@import "./game-pane.styl"
@import "./backer.styl"
@import "./npcs.styl"
@import "./challenges.styl"
// fix exploding to very wide for some reason
.datepicker

File diff suppressed because it is too large Load diff

View file

@ -4,26 +4,25 @@ html
title HabitRPG | Your Life The Role Playing Game
// CSS
!= css('app/index')
!= css('/bower_components/bootstrap/docs/assets/css/bootstrap')
!= css('/bower_components/bootstrap/docs/assets/css/bootstrap-responsive')
!= css('/bower_components/angular-ui/build/angular-ui')
link(rel='stylesheet', href='/vendor/bootstrap/css/bootstrap.css')
link(rel='stylesheet', href='/vendor/bootstrap/css/bootstrap-responsive.css')
link(rel='stylesheet', href='/bower_components/angular-ui/build/angular-ui.css')
!= css('app/index')
// JS
!= js('/bower_components/jquery/jquery.min')
!= js('/bower_components/lodash/lodash')
!= js('/bower_components/moment/moment')
!= js('/bower_components/angular/angular')
!= js('/bower_components/angular-resource/angular-resource')
!= js('/bower_components/angular-ui/build/angular-ui')
!= js('/bower_components/angular-bootstrap/ui-bootstrap')
!= js('/bower_components/angular-bootstrap/ui-bootstrap-tpls')
script(type='text/javascript', src='/bower_components/jquery/jquery.min.js')
script(type='text/javascript', src='/bower_components/lodash/lodash.js')
script(type='text/javascript', src='/bower_components/moment/moment.js')
script(type='text/javascript', src='/bower_components/angular/angular.js')
script(type='text/javascript', src='/bower_components/angular-resource/angular-resource.js')
script(type='text/javascript', src='/bower_components/angular-ui/build/angular-ui.js')
script(type='text/javascript', src='/bower_components/angular-bootstrap/ui-bootstrap.js')
script(type='text/javascript', src='/bower_components/angular-bootstrap/ui-bootstrap-tpls.js')
// Bootstrap
// HabitRPG
!= js('/bower_components/habitrpg-shared/browser/browser.debug')
script(type='text/javascript', src='/bower_components/habitrpg-shared/browser/browser.debug.js')
!= js('app')

View file

@ -1,86 +0,0 @@
<!--helpTitle & helpContent moved to tour -->
<!--
header="habits"
type="habit"
inputValue={_newHabit}
placeHolder="New Habit"
list={@habits}
main={{@main}}
editable={@editable}
-->
<!-- Habits Column -->
<div class="module" ng-class="'rewards-module': type=='reward'">
<div class="task-column {{type}}s" ng-class="'tabbable tabs-below': type=='todo'">
<!-- todos export/graph options -->
<span ng-if="main && type=='todo'" class='option-box pull-right'>
<a ng-show='user.history.todos' class="option-action" x-bind=click:toggleChart data-id="todos" rel=tooltip title="Progress"><i class=icon-signal></i></a>
<a class="option-action" ng-href="/v1/users/{{user.id}}/calendar.ics?apiToken={{user.apiToken}}" rel=tooltip title="iCal"><i class=icon-calendar></i></a>
<!-- <a href="https://www.google.com/calendar/render?cid={{encodeiCalLink(_user.id, _user.apiToken)}}" rel=tooltip title="Google Calendar"><i class=icon-calendar></i></a> -->
</span>
<!-- cash or gems -->
<span ng-if="main && type=='reward'" class='option-box pull-right wallet'>
<div class="money">
{{gold(floor(user.stats.gp))}}
<span class='shop_gold' rel='tooltip' title='Gold'></span>
</div>
<div class="money">
{{silver(user.stats.gp)}}
<span class='shop_silver' rel='tooltip' title='Silver'></span>
</div>
</span>
<h2 class="task-column_title">{{header}}</h2>
<div ng-if='type == "todo"' class='todos-chart' ng-class="hidden:_page.charts.todos"></div>
<form ng-show='editable' class="addtask-form form-inline new-task-form" ng-class="hidden: _showCompleted && type=='todo'" data-task-type="{{type}}" x-bind="submit:addTask">
<span class="addtask-field"><input value="{{inputValue}}" type="text" placeholder="{{placeHolder}}"/></span>
<input class="addtask-btn" type="submit" value="">
</form>
<hr>
<ul class="{{type}}s" ng-class="hidden: !list">
<app:tasks:task ng-repeat='task in list' />
</ul>
<!-- Static Rewards -->
<ul ng-show="main && type=='reward'" class='items' ng-class="hidden:!user.flags.itemsEnabled">
<rewarditem data-item='{{_items.next.weapon}}' />
<rewarditem data-item='{{_items.next.armor}}' />
<rewarditem data-item='{{_items.next.head}}' />
<rewarditem data-item='{{_items.next.shield}}' />
<rewarditem data-item='{{_items.potion}}' />
<rewarditem data-item='{{_items.reroll}}' />
</ul>
<br/>
<!-- ads -->
<div ng-if="authenticated() && user.flags.ads != hide && main">
<span class='pull-right'>
<a x-bind="click:showStripe" rel='tooltip' title='Remove Ads'><i class='icon-remove'></i></a><br/>
<a href="#" data-target="#why-ads-modal" data-toggle="modal" rel='tooltip' title='Why Ads?'><i class='icon-question-sign'></i></a>
</span>
<a ng-if='type=="habit"' href="http://www.amazon.com/gp/product/1400069289/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1400069289&linkCode=as2&tag=ha0d2-20">The Power of Habit: Why We Do What We Do in Life and Business</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=1400069289" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
<a ng-if='type=="daily"' href="http://www.amazon.com/gp/product/0142000280/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0142000280&linkCode=as2&tag=ha0d2-20">Getting Things Done: The Art of Stress-Free Productivity</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=0142000280" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
<a ng-if='type=="todo"' href="http://www.amazon.com/gp/product/0312430000/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0312430000&linkCode=as2&tag=ha0d2-20">The Checklist Manifesto: How to Get Things Right</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=0312430000" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
<a ng-if='type="reward"' href="http://www.amazon.com/gp/product/1594484805/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1594484805&linkCode=as2&tag=ha0d2-20">Drive: The Surprising Truth About What Motivates Us</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=1594484805" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</div>
<div ng-if="type='todo'">
<button class='task-action-btn tile spacious bright' ng-show="_showCompleted" x-bind=click:clearCompleted>Clear Completed</button>
<!-- remaining/completed tabs -->
<ul class="nav nav-tabs">
<li ng-class="active:!_showCompleted"><a x-bind="click:todosShowRemaining">Remaining</a></li>
<li ng-class="active:_showCompleted"><a x-bind="click:todosShowCompleted">Complete</a></li>
</ul>
</div>
</div>
</div>

View file

@ -34,7 +34,7 @@ div(ng-controller='TasksCtrl')
// Actual List
ul(class='{{list.type}}s', ng-show='list.list')
app:tasks:task(ng-repeat='task in list.list')
include ./task
// Static Rewards
ul.items(ng-show='list.main && list.type=="reward"', ng-show='user.flags.itemsEnabled')

193
views/tasks/task.html Normal file
View file

@ -0,0 +1,193 @@
<task:>
<li data-id={{:task.id}} class="task {taskClasses(:task, users[_userId].filters, _user.preferences.dayStart, _user.lastCron, _showCompleted, @main)}">
<!-- right-hand side control buttons -->
<div class="task-meta-controls">
<!-- Streak -->
<span class='{#unless :task.streak}hide{/}'>
{:task.streak}<span rel='tooltip' title='Streak Counter'><i class='icon-forward'></i></span>
</span>
<app:filters:applied-filters />
<!-- edit -->
<a x-bind=click:toggleTaskEdit rel=tooltip title="Edit"><i class="icon-pencil"></i></a>
<!-- challenges -->
{{#if :task.challenge}}
{{#if brokenChallengeLink(:task)}}
<i class='icon-bullhorn' style='background-color:red;' x-bind=click:toggleTaskEdit rel=tooltip title="Broken Challenge Link"></i>
{{else}}
<i class='icon-bullhorn' rel=tooltip title="Challenge Task"></i>
{{/}}
{{else}}
<!-- delete -->
<a x-bind=click:del rel=tooltip title="Delete"><i class="icon-trash"></i></a>
{{/}}
<!-- chart -->
{#if :task.history}
<a x-bind=click:toggleChart data-id="{{:task.id}}" rel="tooltip" title="Progress"><i class="icon-signal"></i></a>
{/}
<!-- notes -->
{#if :task.notes}
<span rel="popover" data-trigger="hover" data-placement="left" data-content="{:task.notes}" data-original-title="{:task.text}" class='task-notes'><i class="icon-comment"></i></span>
{/}
</div>
<!-- left-hand side checkbox -->
<div class="task-controls task-primary">
<!-- Habits -->
{{#if equal(:task.type,'habit')}}
{{#if @main}} <!-- only allow scoring on main tasks, not when viewing others' public tasks or when creating challenges -->
{#if :task.up}<a class="task-action-btn" data-direction=up x-bind=click:score></a>{/}
{#if :task.down}<a class="task-action-btn" data-direction=down x-bind=click:score></a>{/}
{{else}}
{#if :task.up}<span class="task-action-btn"></span>{/}
{#if :task.down}<span class="task-action-btn"></span>{/}
{{/}}
<!-- Rewards -->
{{else if equal(:task.type,'reward')}}
{{#if @main}} <!-- only allow scoring on main tasks, not when viewing others' public tasks or when creating challenges -->
<a class="money btn-buy" x-bind=click:score data-direction=down>
<span class="reward-cost">{:task.value}</span>
<span class='shop_gold'></span>
</a>
{{else}}
<span class="money btn-buy">
<span class="reward-cost">{:task.value}</span>
<span class='shop_gold'></span>
</span>
{{/}}
<!-- Daily & Todos -->
{{else}}
<span class="task-checker action-yesno">
{{#if @main}} <!-- only allow scoring on main tasks, not when viewing others' public tasks or when creating challenges -->
<input type=checkbox id="box-{{:task.id}}" class="visuallyhidden focusable" checked="{:task.completed}">
<label for="box-{{:task.id}}"></label>
{{else}}
<input type=checkbox id="box-{{:task.id}}-static" class="visuallyhidden focusable" checked="false">
<label for="box-{{:task.id}}-static"></label>
{{/}}
</span>
{{/}}
</div>
<!-- main content -->
<p class="task-text">
{{#if taskInChallenge(:task)}}
{{taskAttrFromChallenge(:task,'text')}}
{{else}}
{:task.text}
{{/}}
</p>
<!-- edit/options dialog -->
<app:tasks:taskMeta main={{@main}} />
</li>
<!-- task edit/options -->
<taskMeta:>
<div class="{#unless _tasks.editing[:task.id]}visuallyhidden{/} task-options">
{{#if brokenChallengeLink(:task)}}
<div class='well'>
<p>Broken Challenge Link: this task was part of a challenge, but (a) challenge (or containing group) has been deleted, or (b) the task was deleted from the challenge.</p>
<p><a>Keep</a> | <a>Keep all from challenge</a> | <a>Delete</a> | <a>Delete all from challenge</a></p>
</div>
{{/}}
<form x-bind="submit:toggleTaskEdit" >
<!-- text & notes -->
<fieldset class="option-group">
{{#unless taskInChallenge(:task)}}
<label class="option-title">Text</label><input class="option-content" type=text value={:task.text}>
{{/}}
<label class="option-title">Extra Notes</label>
{{#if taskInChallenge(:task)}}
<textarea class="option-content" rows=3 disabled>{{taskAttrFromChallenge(:task,'notes')}}</textarea>
{{else}}
<textarea class="option-content" rows=3>{:task.notes}</textarea>
{{/}}
</fieldset>
<!-- if Habit, plus/minus command options -->
{#if equal(:task.type, 'habit')}
{#unless taskInChallenge(:task)}
<fieldset class="option-group">
<legend class="option-title">Direction/Actions</legend>
<span class="task-checker action-plusminus select-toggle">
<input class="visuallyhidden focusable" type=checkbox id="{{:task.id}}-option-plus" checked={:task.up}>
<label for="{{:task.id}}-option-plus"></label>
</span>
<span class="task-checker action-plusminus select-toggle">
<input class="visuallyhidden focusable" type=checkbox id="{{:task.id}}-option-minus" checked={:task.down}>
<label for="{{:task.id}}-option-minus"></label>
</span>
</fieldset>
{/}
<!-- if Daily, calendar -->
{else if equal(:task.type, 'daily')}
<fieldset class="option-group">
<legend class="option-title">Repeat</legend>
<div class="task-controls tile-group repeat-days">
<!-- note, does not use data-toggle="buttons-checkbox" - it would interfere with our own click binding -->
<button type="button" class="task-action-btn tile {#if :task.repeat.su}active{/}" data-day='su' x-bind=click:toggleDay>Su</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.m}active{/}" data-day='m' x-bind=click:toggleDay>M</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.t}active{/}" data-day='t' x-bind=click:toggleDay>T</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.w}active{/}" data-day='w' x-bind=click:toggleDay>W</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.th}active{/}" data-day='th' x-bind=click:toggleDay>Th</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.f}active{/}" data-day='f' x-bind=click:toggleDay>F</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.s}active{/}" data-day='s' x-bind=click:toggleDay>S</button>
</div>
</fieldset>
<!-- if Reward, pricing -->
{else if equal(:task.type, 'reward')}
<fieldset class="option-group option-short">
<legend class="option-title">Price</legend>
<input class="option-content" size="16" type="number" min="0" value={:task.value}>
<div class="money input-suffix"><span class='shop_gold'></span></div>
</fieldset>
<!-- if Todo, the due date -->
{else if equal(:task.type, 'todo')}
<fieldset class="option-group">
<legend class="option-title">Due Date</legend>
<input class="option-content datepicker" type="text" value="{:task.date}" data-date-format="mm/dd/yyyy">
</fieldset>
{/}
{{#if @main}}<app:filters:filter-fieldgroup />{{/}}
<!-- Advanced Options -->
{#unless equal(:task.type, 'reward')}
<p x-bind="click:tasksToggleAdvanced" class="option-title mega">Advanced Options</p>
<fieldset class="option-group advanced-option visuallyhidden">
<legend class="option-title"><a class='priority-multiplier-help' href="https://trello.com/card/priority-multiplier/50e5d3684fe3a7266b0036d6/17" target="_blank"><i class='icon-question-sign'></i></a> Difficulty</legend>
{{#if taskInChallenge(:task)}}
<button disabled type="button" class="task-action-btn tile active">
{{taskAttrFromChallenge(:task,'priority')}}
</button>
{{else}}
<div class="task-controls tile-group priority-multiplier" data-id="{{:task.id}}">
<button type="button" class="task-action-btn tile {#if or(equal(:task.priority,'!'),not(:task.priority))}active{/}" data-priority='!' x-bind=click:tasksSetPriority>Easy</button>
<button type="button" class="task-action-btn tile {#if equal(:task.priority,'!!')}active{/}" data-priority='!!' x-bind=click:tasksSetPriority>Medium</button>
<button type="button" class="task-action-btn tile {#if equal(:task.priority,'!!!')}active{/}" data-priority='!!!' x-bind=click:tasksSetPriority>Hard</button>
</div>
{{/}}
{{#if equal(:task.type,'daily')}}
<legend class="option-title">Restore Streak</legend>
<input class='option-content' type=number value="{int(:task.streak)}" />
{{/}}
</fieldset>
{/}
<button type=submit class="task-action-btn tile spacious" x-bind="click:tasksSaveAndClose">Save & Close</button>
</form>
</div>
<div class="{#unless _page.charts[:task.id]}hidden{/} {{:task.id}}-chart"></div>

149
views/tasks/task.jade Normal file
View file

@ -0,0 +1,149 @@
li(ng-repeat='task in list.list', class='task {{taskClasses(task,user.filters,user.preferences.dayStart,user.lastCron,_showCompleted,list.main)}}', data-id='{{task.id}}')
// right-hand side control buttons
.task-meta-controls
// Streak
span(ng-show='task.streak') {{task.streak}}
span(rel='tooltip', title='Streak Counter')
i.icon-forward
app:filters:applied-filters
// edit
a(ng-click='task._editing = !task._editing', rel='tooltip', title='Edit')
i.icon-pencil
//- challenges
// {{#if task.challenge}}
// {{#if brokenChallengeLink(task)}}
// <i class='icon-bullhorn' style='background-color:red;' x-bind=click:toggleTaskEdit rel=tooltip title="Broken Challenge Link"></i>
// {{else}}
// <i class='icon-bullhorn' rel=tooltip title="Challenge Task"></i>
// {{/}}
// {{else}}
// delete
a(x-bind='click:del', rel='tooltip', title='Delete')
i.icon-trash
// chart
a(ng-show='task.history', x-bind='click:toggleChart', data-id='{{task.id}}', rel='tooltip', title='Progress')
i.icon-signal
// notes
span.task-notes(ng-show='task.notes', rel='popover', data-trigger='hover', data-placement='left', data-content='{{task.notes}}', data-original-title='{{task.text}}')
i.icon-comment
// left-hand side checkbox
.task-controls.task-primary
// Habits
span(ng-if='list.main && task.type=="habit"')
// only allow scoring on main tasks, not when viewing others' public tasks or when creating challenges
a.task-action-btn(ng-show='task.up', data-direction='up', x-bind='click:score') +
a.task-action-btn(ng-show='task.down', data-direction='down', x-bind='click:score') -
//span(ng-if='!list.main')
// span.task-action-btn(ng-show='task.up') +
// span.task-action-btn(ng-show='task.down') =
// Rewards
span(ng-if='list.main && type=="reward"')
// only allow scoring on main tasks, not when viewing others' public tasks or when creating challenges
a.money.btn-buy(x-bind='click:score', data-direction='down')
span.reward-cost {{task.value}}
span.shop_gold
//span(ng-if='!list.main')
// span.money.btn-buy
// span.reward-cost {{task.value}}
// span.shop_gold
// Daily & Todos
span.task-checker.action-yesno(ng-if='task.type=="daily" || task.type=="todo"')
// only allow scoring on main tasks, not when viewing others' public tasks or when creating challenges
//span(ng-if='list.main')
input.visuallyhidden.focusable(id='box-{{task.id}}', type='checkbox', ng-model='task.completed')
label(for='box-{{task.id}}')
//span(ng-if='!list.main')
// input.visuallyhidden.focusable(id='box-{{task.id}}-static',type='checkbox', checked='false')
// label(for='box-{{task.id}}-static')
// main content
p.task-text
// {{#if taskInChallenge(task)}}
// {{taskAttrFromChallenge(task,'text')}}
// {{else}}
| {{task.text}}
// {{/}}
// edit/options dialog
.task-options(ng-show='task._editing')
// {{#if brokenChallengeLink(task)}}
// <div class='well'>
// <p>Broken Challenge Link: this task was part of a challenge, but (a) challenge (or containing group) has been deleted, or (b) the task was deleted from the challenge.</p>
// <p><a>Keep</a> | <a>Keep all from challenge</a> | <a>Delete</a> | <a>Delete all from challenge</a></p>
// </div>
// {{/}}
form(x-bind='submit:toggleTaskEdit')
// text & notes
fieldset.option-group
// {{#unless taskInChallenge(task)}}
label.option-title Text
input.option-content(type='text', ng-model='task.text')
// {{/}}
label.option-title Extra Notes
// {{#if taskInChallenge(task)}}
// <textarea class="option-content" rows=3 disabled>{{taskAttrFromChallenge(task,'notes')}}</textarea>
// {{else}}
textarea.option-content(rows='3', ng-model='task.notes')
// {{/}}
// if Habit, plus/minus command options
// {{#unless taskInChallenge(task)}}
fieldset.option-group(ng-if='task.type=="habit"')
legend.option-title Direction/Actions
span.task-checker.action-plusminus.select-toggle
input.visuallyhidden.focusable(id='{{task.id}}-option-plus', type='checkbox', checked='{{task.up}}')
label(for='{{task.id}}-option-plus')
span.task-checker.action-plusminus.select-toggle
input.visuallyhidden.focusable(id='{{task.id}}-option-minus', type='checkbox', checked='{{task.down}}')
label(for='{{task.id}}-option-minus')
// {{/}}
// if Daily, calendar
fieldset(ng-if='task.type=="daily"', class="option-group")
legend.option-title Repeat
.task-controls.tile-group.repeat-days
// note, does not use data-toggle="buttons-checkbox" - it would interfere with our own click binding
button.task-action-btn.tile(ng-class='{active: task.repeat.su}', type='button', data-day='su', x-bind='click:toggleDay') Su
button.task-action-btn.tile(ng-class='{active: task.repeat.m}', type='button', data-day='m', x-bind='click:toggleDay') M
button.task-action-btn.tile(ng-class='{active: task.repeat.t}', type='button', data-day='t', x-bind='click:toggleDay') T
button.task-action-btn.tile(ng-class='{active: task.repeat.w}', type='button', data-day='w', x-bind='click:toggleDay') W
button.task-action-btn.tile(ng-class='{active: task.repeat.th}', type='button', data-day='th', x-bind='click:toggleDay') Th
button.task-action-btn.tile(ng-class='{active: task.repeat.f}', type='button', data-day='f', x-bind='click:toggleDay') F
button.task-action-btn.tile(ng-class='{active: task.repeat.s}', type='button', data-day='s', x-bind='click:toggleDay') S
// if Reward, pricing
fieldset.option-group.option-short(ng-if='task.type=="reward"')
legend.option-title Price
input.option-content(type='number', size='16', min='0', value='{{task.value}}')
.money.input-suffix
span.shop_gold
// if Todos, the due date
fieldset.option-group(ng-if='task.type=="todo"')
legend.option-title Due Date
input.option-content.datepicker(type='text', value='{{task.date}}', data-date-format='mm/dd/yyyy')
app:filters:filter-fieldgroup(ng-if='list.main')
// Advanced Options
span(ng-if='task.type=="reward"')
p.option-title.mega(x-bind='clicktasksToggleAdvanced') Advanced Options
fieldset.option-group.advanced-option.visuallyhidden
legend.option-title
a.priority-multiplier-help(href='https://trello.com/card/priority-multiplier/50e5d3684fe3a7266b0036d6/17', target='_blank')
i.icon-question-sign
| Difficulty
// {{#if taskInChallenge(task)}}
// <button disabled type="button" class="task-action-btn tile active">
// {{taskAttrFromChallenge(task,'priority')}}
// </button>
// {{else}}
.task-controls.tile-group.priority-multiplier(data-id='{{task.id}}')
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!" || !task.priority}', data-priority='!', x-bind='clicktasksSetPriority') Easy
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!"}', data-priority='!!', x-bind='clicktasksSetPriority') Medium
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!!"}', data-priority='!!!', x-bind='clicktasksSetPriority') Hard
// {{/}}
span(ng-if='task.type=="daily"')
legend.option-title Restore Streak
input.option-content(type='number', ng-model='task.streak')
button.task-action-btn.tile.spacious(type='submit', x-bind='clicktasksSaveAndClose') Save & Close
div(class='{{task.id}}-chart', ng-show='_page.charts[task.id]')

View file

@ -1,284 +0,0 @@
<task-lists:>
<!--helpTitle & helpContent moved to tour -->
<!--
header="habits"
type="habit"
inputValue={_newHabit}
placeHolder="New Habit"
list={@habits}
main={{@main}}
editable={@editable}
-->
<!-- Habits Column -->
<div class="module" ng-class="'rewards-module': type=='reward'">
<div class="task-column {{type}}s" ng-class="'tabbable tabs-below': type=='todo'">
<!-- todos export/graph options -->
<span ng-if="main && type=='todo'" class='option-box pull-right'>
<a ng-show='user.history.todos' class="option-action" x-bind=click:toggleChart data-id="todos" rel=tooltip title="Progress"><i class=icon-signal></i></a>
<a class="option-action" ng-href="/v1/users/{{user.id}}/calendar.ics?apiToken={{user.apiToken}}" rel=tooltip title="iCal"><i class=icon-calendar></i></a>
<!-- <a href="https://www.google.com/calendar/render?cid={{encodeiCalLink(_user.id, _user.apiToken)}}" rel=tooltip title="Google Calendar"><i class=icon-calendar></i></a> -->
</span>
<!-- cash or gems -->
<span ng-if="main && type=='reward'" class='option-box pull-right wallet'>
<div class="money">
{{gold(floor(user.stats.gp))}}
<span class='shop_gold' rel='tooltip' title='Gold'></span>
</div>
<div class="money">
{{silver(user.stats.gp)}}
<span class='shop_silver' rel='tooltip' title='Silver'></span>
</div>
</span>
<h2 class="task-column_title">{{header}}</h2>
<div ng-if='type == "todo"' class='todos-chart' ng-class="hidden:_page.charts.todos"></div>
<form ng-show='editable' class="addtask-form form-inline new-task-form" ng-class="hidden: _showCompleted && type=='todo'" data-task-type="{{type}}" x-bind="submit:addTask">
<span class="addtask-field"><input value="{{inputValue}}" type="text" placeholder="{{placeHolder}}"/></span>
<input class="addtask-btn" type="submit" value="">
</form>
<hr>
<ul class="{{type}}s" ng-class="hidden: !list">
<app:tasks:task ng-repeat='task in list' />
</ul>
<!-- Static Rewards -->
<ul ng-show="main && type=='reward'" class='items' ng-class="hidden:!user.flags.itemsEnabled">
<app:rewards:item item={{_items.next.weapon}} />
<app:rewards:item item={{_items.next.armor}} />
<app:rewards:item item={{_items.next.head}} />
<app:rewards:item item={{_items.next.shield}} />
<app:rewards:item item={{_items.potion}} />
<app:rewards:item item={{_items.reroll}} />
</ul>
<br/>
<!-- ads -->
<div ng-if="authenticated() && user.flags.ads != hide && main">
<span class='pull-right'>
<a x-bind="click:showStripe" rel='tooltip' title='Remove Ads'><i class='icon-remove'></i></a><br/>
<a href="#" data-target="#why-ads-modal" data-toggle="modal" rel='tooltip' title='Why Ads?'><i class='icon-question-sign'></i></a>
</span>
<a ng-if='type=="habit"' href="http://www.amazon.com/gp/product/1400069289/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1400069289&linkCode=as2&tag=ha0d2-20">The Power of Habit: Why We Do What We Do in Life and Business</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=1400069289" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
<a ng-if='type=="daily"' href="http://www.amazon.com/gp/product/0142000280/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0142000280&linkCode=as2&tag=ha0d2-20">Getting Things Done: The Art of Stress-Free Productivity</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=0142000280" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
<a ng-if='type=="todo"' href="http://www.amazon.com/gp/product/0312430000/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0312430000&linkCode=as2&tag=ha0d2-20">The Checklist Manifesto: How to Get Things Right</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=0312430000" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
<a ng-if='type="reward"' href="http://www.amazon.com/gp/product/1594484805/ref=as_li_tf_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1594484805&linkCode=as2&tag=ha0d2-20">Drive: The Surprising Truth About What Motivates Us</a><img src="//www.assoc-amazon.com/e/ir?t=ha0d2-20&l=as2&o=1&a=1594484805" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</div>
<div ng-if="type='todo'">
<button class='task-action-btn tile spacious bright' ng-show="_showCompleted" x-bind=click:clearCompleted>Clear Completed</button>
<!-- remaining/completed tabs -->
<ul class="nav nav-tabs">
<li ng-class="active:!_showCompleted"><a x-bind="click:todosShowRemaining">Remaining</a></li>
<li ng-class="active:_showCompleted"><a x-bind="click:todosShowCompleted">Complete</a></li>
</ul>
</div>
</div>
</div>
<!-- all the parts of a single task -->
<task:>
<li data-id={{:task.id}} class="task {taskClasses(:task, users[_userId].filters, _user.preferences.dayStart, _user.lastCron, _showCompleted, @main)}">
<!-- right-hand side control buttons -->
<div class="task-meta-controls">
<!-- Streak -->
<span class='{#unless :task.streak}hide{/}'>
{:task.streak}<span rel='tooltip' title='Streak Counter'><i class='icon-forward'></i></span>
</span>
<app:filters:applied-filters />
<!-- edit -->
<a x-bind=click:toggleTaskEdit rel=tooltip title="Edit"><i class="icon-pencil"></i></a>
<!-- challenges -->
{{#if :task.challenge}}
{{#if brokenChallengeLink(:task)}}
<i class='icon-bullhorn' style='background-color:red;' x-bind=click:toggleTaskEdit rel=tooltip title="Broken Challenge Link"></i>
{{else}}
<i class='icon-bullhorn' rel=tooltip title="Challenge Task"></i>
{{/}}
{{else}}
<!-- delete -->
<a x-bind=click:del rel=tooltip title="Delete"><i class="icon-trash"></i></a>
{{/}}
<!-- chart -->
{#if :task.history}
<a x-bind=click:toggleChart data-id="{{:task.id}}" rel="tooltip" title="Progress"><i class="icon-signal"></i></a>
{/}
<!-- notes -->
{#if :task.notes}
<span rel="popover" data-trigger="hover" data-placement="left" data-content="{:task.notes}" data-original-title="{:task.text}" class='task-notes'><i class="icon-comment"></i></span>
{/}
</div>
<!-- left-hand side checkbox -->
<div class="task-controls task-primary">
<!-- Habits -->
{{#if equal(:task.type,'habit')}}
{{#if @main}} <!-- only allow scoring on main tasks, not when viewing others' public tasks or when creating challenges -->
{#if :task.up}<a class="task-action-btn" data-direction=up x-bind=click:score></a>{/}
{#if :task.down}<a class="task-action-btn" data-direction=down x-bind=click:score></a>{/}
{{else}}
{#if :task.up}<span class="task-action-btn"></span>{/}
{#if :task.down}<span class="task-action-btn"></span>{/}
{{/}}
<!-- Rewards -->
{{else if equal(:task.type,'reward')}}
{{#if @main}} <!-- only allow scoring on main tasks, not when viewing others' public tasks or when creating challenges -->
<a class="money btn-buy" x-bind=click:score data-direction=down>
<span class="reward-cost">{:task.value}</span>
<span class='shop_gold'></span>
</a>
{{else}}
<span class="money btn-buy">
<span class="reward-cost">{:task.value}</span>
<span class='shop_gold'></span>
</span>
{{/}}
<!-- Daily & Todos -->
{{else}}
<span class="task-checker action-yesno">
{{#if @main}} <!-- only allow scoring on main tasks, not when viewing others' public tasks or when creating challenges -->
<input type=checkbox id="box-{{:task.id}}" class="visuallyhidden focusable" checked="{:task.completed}">
<label for="box-{{:task.id}}"></label>
{{else}}
<input type=checkbox id="box-{{:task.id}}-static" class="visuallyhidden focusable" checked="false">
<label for="box-{{:task.id}}-static"></label>
{{/}}
</span>
{{/}}
</div>
<!-- main content -->
<p class="task-text">
{{#if taskInChallenge(:task)}}
{{taskAttrFromChallenge(:task,'text')}}
{{else}}
{:task.text}
{{/}}
</p>
<!-- edit/options dialog -->
<app:tasks:taskMeta main={{@main}} />
</li>
<!-- task edit/options -->
<taskMeta:>
<div class="{#unless _tasks.editing[:task.id]}visuallyhidden{/} task-options">
{{#if brokenChallengeLink(:task)}}
<div class='well'>
<p>Broken Challenge Link: this task was part of a challenge, but (a) challenge (or containing group) has been deleted, or (b) the task was deleted from the challenge.</p>
<p><a>Keep</a> | <a>Keep all from challenge</a> | <a>Delete</a> | <a>Delete all from challenge</a></p>
</div>
{{/}}
<form x-bind="submit:toggleTaskEdit" >
<!-- text & notes -->
<fieldset class="option-group">
{{#unless taskInChallenge(:task)}}
<label class="option-title">Text</label><input class="option-content" type=text value={:task.text}>
{{/}}
<label class="option-title">Extra Notes</label>
{{#if taskInChallenge(:task)}}
<textarea class="option-content" rows=3 disabled>{{taskAttrFromChallenge(:task,'notes')}}</textarea>
{{else}}
<textarea class="option-content" rows=3>{:task.notes}</textarea>
{{/}}
</fieldset>
<!-- if Habit, plus/minus command options -->
{#if equal(:task.type, 'habit')}
{#unless taskInChallenge(:task)}
<fieldset class="option-group">
<legend class="option-title">Direction/Actions</legend>
<span class="task-checker action-plusminus select-toggle">
<input class="visuallyhidden focusable" type=checkbox id="{{:task.id}}-option-plus" checked={:task.up}>
<label for="{{:task.id}}-option-plus"></label>
</span>
<span class="task-checker action-plusminus select-toggle">
<input class="visuallyhidden focusable" type=checkbox id="{{:task.id}}-option-minus" checked={:task.down}>
<label for="{{:task.id}}-option-minus"></label>
</span>
</fieldset>
{/}
<!-- if Daily, calendar -->
{else if equal(:task.type, 'daily')}
<fieldset class="option-group">
<legend class="option-title">Repeat</legend>
<div class="task-controls tile-group repeat-days">
<!-- note, does not use data-toggle="buttons-checkbox" - it would interfere with our own click binding -->
<button type="button" class="task-action-btn tile {#if :task.repeat.su}active{/}" data-day='su' x-bind=click:toggleDay>Su</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.m}active{/}" data-day='m' x-bind=click:toggleDay>M</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.t}active{/}" data-day='t' x-bind=click:toggleDay>T</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.w}active{/}" data-day='w' x-bind=click:toggleDay>W</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.th}active{/}" data-day='th' x-bind=click:toggleDay>Th</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.f}active{/}" data-day='f' x-bind=click:toggleDay>F</button>
<button type="button" class="task-action-btn tile {#if :task.repeat.s}active{/}" data-day='s' x-bind=click:toggleDay>S</button>
</div>
</fieldset>
<!-- if Reward, pricing -->
{else if equal(:task.type, 'reward')}
<fieldset class="option-group option-short">
<legend class="option-title">Price</legend>
<input class="option-content" size="16" type="number" min="0" value={:task.value}>
<div class="money input-suffix"><span class='shop_gold'></span></div>
</fieldset>
<!-- if Todo, the due date -->
{else if equal(:task.type, 'todo')}
<fieldset class="option-group">
<legend class="option-title">Due Date</legend>
<input class="option-content datepicker" type="text" value="{:task.date}" data-date-format="mm/dd/yyyy">
</fieldset>
{/}
{{#if @main}}<app:filters:filter-fieldgroup />{{/}}
<!-- Advanced Options -->
{#unless equal(:task.type, 'reward')}
<p x-bind="click:tasksToggleAdvanced" class="option-title mega">Advanced Options</p>
<fieldset class="option-group advanced-option visuallyhidden">
<legend class="option-title"><a class='priority-multiplier-help' href="https://trello.com/card/priority-multiplier/50e5d3684fe3a7266b0036d6/17" target="_blank"><i class='icon-question-sign'></i></a> Difficulty</legend>
{{#if taskInChallenge(:task)}}
<button disabled type="button" class="task-action-btn tile active">
{{taskAttrFromChallenge(:task,'priority')}}
</button>
{{else}}
<div class="task-controls tile-group priority-multiplier" data-id="{{:task.id}}">
<button type="button" class="task-action-btn tile {#if or(equal(:task.priority,'!'),not(:task.priority))}active{/}" data-priority='!' x-bind=click:tasksSetPriority>Easy</button>
<button type="button" class="task-action-btn tile {#if equal(:task.priority,'!!')}active{/}" data-priority='!!' x-bind=click:tasksSetPriority>Medium</button>
<button type="button" class="task-action-btn tile {#if equal(:task.priority,'!!!')}active{/}" data-priority='!!!' x-bind=click:tasksSetPriority>Hard</button>
</div>
{{/}}
{{#if equal(:task.type,'daily')}}
<legend class="option-title">Restore Streak</legend>
<input class='option-content' type=number value="{int(:task.streak)}" />
{{/}}
</fieldset>
{/}
<button type=submit class="task-action-btn tile spacious" x-bind="click:tasksSaveAndClose">Save & Close</button>
</form>
</div>
<div class="{#unless _page.charts[:task.id]}hidden{/} {{:task.id}}-chart"></div>

View file

@ -1,3 +0,0 @@
//
Created by lefnire on 8/25/13.