Update Student License requirement copy

This commit is contained in:
Robin Yang 2016-08-23 16:05:12 -07:00
parent bfa49cbbc6
commit c3b3c6ea2a
3 changed files with 26 additions and 38 deletions

View file

@ -578,7 +578,7 @@
tip_good_idea: "The best way to have a good idea is to have a lot of ideas. - Linus Pauling" tip_good_idea: "The best way to have a good idea is to have a lot of ideas. - Linus Pauling"
tip_programming_not_about_computers: "Computer Science is no more about computers than astronomy is about telescopes. - Edsger Dijkstra" tip_programming_not_about_computers: "Computer Science is no more about computers than astronomy is about telescopes. - Edsger Dijkstra"
tip_mulan: "Believe you can, then you will. - Mulan" tip_mulan: "Believe you can, then you will. - Mulan"
play_game_dev_level: play_game_dev_level:
created_by: "Created by {{name}}" created_by: "Created by {{name}}"
how_to_play_title: "How to play:" how_to_play_title: "How to play:"
@ -1475,8 +1475,7 @@
all_students: "All Students" all_students: "All Students"
apply_licenses: "Apply Licenses" apply_licenses: "Apply Licenses"
not_enough_enrollments: "Not enough licenses available." not_enough_enrollments: "Not enough licenses available."
enrollments_blurb_1: "Students taking Computer Science" enrollments_blurb: "Students are required to have a license to access any content after the first course."
enrollments_blurb_2: "require a license to access the courses."
credits_available: "Licenses Available" credits_available: "Licenses Available"
total_unique_students: "Total Students" total_unique_students: "Total Students"
total_enrolled_students: "Enrolled Students" total_enrolled_students: "Enrolled Students"

View file

