i18n for all new pages

This commit is contained in:
Ruben Vereecken 2014-08-12 13:41:14 +02:00
parent 857d3ca02c
commit d6f5b7512d
15 changed files with 151 additions and 100 deletions

View file

@ -49,6 +49,9 @@
blog: "Blog" blog: "Blog"
forum: "Forum" forum: "Forum"
account: "Account" account: "Account"
profile: "Profile"
stats: "Stats"
code: "Code"
admin: "Admin" admin: "Admin"
home: "Home" home: "Home"
contribute: "Contribute" contribute: "Contribute"
@ -176,12 +179,14 @@
new_password: "New Password" new_password: "New Password"
new_password_verify: "Verify" new_password_verify: "Verify"
email_subscriptions: "Email Subscriptions" email_subscriptions: "Email Subscriptions"
email_subscriptions_none: "No Email Subscriptions."
email_announcements: "Announcements" email_announcements: "Announcements"
email_announcements_description: "Get emails on the latest news and developments at CodeCombat." email_announcements_description: "Get emails on the latest news and developments at CodeCombat."
email_notifications: "Notifications" email_notifications: "Notifications"
email_notifications_summary: "Controls for personalized, automatic email notifications related to your CodeCombat activity." email_notifications_summary: "Controls for personalized, automatic email notifications related to your CodeCombat activity."
email_any_notes: "Any Notifications" email_any_notes: "Any Notifications"
email_any_notes_description: "Disable to stop all activity notification emails." email_any_notes_description: "Disable to stop all activity notification emails."
email_news: "News"
email_recruit_notes: "Job Opportunities" email_recruit_notes: "Job Opportunities"
email_recruit_notes_description: "If you play really well, we may contact you about getting you a (better) job." email_recruit_notes_description: "If you play really well, we may contact you about getting you a (better) job."
contributor_emails: "Contributor Class Emails" contributor_emails: "Contributor Class Emails"
@ -555,6 +560,10 @@
level_search_title: "Search Levels Here" level_search_title: "Search Levels Here"
achievement_search_title: "Search Achievements" achievement_search_title: "Search Achievements"
read_only_warning2: "Note: you can't save any edits here, because you're not logged in." read_only_warning2: "Note: you can't save any edits here, because you're not logged in."
no_achievements: "No achievements have been added for this level yet."
achievement_query_misc: "Key achievement off of miscellanea"
achievement_query_goals: "Key achievement off of level goals"
level_completion: "Level Completion"
article: article:
edit_btn_preview: "Preview" edit_btn_preview: "Preview"
@ -563,6 +572,7 @@
general: general:
and: "and" and: "and"
name: "Name" name: "Name"
date: "Date"
body: "Body" body: "Body"
version: "Version" version: "Version"
commit_msg: "Commit Message" commit_msg: "Commit Message"
@ -916,3 +926,36 @@
text_diff: "Text Diff" text_diff: "Text Diff"
merge_conflict_with: "MERGE CONFLICT WITH" merge_conflict_with: "MERGE CONFLICT WITH"
no_changes: "No Changes" no_changes: "No Changes"
user:
stats: "Stats"
singleplayer_title: "Singleplayer Levels"
multiplayer_title: "Multiplayer Levels"
achievements_title: "Achievements"
last_played: "Last Played"
status: "Status"
status_completed: "Completed"
status_unfinished: "Unfinished"
no_singleplayer: "No Singleplayer games played yet."
no_multiplayer: "No Multiplayer games played yet."
no_achievements: "No Achievements earned yet."
achievements:
last_earned: "Last Earned"
amount_achieved: "Amount"
achievement: "Achievement"
category_contributor: "Contributor"
category_miscellaneous: "Miscellaneous"
category_levels: "Levels"
category_undefined: "Uncategorized"
current_xp_prefix: ""
current_xp_postfix: " in total"
new_xp_prefix: ""
new_xp_postfix: " earned"
left_xp_prefix: ""
left_xp_infix: " until level "
left_xp_postfix: ""
account:
recently_played: "Recently Played"
no_recent_games: "No games played during the past two weeks."

