codecombat/app/templates/clans/clan-details.jade

182 lines
7.5 KiB
Text
Raw Normal View History

extends /templates/base
block content
.modal#editNameModal
.modal-dialog
.modal-header
button.close(data-dismiss='modal')
span ×
h3.modal-title Edit Clan Name
.modal-body
input.edit-name-input(type='text' value="#{clan.get('name')}")
.modal-footer
button.btn(data-dismiss='modal') Close
button.btn.edit-name-save-btn Save changes
.modal#editDescriptionModal
.modal-dialog
.modal-header
button.close(data-dismiss='modal')
span ×
h3.modal-title Edit Clan Description
.modal-body
textarea.edit-description-input(rows=2)= clan.get('description')
.modal-footer
button.btn(data-dismiss='modal') Close
button.btn.edit-description-save-btn Save changes
2015-04-03 12:52:25 -04:00
if clan
h1 #{clan.get('name')}
if clan.get('type') === 'private'
small (private)
if clan.get('ownerID') === me.id
span.spl
button.btn.btn-xs.edit-name-btn(data-toggle='modal', data-target='#editNameModal') edit name
2015-04-03 17:09:43 -04:00
if clan.get('description')
.clan-description
each line in clan.get('description').split('\n')
p= line
if clan.get('ownerID') === me.id
button.btn.btn-xs.edit-description-btn(data-toggle='modal', data-target='#editDescriptionModal') edit description
2015-04-03 17:09:43 -04:00
2015-04-03 17:48:00 -04:00
h5 Summary
table.table.table-condensed.stats-table
2015-04-03 14:05:37 -04:00
if owner
2015-04-03 17:48:00 -04:00
tr
td
span.spr Chieftain
td
2015-04-03 19:44:35 -04:00
span.spr.player-hero-icon(data-memberid="#{clan.get('ownerID')}")
2015-04-03 17:48:00 -04:00
a(href="/user/#{clan.get('ownerID')}")= owner.get('name')
2015-04-03 14:05:37 -04:00
if stats.averageLevel
2015-04-03 17:48:00 -04:00
tr
td Average Level
td= stats.averageLevel
if stats.averageAchievements && clan.get('type') === 'public'
2015-04-03 17:48:00 -04:00
tr
td Average Achievements
td= stats.averageAchievements
2015-04-03 17:48:00 -04:00
p
if isOwner
button.btn.btn-xs.btn-warning.delete-clan-btn Delete Clan
2015-04-03 17:48:00 -04:00
else if isMember
button.btn.btn-xs.btn-warning.leave-clan-btn Leave Clan
2015-04-03 17:48:00 -04:00
else
button.btn.btn-lg.btn-success.join-clan-btn Join Clan
2015-04-03 17:48:00 -04:00
2015-04-16 18:26:14 -04:00
if clan.get('ownerID') === me.id || clan.get('type') === 'public'
div
span.spl.spr.join-link-prompt Invite:
input.join-clan-link(type="text", readonly, value="#{joinClanLink}")
.small *Invite players to this Clan by sending them this link.
2015-04-03 17:48:00 -04:00
2015-04-03 12:52:25 -04:00
if members
h3 Members (#{members.length})
//- Premium dashboard
if clan.get('dashboardType') === 'premium'
2015-04-16 18:26:14 -04:00
table.table.table-condensed
thead
tr
th Hero
th
span.spr Progress
small (gray=completed, green=started, white=not started)
2015-04-16 18:26:14 -04:00
tbody
each member in members
tr
td
div
span.hero-icon-cell
span.spr.player-hero-icon(data-memberid="#{member.id}")
span.code-language-cell
if memberLanguageMap && memberLanguageMap[member.id]
span.code-language-cell(style="background-image: url(/images/common/code_languages/#{memberLanguageMap[member.id]}_small.png)", title=memberLanguageMap[member.id])
div
2015-04-16 18:26:14 -04:00
a(href="/user/#{member.id}")= member.get('name') || 'Anoner'
div Level #{member.level()}
if isOwner && member.id !== clan.get('ownerID')
button.btn.btn-xs.btn-warning.remove-member-btn(data-id="#{member.id}") Remove Hero
td.progress-cell
each campaign in campaignLevelProgressions
if lastUserCampaignLevelMap[member.id] && lastUserCampaignLevelMap[member.id][campaign.ID]
div.level-progression-campaign= campaign.name
- var i = 0
each level in campaign.levels
- i++
- var state = null, levelInfo = null
if memberLevelStateMap[member.id][level.slug]
- levelInfo = memberLevelStateMap[member.id][level.slug].levelInfo
- state = memberLevelStateMap[member.id][level.slug].state
if state === 'complete'
span.progress-level-cell.progress-level-cell-complete(data-level-info=levelInfo) #{i}
if showExpandedProgress || i === 1 || i === lastUserCampaignLevelMap[member.id][campaign.ID].index + 1
span.spl #{level.name}
.level-popup-container
h3 #{i}. #{levelInfo.level}
p
div Status: Complete
div Playtime: #{levelInfo.playtime}s
div Last played: #{levelInfo.changed}
if isOwner || me.isAdmin()
strong Click to view solution.
else if state === 'started'
span.progress-level-cell.progress-level-cell-started(data-level-info=levelInfo) #{i}
if showExpandedProgress || i === 1 || i === lastUserCampaignLevelMap[member.id][campaign.ID].index + 1
span.spl #{level.name}
.level-popup-container
h3 #{i}. #{level.name}
p
div Status: Started
div Playtime: #{levelInfo.playtime}s
div Last played: #{levelInfo.changed}
if isOwner || me.isAdmin()
strong Click to view solution.
else
span.progress-level-cell.level-progression-level-not-started #{i}
if showExpandedProgress || i === 1 || i === lastUserCampaignLevelMap[member.id][campaign.ID].index + 1
span.spl #{level.name}
.level-popup-container
h3 #{i}. #{level.name}
div Status: Not Started
if lastUserCampaignLevelMap[member.id][campaign.ID].levelSlug === level.slug
- break
//- Basic dashboard
2015-04-16 18:26:14 -04:00
else
table.table.table-striped.table-condensed
thead
tr
th
th
td.name-cell Name
th.level-cell Level
th.achievements-cell Achievements
th.latest-achievement-cell Latest Achievement
2015-04-16 18:26:14 -04:00
th
tbody
each member in members
tr
td.hero-icon-cell
span.spr.player-hero-icon(data-memberid="#{member.id}")
td.code-language-cell
if memberLanguageMap && memberLanguageMap[member.id]
span.code-language-cell(style="background-image: url(/images/common/code_languages/#{memberLanguageMap[member.id]}_small.png)", title=memberLanguageMap[member.id])
td.name-cell
2015-04-16 18:26:14 -04:00
a(href="/user/#{member.id}")= member.get('name') || 'Anoner'
td.level-cell= member.level()
td.achievements-cell
2015-04-16 18:26:14 -04:00
if memberAchievementsMap && memberAchievementsMap[member.id]
| #{memberAchievementsMap[member.id].length}
td.latest-achievement-cell
2015-04-16 18:26:14 -04:00
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