challenges: lock down editing capabilities on certain task properties,
instead showing the challenge's properties (in case they change challenge-side).This includes editing the tag name
This commit is contained in:
+18
-1
@@ -101,4 +101,21 @@ module.exports.viewHelpers = (view) ->
|
||||
|
||||
#Tags
|
||||
view.fn 'noTags', helpers.noTags
|
||||
view.fn 'appliedTags', helpers.appliedTags
|
||||
view.fn 'appliedTags', helpers.appliedTags
|
||||
|
||||
#Challenges
|
||||
view.fn 'taskAttrFromChallenge', (task, attr) ->
|
||||
[tid, gid, cid, tType, gType] = [task.id, task.group.id, task.challenge, task.type, task.group.type]
|
||||
findAttr = (challenges) ->
|
||||
challenge = _.find(challenges,{id:cid})
|
||||
val = _.find(challenge["#{tType}s"],{id:tid})[attr]
|
||||
if attr is 'priority'
|
||||
val = switch val
|
||||
when '!!!' then 'Hard'
|
||||
when '!!' then 'Medium'
|
||||
else 'Easy'
|
||||
return val
|
||||
if gType is 'party'
|
||||
findAttr @model.get("_party.challenges")
|
||||
else if gType is 'guild'
|
||||
findAttr _.find(@model.get("_guilds"),{id:gid}).challenges
|
||||
Reference in New Issue
Block a user