View file

@ -1,7 +1,7 @@
@import "../bootstrap/variables" @import "../bootstrap/variables"
@import "../bootstrap/mixins" @import "../bootstrap/mixins"
#account-home-view #account-home
dl dl
margin-bottom: 0px margin-bottom: 0px

View file

@ -128,18 +128,13 @@
bottom: 48px bottom: 48px
.user-level .user-level
background-image: url("/images/achievements/level-bg.png")
color: white
width: 38px
height: 38px
line-height: 38px
font-size: 20px font-size: 20px
color: white
position: absolute position: absolute
left: -15px left: -15px
margin-top: -8px margin-top: -8px
vertical-align: middle vertical-align: middle
z-index: 1000 z-index: 1000
font-family: $font-family-base
> .progress-bar-wrapper > .progress-bar-wrapper
position: absolute position: absolute
@ -237,3 +232,11 @@
.popup .popup
cursor: default cursor: default
left: 600px left: 600px
.user-level
background-image: url("/images/achievements/level-bg.png")
width: 38px
height: 38px
line-height: 38px
font-size: 20px
font-family: $font-family-base

View file

@ -94,12 +94,8 @@ a.disabled
color: #31281E color: #31281E
.user-level .user-level
position: absolute position: absolute
top: 85px top: 73px
right: 100px right: 86px
font-size: 20px
border-radius: 50%
background-color: #FFE4BC
box-shadow: 0 0 0 1px black // disable for double border
color: gold color: gold
text-shadow: 1px 1px black, -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black text-shadow: 1px 1px black, -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black

View file

@ -1,7 +1,7 @@
@import "../bootstrap/variables" @import "../bootstrap/variables"
@import "../bootstrap/mixins" @import "../bootstrap/mixins"
#user-home-view #user-home
margin-top: 20px margin-top: 20px
.left-column .left-column

View file

