Files
habitica/views/options/challenges/task.jade
T
Tyler Renelle fa25f3d300 challenges: WIP beginning challenges feature. some basic CRUD & some
basic subscribe / unsubscribe functional (but buggy)
2013-10-28 11:34:07 -07:00

113 lines
5.9 KiB
Plaintext

//-
NOTE: This file is a copy of /views/tasks/task.jade, make sure to keep them in sync!
We've cloned it because they differ widely enough that if(challenge)/else checks got out of
hand, and we needed separate controllers.
li(ng-repeat='task in list.tasks', class='task {{taskClasses(task)}}', data-id='{{task.id}}')
.task-meta-controls
// TODO Do we want to show participants' streaks?
//- Streak
span(ng-show='task.streak') {{task.streak}}
span(tooltip='Streak Counter')
i.icon-forward
// edit
a(ng-hide='task._editing', ng-click='toggleEdit(task)', tooltip='Edit')
i.icon-pencil(ng-hide='task._editing')
// cancel
a(ng-hide='!task._editing', ng-click='toggleEdit(task)', tooltip='Cancel')
i.icon-remove(ng-hide='!task._editing')
// delete
a(ng-click='remove(task)', tooltip='Delete')
i.icon-trash
// chart
a(ng-show='task.history', ng-click='toggleChart(task.id, task)', tooltip='Progress')
i.icon-signal
// notes
span.task-notes(ng-show='task.notes && !task._editing', popover-trigger='mouseenter', popover-placement='left', popover='{{task.notes}}', popover-title='{{task.text}}')
i.icon-comment
// left-hand side checkbox
.task-controls.task-primary
// Habits
span(ng-if='task.type=="habit"')
a.task-action-btn(ng-if='task.up') +
a.task-action-btn(ng-if='task.down') -
// Rewards
span(ng-show='task.type=="reward"')
a.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"')
input.visuallyhidden.focusable(id='box-{{task.id}}-static', type='checkbox', ng-model='task.completed')
label(for='box-{{task.id}}-static')
// main content
p.task-text
| {{task.text}}
// edit/options dialog
.task-options(ng-show='task._editing')
form(ng-submit='saveTask(task)')
// text & notes
fieldset.option-group
label.option-title Text
input.option-content(type='text', ng-model='task.text', required)
label.option-title Extra Notes
textarea.option-content(rows='3', ng-model='task.notes')
// if Habit, plus/minus command options
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', ng-model='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', ng-model='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', ng-click='task.repeat.su = !task.repeat.su') Su
button.task-action-btn.tile(ng-class='{active: task.repeat.m}', type='button', data-day='m', ng-click='task.repeat.m = !task.repeat.m') M
button.task-action-btn.tile(ng-class='{active: task.repeat.t}', type='button', data-day='t', ng-click='task.repeat.t = !task.repeat.t') T
button.task-action-btn.tile(ng-class='{active: task.repeat.w}', type='button', data-day='w', ng-click='task.repeat.w = !task.repeat.w') W
button.task-action-btn.tile(ng-class='{active: task.repeat.th}', type='button', data-day='th', ng-click='task.repeat.th = !task.repeat.th') Th
button.task-action-btn.tile(ng-class='{active: task.repeat.f}', type='button', data-day='f', ng-click='task.repeat.f = !task.repeat.f') F
button.task-action-btn.tile(ng-class='{active: task.repeat.s}', type='button', data-day='s', ng-click='task.repeat.s = !task.repeat.s') 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', step="any", ng-model='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', ng-model='task.date', data-date-format='mm/dd/yyyy')
// Advanced Options
span(ng-if='task.type!="reward"')
p.option-title.mega(ng-click='task._advanced = !task._advanced') Advanced Options
fieldset.option-group.advanced-option(ng-class="{visuallyhidden: !task._advanced}")
legend.option-title
a.priority-multiplier-help(href='https://trello.com/card/priority-multiplier/50e5d3684fe3a7266b0036d6/17', target='_blank', popover-title='How difficult is this task?', popover-trigger='mouseenter', popover="This multiplies its point value. Use sparingly, rely instead on our organic value-adjustment algorithms. But some tasks are grossly more valuable (Write Thesis vs Floss Teeth). Click for more info.")
i.icon-question-sign
| Difficulty
.task-controls.tile-group.priority-multiplier(data-id='{{task.id}}')
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!" || !task.priority}', ng-click='task.priority="!"') Easy
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!"}', ng-click='task.priority="!!"') Medium
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!!"}', ng-click='task.priority="!!!"') Hard
button.task-action-btn.tile.spacious(type='submit') Save & Close
div(class='{{task.id}}-chart', ng-show='charts[task.id]')