Migrate join classroom url to /courses from /courses/students

This commit is contained in:
Scott Erickson 2015-12-02 12:05:43 -08:00
parent 6d4c17f724
commit c0b979a572
4 changed files with 6 additions and 4 deletions

View file

@ -30,7 +30,7 @@ block modal-body-content
.form-group
label.control-label(for="class-code-input")
span Class Code
input#class-code-input.input-large.form-control(name="classCode")
input#class-code-input.input-large.form-control(name="classCode", value=view.classCode)
.help-block optional - ask your teacher to give you one!
.form-group
label.control-label(for="school-input")

View file

@ -28,7 +28,7 @@ block outer_content
#hour-of-code
h1(data-i18n="home.hoc_title")
div
a.btn.btn-illustrated.btn-lg.btn-primary.btn-class-code(href='/courses/students', data-i18n="home.hoc_class_code")
a.btn.btn-illustrated.btn-lg.btn-primary.btn-class-code(href='/courses', data-i18n="home.hoc_class_code")
a.btn.btn-illustrated.btn-lg.btn-success.btn-enter(href='/hoc', data-i18n="home.hoc_enter")
//- #slogan(data-i18n="home.slogan")

View file

@ -12,7 +12,7 @@ module.exports = class InviteToClassroomModal extends ModalView
initialize: (options) ->
@classroom = options.classroom
@classCode = @classroom.get('codeCamel') || @classroom.get('code')
@joinURL = document.location.origin + "/courses/students?_cc=" + @classCode
@joinURL = document.location.origin + "/courses?_cc=" + @classCode
onClickSendInvitesButton: ->
emails = @$('#invite-emails-textarea').val()

View file

@ -4,6 +4,7 @@ auth = require 'core/auth'
forms = require 'core/forms'
User = require 'models/User'
Classroom = require 'models/Classroom'
utils = require 'core/utils'
module.exports = class StudentSignUpModal extends ModalView
id: 'student-sign-up-modal'
@ -17,6 +18,7 @@ module.exports = class StudentSignUpModal extends ModalView
initialize: (options) ->
options ?= {}
@willPlay = options.willPlay
@classCode = utils.getQueryVariable('_cc') or ''
onClickSkipLink: ->
@trigger 'click-skip-link' # defer to view that opened this modal
@ -89,6 +91,6 @@ module.exports = class StudentSignUpModal extends ModalView
onCreateUserSuccess: =>
classCode = @$('#class-code-input').val()
if classCode
url = "/courses/students?_cc="+classCode
url = "/courses?_cc="+classCode
application.router.navigate(url)
window.location.reload()