// left-hand side checkbox
.task-controls.task-primary(ng-if='!task._editing')

  // Habits
  .task-actions(ng-if='::task.type=="habit"')
    // score() is overridden in challengesCtrl to do nothing
    input.task-input.habit.visuallyhidden(
      ng-if='task.up',
      type='checkbox',
      ui-keypress='{ 13:"score(task, \'up\')" }' )
    a(ng-if='task.up', ng-click='applyingAction || score(task,"up")')
      span.glyphicon.glyphicon-plus
    input.task-input.habit.visuallyhidden(
      ng-if='task.down',
      type='checkbox',
      ui-keypress='{ 13:"score(task, \'down\')" }' )
    a(ng-if='task.down', ng-click='applyingAction || score(task,"down")')
      span.glyphicon.glyphicon-minus

  // Rewards
  span(ng-if='::task.type=="reward"')
    input.task-input.reward.visuallyhidden(
      type='checkbox',
      ui-keypress='{ 13:"score(task, \'down\')" }' )
    a.money.btn-buy(ng-class='{highValue: task.value >= 1000}', ng-click='score(task, "down")')
      span.shop_gold
      span.reward-cost {{task.value}}

  // Daily & Todos
  span.task-checker.action-yesno(ng-if='::task.type=="daily" || task.type=="todo"')
    input.task-input.visuallyhidden.focusable(id='box-{{::obj._id}}_{{::task._id}}', type='checkbox',
      ng-model='task.completed', ng-if='$state.includes("tasks")',
      ng-change='changeCheck(task)'
      ui-keypress='{13:"task.completed = !task.completed; changeCheck(task)"}' )
    input.visuallyhidden.focusable(id='box-{{::obj._id}}_{{::task._id}}', type='checkbox',
      ng-if='!$state.includes("tasks")')
    label(for='box-{{::obj._id}}_{{::task._id}}')

// main content
.task-text(ng-dblclick='task._editing ? saveTask(task) : editTask(task)')
  markdown(text='task.text',target='_blank')

  div(ng-if='task.checklist && !$state.includes("options.social.challenges") && !task.collapseChecklist && !task._editing')
    fieldset.option-group.task-checklist
      label.checkbox(ng-repeat='item in task.checklist')
        input(type='checkbox', ng-model='item.completed', ng-change='saveTask(task,true)')
        markdown(text='item.text', target='_blank')
