codecombat/app/templates/user/user_home.jade

134 lines
6.1 KiB
Text
Raw Normal View History

2014-07-15 10:15:21 -04:00
extends /templates/kinds/user
block append content
2014-07-21 16:02:08 -04:00
if user
.vertical-buffer
.row
.left-column
2014-07-22 15:45:36 -04:00
.profile-wrapper
img.picture(src="#{user.getPhotoURL(150)}" alt="")
div.profile-info
h3.name= user.get('name')
if favoriteLanguage
2014-08-12 11:59:33 -04:00
div.extra-info
span(data-i18n="user.favorite_prefix") Favorite language is
strong.favorite-language= favoriteLanguage
span(data-i18n="user.favorite_postfix") .
2014-07-22 15:45:36 -04:00
.btn-group-vertical.profile-menu
a.btn.btn-default(href="/user/#{user.getSlugOrID()}/profile")
2014-07-22 15:45:36 -04:00
i.glyphicon.glyphicon-briefcase
2014-08-12 07:41:14 -04:00
span(data-i18n="account_settings.job_profile") Job Profile
a.btn.btn-default(href="/user/#{user.getSlugOrID()}/stats")
i.glyphicon.glyphicon-certificate
2014-08-12 07:41:14 -04:00
span(data-i18n="user.stats") Stats
a.btn.btn-default.disabled(href="#")
2014-07-22 15:45:36 -04:00
i.glyphicon.glyphicon-pencil
2014-08-12 07:41:14 -04:00
span(data-i18n="general.code") Code
- var emails = user.get('emails')
if emails
ul.contributor-categories
//li.contributor-category
img.contributor-image(src="/images/pages/user/general.png")
h4.contributor-title CodeCombateer
if emails.adventurerNews
li.contributor-category
img.contributor-image(src="/images/pages/user/adventurer.png")
h4.contributor-title
2014-08-12 07:41:14 -04:00
a(href="/contribute#adventurer" data-i18n="classes.adventurer_title") Adventurer
if emails.ambassadorNews
li.contributor-category
img.contributor-image(src="/images/pages/user/ambassador.png")
h4.contributor-title
2014-08-12 07:41:14 -04:00
a(href="/contribute#ambassador" data-i18n="classes.ambassador_title") Ambassador
if emails.archmageNews
li.contributor-category
img.contributor-image(src="/images/pages/user/archmage.png")
h4.contributor-title
2014-08-12 07:41:14 -04:00
a(href="/contribute#archmage" data-i18n="classes.archmage_title") Archmage
if emails.artisanNews
li.contributor-category
img.contributor-image(src="/images/pages/user/artisan.png")
h4.contributor-title
2014-08-12 07:41:14 -04:00
a(href="/contribute#artisan" data-i18n="classes.artisan_title") Artisan
if emails.scribeNews
li.contributor-category
img.contributor-image(src="/images/pages/user/scribe.png")
h4.contributor-title
2014-08-12 07:41:14 -04:00
a(href="/contribute#scribe" data-i18n="classes.scribe_title") Scribe
.right-column
.panel.panel-default
.panel-heading
2014-08-12 07:41:14 -04:00
h3.panel-title(data-i18n="user.singleplayer_title") Singleplayer Levels
if (!singlePlayerSessions)
.panel-body
2014-08-12 07:41:14 -04:00
p(data-i18n="common.loading") Loading...
else if (singlePlayerSessions.length)
table.table
tr
2014-08-12 07:41:14 -04:00
th.col-xs-4(data-i18n="resources.level") Level
th.col-xs-4(data-i18n="user.last_played") Last Played
th.col-xs-4(data-i18n="user.status") Status
each session in singlePlayerSessions
if session.get('levelName')
tr
td
a(href="/play/level/#{session.get('levelID')}")= session.get('levelName')
td= moment(session.get('changed')).fromNow()
if session.get('state').complete === true
2014-08-12 07:41:14 -04:00
td(data-i18n="user.status_completed") Completed
else
2014-08-12 07:41:14 -04:00
td(data-i18n="user.status_unfinished") Unfinished
else
.panel-body
2014-08-12 07:41:14 -04:00
p(data-i18n="no_singleplayer") No Singleplayer games played yet.
.panel.panel-default
.panel-heading
2014-08-12 07:41:14 -04:00
h3.panel-title(data-i18n="no_multiplayer") Multiplayer Levels
if (!multiPlayerSessions)
.panel-body
2014-08-12 07:41:14 -04:00
p(data-i18n="common.loading") Loading...
else if (multiPlayerSessions.length)
table.table
tr
2014-08-12 07:41:14 -04:00
th.col-xs-4(data-i18n="resources.level") Level
th.col-xs-4(data-i18n="user.last_played") Last Played
th.col-xs-4(data-i18n="general.score") Score
each session in multiPlayerSessions
tr
td
- var posturl = ''
- if (session.get('team')) posturl = '?team=' + session.get('team')
a(href="/play/level/#{session.get('levelID') + posturl}")= session.get('levelName') + (session.get('team') ? ' (' + session.get('team') + ')' : '')
td= moment(session.get('changed')).fromNow()
if session.get('totalScore')
td= session.get('totalScore') * 100
else
2014-08-12 07:41:14 -04:00
td(data-i18n="user.status_unfinished") Unfinished
else
.panel-body
2014-08-12 07:41:14 -04:00
p(data-i18n="user.no_multiplayer") No Multiplayer games played yet.
.panel.panel-default
.panel-heading
2014-08-12 07:41:14 -04:00
h3.panel-title(data-i18n="user.achievements") Achievements
if ! earnedAchievements
.panel-body
2014-08-12 07:41:14 -04:00
p(data-i18n="common.loading") Loading...
else if ! earnedAchievements.length
.panel-body
2014-08-12 07:41:14 -04:00
p(data-i18n="user.no_achievements") No achievements earned so far.
else
table.table
tr
2014-08-12 07:41:14 -04:00
th.col-xs-4(data-i18n="achievements.achievement") Achievement
th.col-xs-4(data-i18n="achievements.last_earned") Last Earned
th.col-xs-4(data-i18n="achievements.amount_achieved") Amount
each achievement in earnedAchievements.models
tr
td= achievement.get('achievementName')
td= moment().format("MMMM Do YYYY", achievement.get('changed'))
if achievement.get('achievedAmount')
td= achievement.get('achievedAmount')
else
td