challenges: add challenge.id to task so we can get the icon-bullhorn

This commit is contained in:
Tyler Renelle 2013-05-12 19:23:16 +01:00
parent ae8a283d0e
commit 0a291bf892
2 changed files with 8 additions and 0 deletions

View file

@ -16,6 +16,12 @@ module.exports.app = (appExports, model) ->
activeFilters = _.reduce user.get('filters'), ((memo,v,k) -> memo[k]=v if v;memo), {}
newTask = {id: model.id(), type: type, text: text, notes: '', value: 0, tags: activeFilters}
isChallenge = e.at().path().indexOf('_challenge.new') != -1
if isChallenge
activeFilters = {}
newTask.challenge = model.get '_challenge.new.id'
switch type
when 'habit'
newTask = _.defaults {up: true, down: true}, newTask

View file

@ -174,6 +174,8 @@
<app:filters:applied-filters />
<!-- edit -->
<a x-bind=click:toggleTaskEdit data-hide-id="{{:task.id}}-chart" data-toggle-id="{{:task.id}}-edit" rel=tooltip title="Edit"><i class="icon-pencil"></i></a>
<!-- challenges -->
{{#if :task.challenge}}<i class='icon-bullhorn' rel=tooltip title="Challenge Task"></i>{{/}}
<!-- delete -->
<a x-bind=click:del rel=tooltip title="Delete"><i class="icon-trash"></i></a>
<!-- chart -->