@ -29,24 +29,20 @@ block content
h3 ATTENTION: Please upgrade your account to a Teacher Account. h3 ATTENTION: Please upgrade your account to a Teacher Account.
p p
| We are transitioning to a new improved classroom management system for instructors. | We are transitioning to a new improved classroom management system for instructors.
| Please convert your account to ensure you retain access to your classrooms. | Please convert your account to ensure you retain access to your classrooms.
a.btn.btn-primary.btn-lg(href="/teachers/update-account") Upgrade to teacher account a.btn.btn-primary.btn-lg(href="/teachers/update-account") Upgrade to teacher account
.container.m-t-5 .container.m-t-5
.pull-right .pull-right
span.glyphicon.glyphicon-question-sign span.glyphicon.glyphicon-question-sign
=' ' =' '
a#how-to-enroll-link(data-i18n="teacher.how_to_apply_licenses") a#how-to-enroll-link(data-i18n="teacher.how_to_apply_licenses")
h3(data-i18n='teacher.enrollments') h3(data-i18n='teacher.enrollments')
h4#enrollments-blurb h4#enrollments-blurb(data-i18n='teacher.enrollments_blurb')
span(data-i18n='teacher.enrollments_blurb_1')
span 2–#{view.state.get('totalCourses')}
span(data-i18n='teacher.enrollments_blurb_2')
- var available = view.state.get('prepaidGroups').available - var available = view.state.get('prepaidGroups').available
- var pending = view.state.get('prepaidGroups').pending - var pending = view.state.get('prepaidGroups').pending
- var anyPrepaids = available || pending - var anyPrepaids = available || pending
.row.m-t-3 .row.m-t-3
if anyPrepaids if anyPrepaids
#prepaids-col.col-md-9 #prepaids-col.col-md-9
@ -56,25 +52,25 @@ block content
for prepaid in available for prepaid in available
.col-sm-4.col-xs-6 .col-sm-4.col-xs-6
+prepaidCard(prepaid) +prepaidCard(prepaid)
if _.size(pending) > 0 if _.size(pending) > 0
h5.m-b-1.m-t-3(data-i18n="teacher.pending_credits") h5.m-b-1.m-t-3(data-i18n="teacher.pending_credits")
.row .row
for prepaid in pending for prepaid in pending
.col-sm-4.col-xs-6 .col-sm-4.col-xs-6
+prepaidCard(prepaid, 'pending-prepaid-card') +prepaidCard(prepaid, 'pending-prepaid-card')
#actions-col.col-md-3 #actions-col.col-md-3
+addCredits +addCredits
+enrollmentStats +enrollmentStats
else else
// no prepaids // no prepaids
.col-sm-6.col-lg-4.col-lg-offset-2 .col-sm-6.col-lg-4.col-lg-offset-2
+addCredits +addCredits
.col-sm-6.col-lg-4 .col-sm-6.col-lg-4
+enrollmentStats +enrollmentStats
mixin prepaidCard(prepaid, className) mixin prepaidCard(prepaid, className)
.prepaid-card.bg-navy.text-center.m-b-2.p-a-2(class=className) .prepaid-card.bg-navy.text-center.m-b-2.p-a-2(class=className)
h1.m-t-2.m-b-0= prepaid.openSpots() h1.m-t-2.m-b-0= prepaid.openSpots()
@ -88,14 +84,14 @@ mixin prepaidCard(prepaid, className)
.pull-left(data-i18n="teacher.end_date") .pull-left(data-i18n="teacher.end_date")
.pull-right= moment(prepaid.get('endDate')).utc().format('l') .pull-right= moment(prepaid.get('endDate')).utc().format('l')
.clearfix .clearfix
mixin addCredits mixin addCredits
.text-center.m-b-3.m-t-3 .text-center.m-b-3.m-t-3
h5(data-i18n="courses.get_enrollments") h5(data-i18n="courses.get_enrollments")
if me.get('enrollmentRequestSent') if me.get('enrollmentRequestSent')
#enrollment-request-sent-blurb.small #enrollment-request-sent-blurb.small
p(data-i18n="teacher.enroll_request_sent_blurb1") p(data-i18n="teacher.enroll_request_sent_blurb1")
p(data-i18n="teacher.enroll_request_sent_blurb2") p(data-i18n="teacher.enroll_request_sent_blurb2")
p(data-i18n="[html]teacher.enroll_request_sent_blurb3") p(data-i18n="[html]teacher.enroll_request_sent_blurb3")
button#request-sent-btn.btn-lg.btn.btn-forest(disabled=true, data-i18n="teacher.request_sent") button#request-sent-btn.btn-lg.btn.btn-forest(disabled=true, data-i18n="teacher.request_sent")
@ -104,7 +100,7 @@ mixin addCredits
p.m-y-2(data-i18n="teacher.get_enrollments_blurb") p.m-y-2(data-i18n="teacher.get_enrollments_blurb")
button#contact-us-btn.btn-lg.btn.btn-forest(data-i18n="contribute.contact_us_url") button#contact-us-btn.btn-lg.btn.btn-forest(data-i18n="contribute.contact_us_url")
mixin enrollmentStats mixin enrollmentStats
h5.text-center.m-t-3.m-b-2(data-i18n='teacher.enrollment_status') h5.text-center.m-t-3.m-b-2(data-i18n='teacher.enrollment_status')
table#enrollment-stats-table.table-condensed.table.small-details table#enrollment-stats-table.table-condensed.table.small-details
@ -114,7 +110,7 @@ mixin enrollmentStats
span.spr : span.spr :
td= view.state.get('totalEnrolled') + view.state.get('totalNotEnrolled') td= view.state.get('totalEnrolled') + view.state.get('totalNotEnrolled')
tr tr
td td
span(data-i18n='teacher.total_enrolled_students') span(data-i18n='teacher.total_enrolled_students')
span.spr : span.spr :
td= view.state.get('totalEnrolled') td= view.state.get('totalEnrolled')

View file

