mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 10:12:21 +00:00
219 lines
13 KiB
Text
219 lines
13 KiB
Text
li(bindonce='list', bo-id='"task-"+task.id', ng-repeat='task in obj[list.type+"s"]', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && castEnd(task, "task", $event)', ng-class='{"cast-target":spell}', popover-trigger='mouseenter', popover-placement='top', popover='{{task.notes}}')
|
|
// right-hand side control buttons
|
|
.task-meta-controls
|
|
|
|
// Due Date
|
|
span(ng-if='task.type=="todo" && task.date')
|
|
span(ng-class='{"label label-danger":(moment(task.date).isBefore(_today, "days") && !task.completed)}') {{moment(task.date).format('MM/DD')}}
|
|
// Streak
|
|
|
|
|
span(ng-show='task.streak') {{task.streak}}
|
|
span(tooltip=env.t('streakCounter'))
|
|
span.glyphicon.glyphicon-forward
|
|
|
|
|
|
|
// Icons only available if you own the tasks (aka, hidden from challenge stats)
|
|
span(ng-if='!obj._locked')
|
|
a(ng-click='pushTask(task,$index,"top")', tooltip=env.t('pushTaskToTop'))
|
|
span.glyphicon.glyphicon-open
|
|
// a(ng-click='pushTask(task,$index,"bottom")', tooltip=env.t('pushTaskToBottom'))
|
|
// span.glyphicon.glyphicon-import
|
|
// // glyphicon-import or glyphicon-save or glyphicon-sort-by-attributes
|
|
a.badge(ng-if='task.checklist[0]', ng-class='{"badge-success":checklistCompletion(task.checklist) == task.checklist.length}', ng-click='collapseChecklist(task)', tooltip=env.t('expandCollapse'))
|
|
{{checklistCompletion(task.checklist)}}/{{task.checklist.length}}
|
|
span.glyphicon.glyphicon-tags(tooltip='{{Shared.appliedTags(user.tags, task.tags)}}', ng-hide='Shared.noTags(task.tags)')
|
|
// edit
|
|
a(ng-hide='task._editing', ng-click='editTask(task)', tooltip=env.t('edit'))
|
|
|
|
|
span.glyphicon.glyphicon-pencil(ng-hide='task._editing')
|
|
|
|
|
a(ng-hide='!task._editing', ng-click='editTask(task)', tooltip=env.t('cancel'))
|
|
span.glyphicon.glyphicon-remove(ng-hide='!task._editing')
|
|
|
|
|
// save
|
|
a(ng-hide='!task._editing', ng-click='editTask(task);saveTask(task)', tooltip=env.t('save'))
|
|
span.glyphicon.glyphicon-ok(ng-hide='!task._editing')
|
|
|
|
|
//challenges
|
|
span(ng-if='task.challenge.id')
|
|
span(ng-if='task.challenge.broken')
|
|
span.glyphicon.glyphicon-bullhorn(style='background-color:red;', ng-click='task._editing = true', tooltip=env.t('brokenChaLink') tooltip-placement='right')
|
|
|
|
|
span(ng-if='!task.challenge.broken')
|
|
span.glyphicon.glyphicon-bullhorn(tooltip=env.t('challenge'))
|
|
|
|
|
// delete
|
|
a(ng-if='!task.challenge.id', ng-click='removeTask(obj[list.type+"s"], $index)', tooltip=env.t('delete'))
|
|
span.glyphicon.glyphicon-trash
|
|
|
|
|
|
|
// chart
|
|
a(ng-show='task.history', ng-click='toggleChart(obj._id+task.id, task)', tooltip=env.t('progress'))
|
|
span.glyphicon.glyphicon-signal
|
|
|
|
|
// notes
|
|
span.task-notes(ng-show='task.notes && !task._editing')
|
|
span.glyphicon.glyphicon-comment
|
|
|
|
|
|
|
// left-hand side checkbox
|
|
.task-controls.task-primary(ng-if='!task._editing')
|
|
|
|
// Habits
|
|
span(bo-if='task.type=="habit"')
|
|
// score() is overridden in challengesCtrl to do nothing
|
|
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")') -
|
|
|
|
// Rewards
|
|
span(ng-show='task.type=="reward"')
|
|
a.money.btn-buy(ng-click='score(task, "down")')
|
|
span.reward-cost {{task.value}}
|
|
span.shop_gold
|
|
|
|
// Daily & Todos
|
|
span.task-checker.action-yesno(bo-if='task.type=="daily" || task.type=="todo"')
|
|
input.visuallyhidden.focusable(ng-if='$state.includes("tasks")', id='box-{{obj._id}}_{{task.id}}', type='checkbox', ng-model='task.completed', ng-change='task.type=="todo" && pushTask(task,$index,"bottom"); changeCheck(task)')
|
|
input.visuallyhidden.focusable(ng-if='!$state.includes("tasks")', id='box-{{obj._id}}_{{task.id}}', type='checkbox')
|
|
label(for='box-{{obj._id}}_{{task.id}}')
|
|
|
|
// main content
|
|
div.task-text(ng-dblclick='task._editing ? saveTask(task) : editTask(task)')
|
|
markdown(ng-model='task.text',target='_blank')
|
|
//-| {{task.text}}
|
|
|
|
div(ng-if='task.checklist && !$state.includes("options.social.challenges") && !task.collapseChecklist && !task._editing')
|
|
fieldset.option-group
|
|
label.checkbox(ng-repeat='item in task.checklist')
|
|
input(type='checkbox',ng-model='item.completed',ng-change='saveTask(task,true)')
|
|
markdown(ng-model='item.text',target='_blank')
|
|
|
|
// edit/options dialog
|
|
div(ng-if='task._editing')
|
|
.task-options
|
|
|
|
// Broken Challenge
|
|
.well(ng-if='task.challenge.broken')
|
|
div(ng-if='task.challenge.broken=="TASK_DELETED"')
|
|
p=env.t('brokenTask')
|
|
p
|
|
a(ng-click='unlink(task, "keep")')=env.t('keepIt')
|
|
|
|
|
a(ng-click="removeTask(obj[list.type+'s'], $index)")=env.t('removeIt')
|
|
div(ng-if='task.challenge.broken=="CHALLENGE_DELETED"')
|
|
p
|
|
|
|
|
=env.t('brokenChallenge')
|
|
p
|
|
a(ng-click='unlink(task, "keep-all")')=env.t('keepThem')
|
|
| |
|
|
a(ng-click='unlink(task, "remove-all")')=env.t('removeThem')
|
|
div(ng-if='task.challenge.broken=="CHALLENGE_CLOSED"')
|
|
p
|
|
!=env.t('challengeCompleted', {user: "{{task.challenge.winner}}"})
|
|
p
|
|
a(ng-click='unlink(task, "keep-all")')=env.t('keepThem')
|
|
| |
|
|
a(ng-click='unlink(task, "remove-all")')=env.t('removeThem')
|
|
//div(ng-if='task.challenge.broken=="UNSUBSCRIBED"')
|
|
p=env.t('unsubChallenge')
|
|
p
|
|
a(ng-click="unlink(task, 'keep-all')")=env.t('keepThem')
|
|
| |
|
|
a(ng-click="unlink(task, 'remove-all')")=env.t('removeThem')
|
|
|
|
// Checklists
|
|
div(ng-if='!$state.includes("options.social.challenges")')
|
|
button.btn.btn-default.btn-sm(ng-if='!task.checklist[0] && (task.type=="daily" || task.type=="todo")',ng-click='addChecklist(task)')
|
|
span.glyphicon.glyphicon-tasks
|
|
|
|
|
=env.t('addChecklist')
|
|
form.checklist-form(ng-if='task.checklist')
|
|
fieldset.option-group.task-checklist(ng-if='!$state.includes("options.social.challenges")')
|
|
legend.option-title
|
|
span.hint(popover=env.t('checklistText'),popover-trigger='mouseenter',popover-placement='bottom')=env.t('checklist')
|
|
ul.list-unstyled
|
|
li(ng-repeat='item in task.checklist')
|
|
a.pull-right.checklist-icons(ng-click='removeChecklistItem(task,$event,$index,true)')
|
|
span.glyphicon.glyphicon-trash(tooltip=env.t('delete'))
|
|
input(type='checkbox',ng-model='item.completed',ng-change='saveTask(task,true)')
|
|
input.inline-edit(type='text',ng-model='item.text',ui-keydown="{'8 46':'removeChecklistItem(task,$event,$index)'}",ui-keyup="{'13':'addChecklistItem(task,$event,$index)','38 40':'navigateChecklist(task,$index,$event)'}")//-,ng-blur='saveTask(task,true)')
|
|
|
|
|
|
form(ng-submit='saveTask(task)')
|
|
// text & notes
|
|
fieldset.option-group
|
|
label.option-title=env.t('text')
|
|
input.option-content(type='text', ng-model='task.text', required, ng-disabled='task.challenge.id')
|
|
|
|
label.option-title=env.t('extraNotes')
|
|
textarea.option-content(rows='3', ng-model='task.notes')
|
|
|
|
// if Habit, plus/minus command options
|
|
fieldset.option-group(ng-if='task.type=="habit" && !task.challenge.id')
|
|
legend.option-title=env.t('direction/Actions')
|
|
span.task-checker.action-plusminus.select-toggle
|
|
input.visuallyhidden.focusable(id='{{obj._id}}_{{task.id}}-option-plus', type='checkbox', ng-model='task.up')
|
|
label(for='{{obj._id}}_{{task.id}}-option-plus')
|
|
span.task-checker.action-plusminus.select-toggle
|
|
input.visuallyhidden.focusable(id='{{obj._id}}_{{task.id}}-option-minus', type='checkbox', ng-model='task.down')
|
|
label(for='{{obj._id}}_{{task.id}}-option-minus')
|
|
|
|
// if Daily, calendar
|
|
fieldset(bo-if='task.type=="daily"', class="option-group")
|
|
legend.option-title=env.t('repeat')
|
|
.task-controls.tile-group.repeat-days(bindonce)
|
|
// 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', 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)')
|
|
|
|
// if Reward, pricing
|
|
fieldset.option-group.option-short(ng-if='task.type=="reward" && !task.challenge.id')
|
|
legend.option-title=env.t('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" && !task.challenge.id')
|
|
legend.option-title=env.t('dueDate')
|
|
input.option-content.datepicker(type='text', datepicker-popup='MM/dd/yyyy', ng-model='task.date')
|
|
|
|
// Tags
|
|
fieldset.option-group(ng-if='!$state.includes("options.social.challenges")')
|
|
p.option-title.mega(ng-click='task._tags = !task._tags', tooltip=env.t('expandCollapse'))=env.t('tags')
|
|
label.checkbox(ng-repeat='tag in user.tags', ng-class="{visuallyhidden: task._tags}")
|
|
input(type='checkbox', ng-model='task.tags[tag.id]')
|
|
markdown(ng-model='tag.name')
|
|
|
|
// Advanced Options
|
|
span(bo-if='task.type!="reward"')
|
|
p.option-title.mega(ng-click='task._advanced = !task._advanced', tooltip=env.t('expandCollapse'))=env.t('advancedOptions')
|
|
fieldset.option-group.advanced-option(ng-class="{visuallyhidden: task._advanced}")
|
|
legend.option-title
|
|
a.hint.priority-multiplier-help(href='https://trello.com/card/priority-multiplier/50e5d3684fe3a7266b0036d6/17', target='_blank', popover-title=env.t('difficultyHelpTitle'), popover-trigger='mouseenter', popover=env.t('difficultyHelpContent'))=env.t('difficulty')
|
|
.task-controls.tile-group.priority-multiplier
|
|
button.task-action-btn.tile(type='button', ng-class='{active: task.priority==1 || !task.priority}', ng-click='task.challenge.id || (task.priority=1)')=env.t('easy')
|
|
button.task-action-btn.tile(type='button', ng-class='{active: task.priority==1.5}', ng-click='task.challenge.id || (task.priority=1.5)')=env.t('medium')
|
|
button.task-action-btn.tile(type='button', ng-class='{active: task.priority==2}', ng-click='task.challenge.id || (task.priority=2)')=env.t('hard')
|
|
//span(ng-if='task.type=="daily" && !task.challenge.id')
|
|
span(ng-if='task.type=="daily"')
|
|
legend.option-title.pull-left=env.t('restoreStreak')
|
|
input.option-content(type='number', ng-model='task.streak')
|
|
|
|
div(ng-if='(user.preferences.allocationMode == "taskbased" && user.preferences.automaticAllocation) || $state.is("options.social.challenges")')
|
|
legend.option-title.pull-left=env.t('attributes')
|
|
.task-controls.tile-group.task-attributes
|
|
button.task-action-btn.tile(type='button', ng-class='{active: task.attribute=="str"}', ng-click='task.attribute="str"')=env.t('physical')
|
|
button.task-action-btn.tile(type='button', ng-class='{active: task.attribute=="int"}', ng-click='task.attribute="int"')=env.t('mental')
|
|
button.task-action-btn.tile(type='button', ng-class='{active: task.attribute=="con"}', ng-click='task.attribute="con"')=env.t('social')
|
|
button.task-action-btn.tile(type='button', ng-class='{active: task.attribute=="per"}', ng-click='task.attribute="per"', popover=env.t('otherExamples'), popover-trigger='mouseenter', popover-placement='top')=env.t('other')
|
|
|
|
button.task-action-btn.tile.spacious(type='submit')=env.t('saveAndClose')
|
|
|
|
div(class='{{obj._id}}{{task.id}}-chart', ng-show='charts[obj._id+task.id]')
|