From 0a291bf8922d31e5e3300df3c8fa87d2506fa364 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sun, 12 May 2013 19:23:16 +0100 Subject: [PATCH] challenges: add challenge.id to task so we can get the icon-bullhorn --- src/app/tasks.coffee | 6 ++++++ views/app/tasks.html | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/app/tasks.coffee b/src/app/tasks.coffee index 095314b0f7..f5c307bb4d 100644 --- a/src/app/tasks.coffee +++ b/src/app/tasks.coffee @@ -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 diff --git a/views/app/tasks.html b/views/app/tasks.html index 6996b68382..e6b2083618 100644 --- a/views/app/tasks.html +++ b/views/app/tasks.html @@ -174,6 +174,8 @@ + + {{#if :task.challenge}}{{/}}