mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Add latest achievements to clan details page
This commit is contained in:
parent
d4aa9882a9
commit
7f0e9e73a8
2 changed files with 6 additions and 0 deletions
|
@ -50,6 +50,7 @@ block content
|
|||
td Name
|
||||
th Level
|
||||
th Achievements
|
||||
th Latest Achievement
|
||||
th
|
||||
tbody
|
||||
each member in members
|
||||
|
@ -65,6 +66,9 @@ block content
|
|||
td
|
||||
if memberAchievementsMap && memberAchievementsMap[member.id]
|
||||
| #{memberAchievementsMap[member.id].length}
|
||||
td
|
||||
if memberAchievementsMap && memberAchievementsMap[member.id] && memberAchievementsMap[member.id].length
|
||||
span= memberAchievementsMap[member.id][0].get('achievementName')
|
||||
td
|
||||
if isOwner && member.id !== clan.get('ownerID')
|
||||
button.btn.btn-xs.btn-warning.remove-member-btn(data-id="#{member.id}") Remove Hero
|
||||
|
|
|
@ -98,6 +98,8 @@ module.exports = class ClanDetailsView extends RootView
|
|||
user = achievement.get('user')
|
||||
@memberAchievementsMap[user] ?= []
|
||||
@memberAchievementsMap[user].push achievement
|
||||
for user of @memberAchievementsMap
|
||||
@memberAchievementsMap[user].sort (a, b) -> b.id.localeCompare(a.id)
|
||||
@render?()
|
||||
|
||||
onMemberSessionsSync: ->
|
||||
|
|
Loading…
Reference in a new issue