diff --git a/src/app/challenges.coffee b/src/app/challenges.coffee index 4e742e85e4..73927ccef7 100644 --- a/src/app/challenges.coffee +++ b/src/app/challenges.coffee @@ -16,12 +16,18 @@ module.exports.app = (appExports, model) -> id: model.id() uuid: user.get('id') user: helpers.username(model.get('_user.auth'), model.get('_user.profile.name')) + # FIXME group is a stop-gap since derby's not picking up the initial select option `selected={}` until it's changed + group: type:'party', id:model.get('_guilds.0.id') timestamp: +new Date model.set '_challenge.creating', true appExports.challengeSave = -> - model.unshift '_party.challenges', model.get('_challenge.new'), -> challengeDiscard() + gid = + if model.get('_challenge.new.group.type') is 'party' then model.get('_party.id') + else model.get('_challenge.new.group.id') + debugger + model.unshift "groups.#{gid}.challenges", model.get('_challenge.new'), challengeDiscard browser.growlNotification('Challenge Created','success') appExports.challengeDiscard = challengeDiscard = -> diff --git a/views/app/challenges.html b/views/app/challenges.html index eb3171e8ac..1f631fbb31 100644 --- a/views/app/challenges.html +++ b/views/app/challenges.html @@ -33,37 +33,46 @@
{#each _party.challenges as :challenge} -
- -

{:challenge.name} (by {:challenge.user})

- - -
- -
-
-
+ {/}
- Guild + {#each _guilds as :guild} +

{:guild.name}

+ {#each :guild.challenges as :challenge} + + {/} +
+ {/}
- Public + {#each _habitRPG.challenges as :challenge} + + {/}
+ +
+ +

{@challenge.name} (by {@challenge.user})

+ +
+ +
+
+
{#unless _challenge.creating} @@ -86,34 +95,38 @@
- {#if equal(_challenge.new.assignTo,'Party')} -
-
-
All Party
- No individual privacy on the challenge, all party members can see progress even if they decline the challenge. Any new party members can subscribe to this challenge. -
-
-
Individual Members
-
- -
-
Only the invited party members can subscribe to this challenge. New party joins won't see this challenge.
-
-
+ + + + + + + + + + + + + + + + + + - {/} - {#if equal(_challenge.new.assignTo,'Guild')} - Which Guild? + + {#if equal(_challenge.new.group.type,'guild')} + {/}