Courses UI: Add teachers mode button to landing page

This commit is contained in:
Matt Lott 2015-08-28 11:33:37 -07:00
parent a1927bf8cc
commit 545567a24b
2 changed files with 11 additions and 1 deletions
app
templates/courses/mock1
views/courses/mock1

View file

@ -49,9 +49,11 @@ block content
.col-md-12
button.btn.btn-success.btn-lg.btn-buy Buy this course
br
if !studentMode
br
button.btn.btn-warning.btn-student Students Click Here
else
button.btn.btn-warning.btn-teacher Teachers Click Here
h1.center Courses on CodeCombat

View file

@ -13,6 +13,7 @@ module.exports = class CoursesView extends RootView
'click .btn-enroll': 'onClickEnroll'
'click .btn-enter': 'onClickEnter'
'click .btn-student': 'onClickStudent'
'click .btn-teacher': 'onClickTeacher'
'hidden.bs.modal #continueModal': 'onHideContinueModal'
constructor: (options) ->
@ -107,5 +108,12 @@ module.exports = class CoursesView extends RootView
navigationEvent = route: route, viewClass: viewClass, viewArgs: viewArgs
Backbone.Mediator.publish 'router:navigate', navigationEvent
onClickTeacher: (e) ->
route = "/courses/mock1?student=false"
viewClass = require 'views/courses/mock1/CoursesView'
viewArgs = [studentMode: false]
navigationEvent = route: route, viewClass: viewClass, viewArgs: viewArgs
Backbone.Mediator.publish 'router:navigate', navigationEvent
onHideContinueModal: (e) ->
$('#continueModal .row-pick-class').hide()