@ -4,8 +4,9 @@ block content
if !me.isAnonymous() if !me.isAnonymous()
.clearfix .clearfix
.col-sm-6.clearfix .col-sm-6.clearfix
h2 Account Settings h2
a.spl(href="settings") span(data-i18n="account_settings.title") Account Settings
a.spl(href="/account/settings")
i.glyphicon.glyphicon-cog i.glyphicon.glyphicon-cog
hr hr
.row .row
@ -14,15 +15,15 @@ block content
.panel-heading .panel-heading
h3.panel-title h3.panel-title
i.glyphicon.glyphicon-picture i.glyphicon.glyphicon-picture
a(href="account/settings#picture") Picture a(href="account/settings#picture" data-i18n="account_settings.picture_tab") Picture
.panel-body.text-center .panel-body.text-center
img#picture(src="#{me.getPhotoURL(150)}" alt="") img#picture(src="#{me.getPhotoURL(150)}" alt="Picture")
.col-xs-6 .col-xs-6
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
h3.panel-title h3.panel-title
i.glyphicon.glyphicon-user i.glyphicon.glyphicon-user
a(href="account/settings#wizard") Wizard a(href="account/settings#wizard" data-i18n="account_settings.wizard_tab") Wizard
if (wizardSource) if (wizardSource)
.panel-body.text-center .panel-body.text-center
img(src="#{wizardSource}") img(src="#{wizardSource}")
@ -30,35 +31,37 @@ block content
.panel-heading .panel-heading
h3.panel-title h3.panel-title
i.glyphicon.glyphicon-user i.glyphicon.glyphicon-user
a(href="account/settings#me") Me a(href="account/settings#me" data-i18n="account_settings.me_tab") Me
.panel-body .panel-body
table table
tr tr
th Name th(data-i18n="general.name") Name
td=me.get('name') || 'Anoner' td=me.displayName()
tr tr
th Email th(data-i18n="general.email") Email
td=me.get('email') td=me.get('email')
.panel.panel-default.panel-emails .panel.panel-default.panel-emails
.panel-heading .panel-heading
h3.panel-title h3.panel-title
i.glyphicon.glyphicon-envelope i.glyphicon.glyphicon-envelope
a(href="account/settings#emails") Emails a(href="account/settings#emails" data-i18n="account_settings.emails_tab") Emails
.panel-body .panel-body
if !hasEmailNotes && !hasEmailNews if !hasEmailNotes && !hasEmailNews && !hasGeneralNews
p No email subscriptions. p(data-i18n="account_settings.email_subscriptions_none") No email subscriptions.
if hasGeneralNews
h4(data-i18n="account_settings.email_news") News
ul
li(data-i18n="account_settings.email_announcements") Announcements
if hasEmailNotes if hasEmailNotes
h4 Notifications h4(data-i18n="account_settings.email_notifications") Notifications
ul ul
if subs.anyNotes if subs.anyNotes
li(data-i18n="account_settings.email_any_notes") Any Notifications li(data-i18n="account_settings.email_any_notes") Any Notifications
if subs.recruitNotes if subs.recruitNotes
li(data-i18n="account_settings.email_recruit_notes") Job Opportunities li(data-i18n="account_settings.email_recruit_notes") Job Opportunities
if hasEmailNews if hasEmailNews
h4 News h4(data-i18n="account_settings.contributor_emails") Contributor Emails
ul ul
if (subs.generalNews)
li(data-i18n="account_settings.email_announcements") General
if (subs.archmageNews) if (subs.archmageNews)
li li
span(data-i18n="classes.archmage_title") span(data-i18n="classes.archmage_title")
@ -100,23 +103,23 @@ block content
.panel-heading .panel-heading
h3.panel-title h3.panel-title
i.glyphicon.glyphicon-wrench i.glyphicon.glyphicon-wrench
a(href="account/settings#password") Password a(href="account/settings#password" data-i18n="general.password") Password
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
h3.panel-title h3.panel-title
i.glyphicon.glyphicon-briefcase i.glyphicon.glyphicon-briefcase
a(href="account/settings#job-profile") Job Profile a(href="account/settings#job-profile" data-i18n="account_settings.job_profile") Job Profile
.col-sm-6 .col-sm-6
h2 Recently Played h2(data-i18n="user.recently_played") Recently Played
hr hr
if !recentlyPlayed if !recentlyPlayed
div Loading... div(data-i18n="common.loading") Loading...
else if recentlyPlayed.length else if recentlyPlayed.length
table.table table.table
tr tr
th Level th(data-i18n="resources.level") Level
th Last Played th(data-i18n="user.last_played") Last Played
th Status th(data-i18n="user.status") Status
each session in recentlyPlayed each session in recentlyPlayed
if session.get('levelName') if session.get('levelName')
tr tr
@ -126,13 +129,13 @@ block content
a(href="/play/level/#{session.get('levelID') + posturl}")= session.get('levelName') + (session.get('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() td= moment(session.get('changed')).fromNow()
if session.get('state').complete === true if session.get('state').complete === true
td Completed td(data-i18n="user.status_completed") Completed
else if ! session.isMultiplayer() else if ! session.isMultiplayer()
td Unfinished td(data-i18n="user.status_unfinished") Unfinished
else else
td td
else else
.panel.panel-default .panel.panel-default
.panel-body .panel-body
div No games played during the past two weeks. div(data-i18n="account.no_recent_games") No games played during the past two weeks.

View file

@ -12,7 +12,10 @@
span.user-level= level span.user-level= level
.progress-bar-wrapper .progress-bar-wrapper
.progress .progress
.progress-bar.xp-bar-old(style="width:#{oldXPWidth}%" data-toggle="tooltip" data-placement="top" title="#{currentXP} XP in total") - var currentTitle = $.i18n.t('achievements.current_xp_prefix') + currentXP + ' XP' + $.i18n.t('achievements.current_xp_postfix');
.progress-bar.xp-bar-new(style="width:#{newXPWidth}%" data-toggle="tooltip" title="#{newXP} XP earned") - var newTitle = $.i18n.t('achievements.new_xp_prefix') + newXP + ' XP' + $.i18n.t('achievements.new_xp_postfix');
.progress-bar.xp-bar-left(style="width:#{leftXPWidth}%" data-toggle="tooltip" title="#{leftXP} XP until level #{level+1}") - var leftTitle = $.i18n.t('achievements.left_xp_prefix') + newXP + ' XP' + $.i18n.t('achievements.left_xp_infix') + (level+1) + $.i18n.t('achievements.left_xp_postfix');
.progress-bar.xp-bar-old(style="width:#{oldXPWidth}%" data-toggle="tooltip" data-placement="top" title="#{currentTitle}")
.progress-bar.xp-bar-new(style="width:#{newXPWidth}%" data-toggle="tooltip" title="#{newTitle}")
.progress-bar.xp-bar-left(style="width:#{leftXPWidth}%" data-toggle="tooltip" title="#{leftTitle}")
.progress-bar-border .progress-bar-border

View file

@ -43,20 +43,20 @@ body
span.caret span.caret
ul.dropdown-menu(role="menu") ul.dropdown-menu(role="menu")
li.user-dropdown-header li.user-dropdown-header
span.user-level.badge= me.level() span.user-level= me.level()
a(href="/user/#{me.get('slug') || me.get('_id')}") a(href="/user/#{me.getSlugOrID()}")
img.img-circle(src="#{me.getPhotoURL()}" alt="") img.img-circle(src="#{me.getPhotoURL()}" alt="")
h3=me.get('name') || 'Anoner' h3=me.displayName()
li.user-dropdown-body li.user-dropdown-body
.col-xs-4.text-center .col-xs-4.text-center
a(href="/user/#{me.get('slug') || me.get('_id')}") Profile a(href="/user/#{me.getSlugOrID()}" data-i18n="nav.profile") Profile
.col-xs-4.text-center .col-xs-4.text-center
a(href="/user/#{me.get('slug') || me.get('_id')}/stats") Stats a(href="/user/#{me.getSlugOrID()}/stats" data-i18n="nav.stats") Stats
.col-xs-4.text-center .col-xs-4.text-center
a.disabled() Code a.disabled(data-i18n="nav.code") Code
li.user-dropdown-footer li.user-dropdown-footer
.pull-left .pull-left
a.btn.btn-default.btn-flat(href="/account") Account a.btn.btn-default.btn-flat(href="/account" data-i18n="nav.account") Account
.pull-right .pull-right
button#logout-button.btn.btn-default.btn-flat(data-i18n="login.log_out") Log Out button#logout-button.btn.btn-default.btn-flat(data-i18n="login.log_out") Log Out
else else

View file

@ -6,16 +6,16 @@ block modal-body-content
label.control-label(for="name", data-i18n="general.name") Name label.control-label(for="name", data-i18n="general.name") Name
input#name.form-control(name="name", type="text") input#name.form-control(name="name", type="text")
.form-group .form-group
label.control-label(for="description") Description label.control-label(for="description" data-i18n="general.description") Description
input#description.form-control(name="description", type="text") input#description.form-control(name="description", type="text")
h4 Miscellaneous achievement keys h4(data-i18n="editor.achievement_query_misc") Key achievement off of miscellanea
.radio .radio
label label
input(type="checkbox", name="queryOptions" id="misc-level-completion" value="misc-level-completion") input(type="checkbox", name="queryOptions" id="misc-level-completion" value="misc-level-completion")
span.spl Level Completion span.spl(data-i18n="editor.level_completion") Level Completion
- var goals = level.get('goals'); - var goals = level.get('goals');
if goals && goals.length if goals && goals.length
h4 Base achievement on goals? h4(data-i18n="editor.achievement_query_goals") Key achievement off of level goals
each goal in goals each goal in goals
.radio .radio
label label

View file

@ -2,18 +2,18 @@
button.btn.btn-primary#new-achievement-button(disabled=me.isAdmin() === true ? undefined : "true" data-i18n="editor.new_achievement_title") Create a New Achievement button.btn.btn-primary#new-achievement-button(disabled=me.isAdmin() === true ? undefined : "true" data-i18n="editor.new_achievement_title") Create a New Achievement
if achievements.loading if achievements.loading
h2 Loading... h2(data-i18n="common.loading") Loading...
else if ! achievements.models.length else if ! achievements.models.length
.panel .panel
.panel-body .panel-body
p No achievements added for this level yet. p(data-i18n="editor.no_achievements") No achievements added for this level yet.
else else
table.table.table-hover table.table.table-hover
thead thead
tr tr
th th
th Name th(data-i18n="general.name") Name
th Description th(data-i18n="general.description") Description
th XP th XP
tbody tbody
each achievement in achievements.models each achievement in achievements.models

View file

@ -9,7 +9,7 @@ block append content
.grid-layout .grid-layout
each achievements, category in achievementsByCategory each achievements, category in achievementsByCategory
.row .row
h2.achievement-category-title=category.charAt(0).toUpperCase() + category.slice(1) h2.achievement-category-title(data-i18n="category_#{category}")=category
each achievement, index in achievements each achievement, index in achievements
- var title = achievement.get('name'); - var title = achievement.get('name');
- var description = achievement.get('description'); - var description = achievement.get('description');
@ -27,10 +27,10 @@ block append content
if earnedAchievements.length if earnedAchievements.length
table.table table.table
tr tr
th Name th(data-i18n="general.name") Name
th Description th(data-i18n="general.description") Description
th Date th(data-i18n="general.date") Date
th Amount th(data-i18n="achievements.amount_achieved") Amount
th XP th XP
each earnedAchievement in earnedAchievements.models each earnedAchievement in earnedAchievements.models
- var achievement = earnedAchievement.get('achievement'); - var achievement = earnedAchievement.get('achievement');
@ -45,6 +45,6 @@ block append content
td= earnedAchievement.get('earnedPoints') td= earnedAchievement.get('earnedPoints')
else else
.panel#no-achievements .panel#no-achievements
.panel-body No achievements earned yet. .panel-body(data-i18n="user.no_achievements") No achievements earned yet.
else else
div How did you even do that? div How did you even do that?

View file

@ -15,13 +15,13 @@ block append content
.btn-group-vertical.profile-menu .btn-group-vertical.profile-menu
a.btn.btn-default(href="/user/#{user.getSlugOrID()}/profile") a.btn.btn-default(href="/user/#{user.getSlugOrID()}/profile")
i.glyphicon.glyphicon-briefcase i.glyphicon.glyphicon-briefcase
span Job Profile span(data-i18n="account_settings.job_profile") Job Profile
a.btn.btn-default(href="/user/#{user.getSlugOrID()}/stats") a.btn.btn-default(href="/user/#{user.getSlugOrID()}/stats")
i.glyphicon.glyphicon-certificate i.glyphicon.glyphicon-certificate
span Stats span(data-i18n="user.stats") Stats
a.btn.btn-default.disabled(href="#") a.btn.btn-default.disabled(href="#")
i.glyphicon.glyphicon-pencil i.glyphicon.glyphicon-pencil
span Code span(data-i18n="general.code") Code
- var emails = user.get('emails') - var emails = user.get('emails')
if emails if emails
ul.contributor-categories ul.contributor-categories
@ -32,41 +32,41 @@ block append content
li.contributor-category li.contributor-category
img.contributor-image(src="/images/pages/user/adventurer.png") img.contributor-image(src="/images/pages/user/adventurer.png")
h4.contributor-title h4.contributor-title
a(href="/contribute#adventurer") Adventurer a(href="/contribute#adventurer" data-i18n="classes.adventurer_title") Adventurer
if emails.ambassadorNews if emails.ambassadorNews
li.contributor-category li.contributor-category
img.contributor-image(src="/images/pages/user/ambassador.png") img.contributor-image(src="/images/pages/user/ambassador.png")
h4.contributor-title h4.contributor-title
a(href="/contribute#ambassador") Ambassador a(href="/contribute#ambassador" data-i18n="classes.ambassador_title") Ambassador
if emails.archmageNews if emails.archmageNews
li.contributor-category li.contributor-category
img.contributor-image(src="/images/pages/user/archmage.png") img.contributor-image(src="/images/pages/user/archmage.png")
h4.contributor-title h4.contributor-title
a(href="/contribute#archmage") Archmage a(href="/contribute#archmage" data-i18n="classes.archmage_title") Archmage
if emails.artisanNews if emails.artisanNews
li.contributor-category li.contributor-category
img.contributor-image(src="/images/pages/user/artisan.png") img.contributor-image(src="/images/pages/user/artisan.png")
h4.contributor-title h4.contributor-title
a(href="/contribute#artisan") Artisan a(href="/contribute#artisan" data-i18n="classes.artisan_title") Artisan
if emails.scribeNews if emails.scribeNews
li.contributor-category li.contributor-category
img.contributor-image(src="/images/pages/user/scribe.png") img.contributor-image(src="/images/pages/user/scribe.png")
h4.contributor-title h4.contributor-title
a(href="/contribute#scribe") Scribe a(href="/contribute#scribe" data-i18n="classes.scribe_title") Scribe
.right-column .right-column
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
h3.panel-title Singleplayer Levels h3.panel-title(data-i18n="user.singleplayer_title") Singleplayer Levels
if (!singlePlayerSessions) if (!singlePlayerSessions)
.panel-body .panel-body
p Loading... p(data-i18n="common.loading") Loading...
else if (singlePlayerSessions.length) else if (singlePlayerSessions.length)
table.table table.table
tr tr
th.col-xs-4 Level th.col-xs-4(data-i18n="resources.level") Level
th.col-xs-4 Last Played th.col-xs-4(data-i18n="user.last_played") Last Played
th.col-xs-4 Status th.col-xs-4(data-i18n="user.status") Status
each session in singlePlayerSessions each session in singlePlayerSessions
if session.get('levelName') if session.get('levelName')
tr tr
@ -74,24 +74,24 @@ block append content
a(href="/play/level/#{session.get('levelID')}")= session.get('levelName') a(href="/play/level/#{session.get('levelID')}")= session.get('levelName')
td= moment(session.get('changed')).fromNow() td= moment(session.get('changed')).fromNow()
if session.get('state').complete === true if session.get('state').complete === true
td Completed td(data-i18n="user.status_completed") Completed
else else
td Unfinished td(data-i18n="user.status_unfinished") Unfinished
else else
.panel-body .panel-body
p No Singleplayer games played yet. p(data-i18n="no_singleplayer") No Singleplayer games played yet.
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
h3.panel-title Multiplayer Levels h3.panel-title(data-i18n="no_multiplayer") Multiplayer Levels
if (!multiPlayerSessions) if (!multiPlayerSessions)
.panel-body .panel-body
p Loading... p(data-i18n="common.loading") Loading...
else if (multiPlayerSessions.length) else if (multiPlayerSessions.length)
table.table table.table
tr tr
th.col-xs-4 Level th.col-xs-4(data-i18n="resources.level") Level
th.col-xs-4 Last Played th.col-xs-4(data-i18n="user.last_played") Last Played
th.col-xs-4 Score th.col-xs-4(data-i18n="general.score") Score
each session in multiPlayerSessions each session in multiPlayerSessions
tr tr
td td
@ -102,25 +102,25 @@ block append content
if session.get('totalScore') if session.get('totalScore')
td= session.get('totalScore') * 100 td= session.get('totalScore') * 100
else else
td Unfinished td(data-i18n="user.status_unfinished") Unfinished
else else
.panel-body .panel-body
p No Multiplayer games played yet. p(data-i18n="user.no_multiplayer") No Multiplayer games played yet.
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
h3.panel-title Achievements h3.panel-title(data-i18n="user.achievements") Achievements
if ! earnedAchievements if ! earnedAchievements
.panel-body .panel-body
p Loading... p(data-i18n="common.loading") Loading...
else if ! earnedAchievements.length else if ! earnedAchievements.length
.panel-body .panel-body
p No achievements earned so far. p(data-i18n="user.no_achievements") No achievements earned so far.
else else
table.table table.table
tr tr
th.col-xs-4 Achievement th.col-xs-4(data-i18n="achievements.achievement") Achievement
th.col-xs-4 Last Earned th.col-xs-4(data-i18n="achievements.last_earned") Last Earned
th.col-xs-4 Amount th.col-xs-4(data-i18n="achievements.amount_achieved") Amount
each achievement in earnedAchievements.models each achievement in earnedAchievements.models
tr tr
td= achievement.get('achievementName') td= achievement.get('achievementName')

View file

@ -1,5 +1,5 @@
View = require 'views/kinds/RootView' View = require 'views/kinds/RootView'
template = require 'templates/account/home' template = require 'templates/account/account_home'
{me} = require 'lib/auth' {me} = require 'lib/auth'
User = require 'models/User' User = require 'models/User'
AuthModalView = require 'views/modal/AuthModal' AuthModalView = require 'views/modal/AuthModal'
@ -7,7 +7,7 @@ RecentlyPlayedCollection = require 'collections/RecentlyPlayedCollection'
ThangType = require 'models/ThangType' ThangType = require 'models/ThangType'
module.exports = class MainAccountView extends View module.exports = class MainAccountView extends View
id: 'account-home-view' id: 'account-home'
template: template template: template
constructor: (options) -> constructor: (options) ->
@ -24,9 +24,11 @@ module.exports = class MainAccountView extends View
getRenderData: -> getRenderData: ->
c = super() c = super()
c.subs = {} c.subs = {}
c.subs[sub] = 1 for sub in c.me.getEnabledEmails() enabledEmails = c.me.getEnabledEmails()
c.hasEmailNotes = _.any c.me.getEnabledEmails(), (sub) -> sub.contains 'Notes' c.subs[sub] = 1 for sub in enabledEmails
c.hasEmailNews = _.any c.me.getEnabledEmails(), (sub) -> sub.contains 'News' c.hasEmailNotes = _.any enabledEmails, (sub) -> sub.contains 'Notes'
c.hasEmailNews = _.any enabledEmails, (sub) -> sub.contains('News') and sub isnt 'generalNews'
c.hasGeneralNews = 'generalNews' in enabledEmails
c.wizardSource = @wizardType.getPortraitSource colorConfig: me.get('wizard')?.colorConfig if @wizardType.loaded c.wizardSource = @wizardType.getPortraitSource colorConfig: me.get('wizard')?.colorConfig if @wizardType.loaded
c.recentlyPlayed = @recentlyPlayed.models c.recentlyPlayed = @recentlyPlayed.models
c c

View file

@ -58,6 +58,7 @@ module.exports = class AchievementPopup extends CocoView
_.extend c, @calculateData() _.extend c, @calculateData()
c.style = @achievement.getStyle() c.style = @achievement.getStyle()
c.popup = true c.popup = true
c.$ = $ # Allows the jade template to do i18n
c c
render: -> render: ->

View file

@ -1,7 +1,7 @@
UserView = require 'views/kinds/UserView' UserView = require 'views/kinds/UserView'
CocoCollection = require 'collections/CocoCollection' CocoCollection = require 'collections/CocoCollection'
LevelSession = require 'models/LevelSession' LevelSession = require 'models/LevelSession'
template = require 'templates/user/home' template = require 'templates/user/user_home'
{me} = require 'lib/auth' {me} = require 'lib/auth'
EarnedAchievementCollection = require 'collections/EarnedAchievementCollection' EarnedAchievementCollection = require 'collections/EarnedAchievementCollection'
@ -13,7 +13,7 @@ class LevelSessionsCollection extends CocoCollection
super() super()
module.exports = class MainUserView extends UserView module.exports = class MainUserView extends UserView
id: 'user-home-view' id: 'user-home'
template: template template: template
constructor: (userID, options) -> constructor: (userID, options) ->