.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)}') {{task.date | date:(user.preferences.dateFormat.indexOf('yyyy') == 0 ? user.preferences.dateFormat.substr(5) : user.preferences.dateFormat.substr(0,5))}}

  // Streak
  | &nbsp;
  span(ng-show='task.streak') {{task.streak}}&nbsp;
    span(tooltip=env.t('streakCounter'))
      span.glyphicon.glyphicon-forward
      | &nbsp;

  // 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'), ng-class="{'push-down': ctrlPressed}")
      span(ng-hide="ctrlPressed").glyphicon.glyphicon-open
      span(ng-show="ctrlPressed").glyphicon.glyphicon-save
    // 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, user)', tooltip=env.t('edit'))
      | &nbsp;
      span.glyphicon.glyphicon-pencil(ng-hide='task._editing')
    | &nbsp;
    a(ng-hide='!task._editing', ng-click='editTask(task, user)', tooltip=env.t('cancel'))
      span.glyphicon.glyphicon-remove(ng-hide='!task._editing')
      | &nbsp;
    // save
    a(ng-hide='!task._editing', ng-click='editTask(task, user);saveTask(task)', tooltip=env.t('save'))
      span.glyphicon.glyphicon-ok(ng-hide='!task._editing')
    | &nbsp;
    //challenges
    span(ng-if='task.challenge.id')
      span(ng-if='task.challenge.broken')
        a.glyphicon.glyphicon-bullhorn(style='background-color:red;', ng-click='task._editing = true', tooltip=env.t('brokenChaLink') tooltip-placement='right')
        | &nbsp;
      span(ng-if='!task.challenge.broken')
        span.glyphicon.glyphicon-bullhorn(tooltip=env.t('challenge'))
        | &nbsp;
    // delete
    a(ng-if='!task.challenge.id || obj.leader._id === User.user._id', ng-click='removeTask(task, obj)', tooltip=env.t('delete'))
      span.glyphicon.glyphicon-trash
      | &nbsp;

    // chart
    a(ng-show='task.history', ng-click='toggleChart(obj._id+task._id, task)', tooltip=env.t('progress'))
      span.glyphicon.glyphicon-signal
      | &nbsp;
    // notes

  // Make this icon available regardless of task ownership  
  a.task-notes(ng-show='task.notes && !task._editing', ng-click='task.popoverOpen = !task.popoverOpen', popover-trigger='click', data-popover-html="{{task.notes | markdown}}", popover-placement="top", popover-append-to-body='{{::modal ? "false":"true"}}')
    span.glyphicon.glyphicon-comment
    | &nbsp;
