Set up /courses for individuals without any course instances

This commit is contained in:
Scott Erickson 2015-11-29 18:41:57 -05:00
parent b734beb852
commit d255802e38
3 changed files with 12 additions and 1 deletions

View file

@ -88,6 +88,10 @@ block content
+course-instance-body(courseInstance)
.clearfix
else
.text-center
button#start-new-game-btn.btn.btn-success.btn-lg Start New Game
h3.text-uppercase Join A Class
hr

View file

@ -9,6 +9,7 @@ module.exports = class ChooseLanguageModal extends ModalView
'click .lang-choice-btn': 'onClickLanguageChoiceButton'
initialize: (options) ->
options ?= {}
@logoutFirst = options.logoutFirst
onClickLanguageChoiceButton: (e) ->

View file

@ -5,6 +5,7 @@ template = require 'templates/courses/courses-view'
StudentLogInModal = require 'views/courses/StudentLogInModal'
StudentSignUpModal = require 'views/courses/StudentSignUpModal'
ChangeCourseLanguageModal = require 'views/courses/ChangeCourseLanguageModal'
ChooseLanguageModal = require 'views/courses/ChooseLanguageModal'
CourseInstance = require 'models/CourseInstance'
CocoCollection = require 'collections/CocoCollection'
Course = require 'models/Course'
@ -62,7 +63,12 @@ module.exports = class CoursesView extends RootView
@joinClass()
onClickStartNewGameButton: ->
if me.isAnonymous()
@openSignUpModal()
else
modal = new ChooseLanguageModal()
@openModalView(modal)
@listenToOnce modal, 'set-language', @startHourOfCodePlay
onClickLogInButton: ->
modal = new StudentLogInModal()