@ -7,30 +7,30 @@ factories = require 'test/app/factories'
TeachersContactModal = require 'views/teachers/TeachersContactModal' TeachersContactModal = require 'views/teachers/TeachersContactModal'
describe 'EnrollmentsView', -> describe 'EnrollmentsView', ->
beforeEach (done) -> beforeEach (done) ->
me.set('anonymous', false) me.set('anonymous', false)
me.set('role', 'teacher') me.set('role', 'teacher')
me.set('enrollmentRequestSent', false) me.set('enrollmentRequestSent', false)
@view = new EnrollmentsView() @view = new EnrollmentsView()
# Make three classrooms, sharing users from a pool of 10, 5 of which are enrolled # Make three classrooms, sharing users from a pool of 10, 5 of which are enrolled
prepaid = factories.makePrepaid() prepaid = factories.makePrepaid()
students = new Users(_.times(10, (i) -> students = new Users(_.times(10, (i) ->
factories.makeUser({}, { prepaid: if i%2 then prepaid else null })) factories.makeUser({}, { prepaid: if i%2 then prepaid else null }))
) )
userSlices = [ userSlices = [
new Users(students.slice(0, 5)) new Users(students.slice(0, 5))
new Users(students.slice(3, 8)) new Users(students.slice(3, 8))
new Users(students.slice(7, 10)) new Users(students.slice(7, 10))
] ]
classrooms = new Classrooms(factories.makeClassroom({}, {members: userSlice}) for userSlice in userSlices) classrooms = new Classrooms(factories.makeClassroom({}, {members: userSlice}) for userSlice in userSlices)
@view.classrooms.fakeRequests[0].respondWith({ status: 200, responseText: classrooms.stringify() }) @view.classrooms.fakeRequests[0].respondWith({ status: 200, responseText: classrooms.stringify() })
for request, i in @view.members.fakeRequests for request, i in @view.members.fakeRequests
request.respondWith({status: 200, responseText: userSlices[i].stringify()}) request.respondWith({status: 200, responseText: userSlices[i].stringify()})
# Make prepaids of various status # Make prepaids of various status
prepaids = new Prepaids([ prepaids = new Prepaids([
factories.makePrepaid({}, {redeemers: new Users(_.times(5, -> factories.makeUser()))}) factories.makePrepaid({}, {redeemers: new Users(_.times(5, -> factories.makeUser()))})
@ -40,12 +40,12 @@ describe 'EnrollmentsView', ->
endDate: moment().add(14, 'months').toISOString() endDate: moment().add(14, 'months').toISOString()
}) })
factories.makePrepaid( # empty factories.makePrepaid( # empty
{ maxRedeemers: 2 }, { maxRedeemers: 2 },
{redeemers: new Users(_.times(2, -> factories.makeUser()))} {redeemers: new Users(_.times(2, -> factories.makeUser()))}
) )
]) ])
@view.prepaids.fakeRequests[0].respondWith({ status: 200, responseText: prepaids.stringify() }) @view.prepaids.fakeRequests[0].respondWith({ status: 200, responseText: prepaids.stringify() })
# Make a few courses, one free # Make a few courses, one free
courses = new Courses([ courses = new Courses([
factories.makeCourse({free: true}) factories.makeCourse({free: true})
@ -54,24 +54,18 @@ describe 'EnrollmentsView', ->
factories.makeCourse({free: false}) factories.makeCourse({free: false})
]) ])
@view.courses.fakeRequests[0].respondWith({ status: 200, responseText: courses.stringify() }) @view.courses.fakeRequests[0].respondWith({ status: 200, responseText: courses.stringify() })
jasmine.demoEl(@view.$el) jasmine.demoEl(@view.$el)
window.view = @view window.view = @view
@view.supermodel.once 'loaded-all', done @view.supermodel.once 'loaded-all', done
it 'shows how many courses there are which enrolled students will have access to', ->
expect(_.contains(@view.$('#enrollments-blurb').text(), '24')).toBe(true)
if @view.$('#actions-col').length isnt 1
fail('There should be an #action-col, other tests depend on it.')
describe '"Get Licenses" area', -> describe '"Get Licenses" area', ->
describe 'when the teacher has made contact', -> describe 'when the teacher has made contact', ->
beforeEach -> beforeEach ->
me.set('enrollmentRequestSent', true) me.set('enrollmentRequestSent', true)
@view.render() @view.render()
it 'shows confirmation and a mailto link to schools@codecombat.com', -> it 'shows confirmation and a mailto link to schools@codecombat.com', ->
if not @view.$('#request-sent-btn').length if not @view.$('#request-sent-btn').length
fail('Request button not found.') fail('Request button not found.')
@ -80,13 +74,12 @@ describe 'EnrollmentsView', ->
# TODO: Figure out why this fails in Travis. Seems like it's not loading en locale # TODO: Figure out why this fails in Travis. Seems like it's not loading en locale
# if not @view.$('a[href="mailto:schools@codecombat.com"]').length # if not @view.$('a[href="mailto:schools@codecombat.com"]').length
# fail('Mailto: link not found.') # fail('Mailto: link not found.')
describe 'when there are no prepaids to show', -> describe 'when there are no prepaids to show', ->
beforeEach (done) -> beforeEach (done) ->
@view.prepaids.reset([]) @view.prepaids.reset([])
@view.updatePrepaidGroups() @view.updatePrepaidGroups()
_.defer(done) _.defer(done)
it 'fills the void with the rest of the page content', -> it 'fills the void with the rest of the page content', ->
expect(@view.$('#actions-col').length).toBe(0) expect(@view.$('#actions-col').length).toBe(0)