mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 14:33:59 -04:00
Better page titles
Also ditching non-production constructor page titles
This commit is contained in:
parent
72b8674237
commit
d0d3d838ed
8 changed files with 18 additions and 6 deletions
|
@ -23,6 +23,8 @@ module.exports = class AboutView extends RootView
|
|||
'left': 'onLeftPressed'
|
||||
'esc': 'onEscapePressed'
|
||||
|
||||
getTitle: -> return $.i18n.t('nav.about')
|
||||
|
||||
afterRender: ->
|
||||
super(arguments...)
|
||||
@$('#fixed-nav').affix({
|
||||
|
|
|
@ -19,7 +19,9 @@ module.exports = class MainAdminView extends RootView
|
|||
'click #user-search-result': 'onClickUserSearchResult'
|
||||
'click #create-free-sub-btn': 'onClickFreeSubLink'
|
||||
'click #terminal-create': 'onClickTerminalSubLink'
|
||||
|
||||
|
||||
getTitle: -> return $.i18n.t('account_settings.admin')
|
||||
|
||||
initialize: ->
|
||||
if window.amActually
|
||||
@amActually = new User({_id: window.amActually})
|
||||
|
|
|
@ -110,10 +110,8 @@ module.exports = class RootView extends CocoView
|
|||
@buildLanguages()
|
||||
$('body').removeClass('is-playing')
|
||||
|
||||
if application.isProduction()
|
||||
title = 'CodeCombat - ' + (@getTitle() or 'Learn how to code by playing a game')
|
||||
else
|
||||
title = @getTitle() or @constructor.name
|
||||
if title = @getTitle() then title += ' | CodeCombat'
|
||||
else title = 'CodeCombat - Learn how to code by playing a game'
|
||||
|
||||
$('title').text(title)
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ module.exports = class CoursesView extends RootView
|
|||
'submit #join-class-form': 'onSubmitJoinClassForm'
|
||||
'click #change-language-link': 'onClickChangeLanguageLink'
|
||||
|
||||
getTitle: -> return $.i18n.t('teacher.students')
|
||||
|
||||
initialize: ->
|
||||
@courseInstances = new CocoCollection([], { url: "/db/user/#{me.id}/course_instances", model: CourseInstance})
|
||||
@courseInstances.comparator = (ci) -> return ci.get('classroomID') + ci.get('courseID')
|
||||
|
|
|
@ -19,6 +19,8 @@ module.exports = class EnrollmentsView extends RootView
|
|||
'click #how-to-enroll-link': 'onClickHowToEnrollLink'
|
||||
'click #contact-us-btn': 'onClickContactUsButton'
|
||||
|
||||
getTitle: -> return $.i18n.t('teacher.enrollments')
|
||||
|
||||
initialize: ->
|
||||
@state = new State({
|
||||
totalEnrolled: 0
|
||||
|
|
|
@ -63,6 +63,8 @@ module.exports = class TeacherClassView extends RootView
|
|||
enrolledUsers: ""
|
||||
}
|
||||
|
||||
getTitle: -> return @classroom?.get('name')
|
||||
|
||||
initialize: (options, classroomID) ->
|
||||
super(options)
|
||||
@singleStudentCourseProgressDotTemplate = require 'templates/teachers/hovers/progress-dot-single-student-course'
|
||||
|
@ -116,7 +118,7 @@ module.exports = class TeacherClassView extends RootView
|
|||
@supermodel.trackRequest @levels.fetchForClassroom(classroomID, {data: {project: 'original,concepts'}})
|
||||
|
||||
@attachMediatorEvents()
|
||||
|
||||
|
||||
attachMediatorEvents: () ->
|
||||
@listenTo @state, 'sync change', ->
|
||||
if _.isEmpty(_.omit(@state.changed, 'searchTerm'))
|
||||
|
|
|
@ -25,6 +25,8 @@ module.exports = class TeacherClassesView extends RootView
|
|||
'click .add-students-btn': 'onClickAddStudentsButton'
|
||||
'click .create-classroom-btn': 'onClickCreateClassroomButton'
|
||||
|
||||
getTitle: -> return $.i18n.t('teacher.my_classes')
|
||||
|
||||
initialize: (options) ->
|
||||
super(options)
|
||||
@classrooms = new Classrooms()
|
||||
|
|
|
@ -39,6 +39,8 @@ module.exports = class TeacherCoursesView extends RootView
|
|||
"569ed916efa72b0ced971447": null
|
||||
}
|
||||
|
||||
getTitle: -> return $.i18n.t('teacher.courses')
|
||||
|
||||
constructor: (options) ->
|
||||
super(options)
|
||||
@ownedClassrooms = new Classrooms()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue