2013-12-02 02:51:36 +00:00
li(bindonce='list', ng-repeat='task in obj[list.type+"s"]', class='task {{taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && castEnd(task, "task", $event)', ng-class='{"cast-target":spell}')
2013-08-25 15:47:10 +00:00
// right-hand side control buttons
.task-meta-controls
2013-10-28 01:10:22 +00:00
2013-09-12 21:04:52 +00:00
// Due Date
span.task-date(ng-if='task.type=="todo" && task.date')
| {{task.date}}
2013-08-25 15:47:10 +00:00
// Streak
span(ng-show='task.streak') {{task.streak}}
2013-08-26 00:39:47 +00:00
span(tooltip='Streak Counter')
2013-08-25 15:47:10 +00:00
i.icon-forward
2013-08-28 22:11:00 +00:00
2013-10-28 01:10:22 +00:00
// Icons only available if you own the tasks (aka, hidden from challenge stats)
span(ng-if='!obj._locked')
i.icon-tags(tooltip='{{appliedTags(user.tags, task.tags)}}', ng-hide='noTags(task.tags)')
// edit
a(ng-hide='task._editing', ng-click='editTask(task)', tooltip='Edit')
i.icon-pencil(ng-hide='task._editing')
// cancel
a(ng-hide='!task._editing', ng-click='editTask(task)', tooltip='Cancel')
i.icon-remove(ng-hide='!task._editing')
2013-11-14 13:01:58 +00:00
// save
a(ng-hide='!task._editing', ng-click='editTask(task);saveTask(task)', tooltip='Save')
i.icon-ok(ng-hide='!task._editing')
2013-10-28 01:10:22 +00:00
//challenges
span(ng-if='task.challenge.id')
span(ng-if='task.challenge.broken')
2013-10-30 03:37:22 +00:00
i.icon-bullhorn(style='background-color:red;', ng-click='task._editing = true', tooltip="Broken Challenge Link", tooltip-placement='right')
2013-10-28 01:10:22 +00:00
span(ng-if='!task.challenge.broken')
2013-10-30 03:37:22 +00:00
i.icon-bullhorn(tooltip="Challenge")
2013-10-28 01:10:22 +00:00
// delete
2013-10-30 02:07:39 +00:00
a(ng-if='!task.challenge.id', ng-click='removeTask(obj[list.type+"s"], $index)', tooltip='Delete')
2013-10-28 01:10:22 +00:00
i.icon-trash
2013-08-25 15:47:10 +00:00
// chart
2013-10-28 01:10:22 +00:00
a(ng-show='task.history', ng-click='toggleChart(obj._id+task.id, task)', tooltip='Progress')
2013-08-25 15:47:10 +00:00
i.icon-signal
// notes
2013-10-19 23:15:48 +00:00
span.task-notes(ng-show='task.notes && !task._editing', popover-trigger='mouseenter', popover-placement='left', popover='{{task.notes}}', popover-title='{{task.text}}')
2013-08-25 15:47:10 +00:00
i.icon-comment
// left-hand side checkbox
.task-controls.task-primary
// Habits
2013-11-22 23:16:24 +00:00
span(bo-if='task.type=="habit"')
2013-11-01 17:20:14 +00:00
// score() is overridden in challengesCtrl to do nothing
2013-09-13 16:23:02 +00:00
a.task-action-btn(ng-if='task.up', ng-click='score(task,"up")') +
a.task-action-btn(ng-if='task.down', ng-click='score(task,"down")') -
2013-08-25 15:47:10 +00:00
// Rewards
2013-10-27 00:23:52 +00:00
span(ng-show='task.type=="reward"')
2013-08-25 18:35:26 +00:00
a.money.btn-buy(ng-click='score(task, "down")')
2013-08-25 15:47:10 +00:00
span.reward-cost {{task.value}}
span.shop_gold
// Daily & Todos
2013-11-22 23:16:24 +00:00
span.task-checker.action-yesno(bo-if='task.type=="daily" || task.type=="todo"')
2013-11-01 17:20:14 +00:00
input.visuallyhidden.focusable(ng-if='$state.includes("tasks")', id='box-{{obj._id}}_{{task.id}}', type='checkbox', ng-model='task.completed', ng-change='changeCheck(task)')
input.visuallyhidden.focusable(ng-if='!$state.includes("tasks")', id='box-{{obj._id}}_{{task.id}}', type='checkbox')
2013-11-01 16:48:22 +00:00
label(for='box-{{obj._id}}_{{task.id}}')
2013-08-25 15:47:10 +00:00
// main content
p.task-text
2013-09-12 21:04:52 +00:00
| {{task.text}}
2013-08-25 15:47:10 +00:00
// edit/options dialog
.task-options(ng-show='task._editing')
2013-10-27 17:38:28 +00:00
// Broken Challenge
.well(ng-if='task.challenge.broken')
2013-10-27 21:44:50 +00:00
div(ng-if='task.challenge.broken=="TASK_DELETED"')
2013-10-27 17:38:28 +00:00
p Broken Challenge Link: this task was part of a challenge, but has been removed from it. What would you like to do?
p
2013-10-27 22:27:01 +00:00
a(ng-click='unlink(task, "keep")') Keep It
2013-10-27 17:38:28 +00:00
| |
2013-10-30 03:37:22 +00:00
a(ng-click="removeTask(obj[list.type+'s'], $index)") Remove It
2013-10-27 21:44:50 +00:00
div(ng-if='task.challenge.broken=="CHALLENGE_DELETED"')
2013-10-27 17:38:28 +00:00
p Broken Challenge Link: this task was part of a challenge, but the challenge (or group) has been deleted. What to do with the orphan tasks?
p
2013-10-27 22:27:01 +00:00
a(ng-click='unlink(task, "keep-all")') Keep Them
2013-10-27 17:38:28 +00:00
| |
2013-10-27 22:27:01 +00:00
a(ng-click='unlink(task, "remove-all")') Remove Them
2013-10-31 20:49:31 +00:00
div(ng-if='task.challenge.broken=="CHALLENGE_CLOSED"')
2013-10-31 21:06:18 +00:00
p.
This challenge has been completed, and the winner was <span class='badge'>{{task.challenge.winner}}</span>! What to do with the orphan tasks?
2013-10-31 20:49:31 +00:00
p
a(ng-click='unlink(task, "keep-all")') Keep Them
| |
a(ng-click='unlink(task, "remove-all")') Remove Them
2013-11-23 17:26:39 +00:00
//div(ng-if='task.challenge.broken=="UNSUBSCRIBED"')
2013-10-27 17:38:28 +00:00
p Broken Challenge Link: this task was part of a challenge, but you have unsubscribed from the challenge. What to do with the orphan tasks?
p
a(ng-click="unlink(task, 'keep-all')") Keep Them
| |
a(ng-click="unlink(task, 'remove-all')") Remove Them
2013-10-27 00:23:52 +00:00
form(ng-submit='saveTask(task)')
2013-08-25 15:47:10 +00:00
// text & notes
fieldset.option-group
label.option-title Text
2013-10-27 17:38:28 +00:00
input.option-content(type='text', ng-model='task.text', required, ng-disabled='task.challenge.id')
2013-08-25 15:47:10 +00:00
label.option-title Extra Notes
2013-10-27 17:38:28 +00:00
textarea.option-content(rows='3', ng-model='task.notes', ng-disabled='task.challenge.id')
2013-08-25 15:47:10 +00:00
// if Habit, plus/minus command options
2013-10-27 17:38:28 +00:00
fieldset.option-group(ng-if='task.type=="habit" && !task.challenge.id')
2013-08-25 15:47:10 +00:00
legend.option-title Direction/Actions
span.task-checker.action-plusminus.select-toggle
2013-11-01 16:48:22 +00:00
input.visuallyhidden.focusable(id='{{obj._id}}_{{task.id}}-option-plus', type='checkbox', ng-model='task.up')
label(for='{{obj._id}}_{{task.id}}-option-plus')
2013-08-25 15:47:10 +00:00
span.task-checker.action-plusminus.select-toggle
2013-11-01 16:48:22 +00:00
input.visuallyhidden.focusable(id='{{obj._id}}_{{task.id}}-option-minus', type='checkbox', ng-model='task.down')
label(for='{{obj._id}}_{{task.id}}-option-minus')
2013-10-27 17:38:28 +00:00
2013-08-25 15:47:10 +00:00
// if Daily, calendar
2013-11-22 23:16:24 +00:00
fieldset(bo-if='task.type=="daily"', class="option-group")
2013-08-25 15:47:10 +00:00
legend.option-title Repeat
2013-11-25 16:38:07 +00:00
.task-controls.tile-group.repeat-days(bindonce)
2013-08-25 15:47:10 +00:00
// note, does not use data-toggle="buttons-checkbox" - it would interfere with our own click binding
2013-11-25 16:38:07 +00:00
button.task-action-btn.tile(ng-class='{active: task.repeat.su}', type='button', ng-click='task.challenge.id || (task.repeat.su = !task.repeat.su)' bo-text='moment.weekdaysMin(0)')
button.task-action-btn.tile(ng-class='{active: task.repeat.m}', type='button', ng-click='task.challenge.id || (task.repeat.m = !task.repeat.m)' bo-text='moment.weekdaysMin(1)')
button.task-action-btn.tile(ng-class='{active: task.repeat.t}', type='button', ng-click='task.challenge.id || (task.repeat.t = !task.repeat.t)' bo-text='moment.weekdaysMin(2)')
button.task-action-btn.tile(ng-class='{active: task.repeat.w}', type='button', ng-click='task.challenge.id || (task.repeat.w = !task.repeat.w)' bo-text='moment.weekdaysMin(3)')
button.task-action-btn.tile(ng-class='{active: task.repeat.th}', type='button', ng-click='task.challenge.id || (task.repeat.th = !task.repeat.th)' bo-text='moment.weekdaysMin(4)')
button.task-action-btn.tile(ng-class='{active: task.repeat.f}', type='button', ng-click='task.challenge.id || (task.repeat.f= !task.repeat.f)' bo-text='moment.weekdaysMin(5)')
button.task-action-btn.tile(ng-class='{active: task.repeat.s}', type='button', ng-click='task.challenge.id || (task.repeat.s = !task.repeat.s)' bo-text='moment.weekdaysMin(6)')
2013-10-27 17:38:28 +00:00
2013-08-25 15:47:10 +00:00
// if Reward, pricing
2013-10-27 17:38:28 +00:00
fieldset.option-group.option-short(ng-if='task.type=="reward" && !task.challenge.id')
2013-08-25 15:47:10 +00:00
legend.option-title Price
2013-09-13 18:01:22 +00:00
input.option-content(type='number', size='16', min='0', step="any", ng-model='task.value')
2013-08-25 15:47:10 +00:00
.money.input-suffix
span.shop_gold
2013-10-27 17:38:28 +00:00
2013-08-25 15:47:10 +00:00
// if Todos, the due date
2013-10-27 17:38:28 +00:00
fieldset.option-group(ng-if='task.type=="todo" && !task.challenge.id')
2013-08-25 15:47:10 +00:00
legend.option-title Due Date
2013-09-12 18:32:17 +00:00
input.option-content.datepicker(type='text', data-date-format='mm/dd/yyyy', ng-model='task.date')
2013-08-28 22:11:00 +00:00
2013-11-05 17:49:01 +00:00
fieldset.option-group(ng-if='!$state.includes("options.social.challenges")')
2013-08-28 22:11:00 +00:00
legend.option-title Tags
2013-11-23 05:22:28 +00:00
label.checkbox(ng-repeat='tag in user.tags')
input(type='checkbox', ng-model='task.tags[tag.id]')
| {{tag.name}}
2013-08-28 22:11:00 +00:00
2013-08-25 15:47:10 +00:00
// Advanced Options
2013-11-22 23:16:24 +00:00
span(bo-if='task.type!="reward"')
2013-08-25 17:44:49 +00:00
p.option-title.mega(ng-click='task._advanced = !task._advanced') Advanced Options
fieldset.option-group.advanced-option(ng-class="{visuallyhidden: !task._advanced}")
2013-08-25 15:47:10 +00:00
legend.option-title
2013-08-28 20:48:27 +00:00
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.")
2013-08-25 15:47:10 +00:00
i.icon-question-sign
| Difficulty
2013-11-01 16:48:22 +00:00
.task-controls.tile-group.priority-multiplier
2013-11-10 16:35:29 +00:00
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!" || !task.priority}', ng-click='task.challenge.id || (task.priority="!")') Easy
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!"}', ng-click='task.challenge.id || (task.priority="!!")') Medium
button.task-action-btn.tile(type='button', ng-class='{active: task.priority=="!!!"}', ng-click='task.challenge.id || (task.priority="!!!")') Hard
2013-11-23 17:26:39 +00:00
//span(ng-if='task.type=="daily" && !task.challenge.id')
2013-11-23 18:55:56 +00:00
span(ng-if='task.type=="daily"')
2013-08-25 15:47:10 +00:00
legend.option-title Restore Streak
input.option-content(type='number', ng-model='task.streak')
2013-11-16 10:22:12 +00:00
legend.option-title Attributes
.task-controls.tile-group
button.task-action-btn.tile(type='button') Physical
button.task-action-btn.tile(type='button') Mental
button.task-action-btn.tile(type='button') Social
button.task-action-btn.tile(type='button') Other
2013-08-25 17:44:49 +00:00
button.task-action-btn.tile.spacious(type='submit') Save & Close
2013-08-25 15:47:10 +00:00
2013-10-28 01:10:22 +00:00
div(class='{{obj._id}}{{task.id}}-chart', ng-show='charts[obj._id+task.id]')