From c3b3c6ea2a94286fd3391511490b3fead61e25f9 Mon Sep 17 00:00:00 2001 From: Robin Yang Date: Tue, 23 Aug 2016 16:05:12 -0700 Subject: [PATCH] Update Student License requirement copy --- app/locale/en.coffee | 5 ++-- app/templates/courses/enrollments-view.jade | 30 ++++++++----------- .../views/courses/EnrollmentsView.spec.coffee | 29 +++++++----------- 3 files changed, 26 insertions(+), 38 deletions(-) diff --git a/app/locale/en.coffee b/app/locale/en.coffee index 7604c5f77..8aa8ad4d6 100644 --- a/app/locale/en.coffee +++ b/app/locale/en.coffee @@ -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_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" - + play_game_dev_level: created_by: "Created by {{name}}" how_to_play_title: "How to play:" @@ -1475,8 +1475,7 @@ all_students: "All Students" apply_licenses: "Apply Licenses" not_enough_enrollments: "Not enough licenses available." - enrollments_blurb_1: "Students taking Computer Science" - enrollments_blurb_2: "require a license to access the courses." + enrollments_blurb: "Students are required to have a license to access any content after the first course." credits_available: "Licenses Available" total_unique_students: "Total Students" total_enrolled_students: "Enrolled Students" diff --git a/app/templates/courses/enrollments-view.jade b/app/templates/courses/enrollments-view.jade index 3cdc6be55..5b84bea3d 100644 --- a/app/templates/courses/enrollments-view.jade +++ b/app/templates/courses/enrollments-view.jade @@ -29,24 +29,20 @@ block content h3 ATTENTION: Please upgrade your account to a Teacher Account. p | 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 - + .container.m-t-5 .pull-right span.glyphicon.glyphicon-question-sign =' ' a#how-to-enroll-link(data-i18n="teacher.how_to_apply_licenses") h3(data-i18n='teacher.enrollments') - h4#enrollments-blurb - span(data-i18n='teacher.enrollments_blurb_1') - span 2–#{view.state.get('totalCourses')} - span(data-i18n='teacher.enrollments_blurb_2') - + h4#enrollments-blurb(data-i18n='teacher.enrollments_blurb') - var available = view.state.get('prepaidGroups').available - var pending = view.state.get('prepaidGroups').pending - var anyPrepaids = available || pending - + .row.m-t-3 if anyPrepaids #prepaids-col.col-md-9 @@ -56,25 +52,25 @@ block content for prepaid in available .col-sm-4.col-xs-6 +prepaidCard(prepaid) - + if _.size(pending) > 0 h5.m-b-1.m-t-3(data-i18n="teacher.pending_credits") .row for prepaid in pending .col-sm-4.col-xs-6 +prepaidCard(prepaid, 'pending-prepaid-card') - + #actions-col.col-md-3 +addCredits +enrollmentStats - + else // no prepaids .col-sm-6.col-lg-4.col-lg-offset-2 +addCredits .col-sm-6.col-lg-4 +enrollmentStats - + mixin prepaidCard(prepaid, className) .prepaid-card.bg-navy.text-center.m-b-2.p-a-2(class=className) 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-right= moment(prepaid.get('endDate')).utc().format('l') .clearfix - - + + mixin addCredits .text-center.m-b-3.m-t-3 h5(data-i18n="courses.get_enrollments") if me.get('enrollmentRequestSent') #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="[html]teacher.enroll_request_sent_blurb3") 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") button#contact-us-btn.btn-lg.btn.btn-forest(data-i18n="contribute.contact_us_url") - + mixin enrollmentStats h5.text-center.m-t-3.m-b-2(data-i18n='teacher.enrollment_status') table#enrollment-stats-table.table-condensed.table.small-details @@ -114,7 +110,7 @@ mixin enrollmentStats span.spr : td= view.state.get('totalEnrolled') + view.state.get('totalNotEnrolled') tr - td + td span(data-i18n='teacher.total_enrolled_students') span.spr : td= view.state.get('totalEnrolled') diff --git a/test/app/views/courses/EnrollmentsView.spec.coffee b/test/app/views/courses/EnrollmentsView.spec.coffee index 52c91a6e1..7eb392e16 100644 --- a/test/app/views/courses/EnrollmentsView.spec.coffee +++ b/test/app/views/courses/EnrollmentsView.spec.coffee @@ -7,30 +7,30 @@ factories = require 'test/app/factories' TeachersContactModal = require 'views/teachers/TeachersContactModal' describe 'EnrollmentsView', -> - + beforeEach (done) -> me.set('anonymous', false) me.set('role', 'teacher') me.set('enrollmentRequestSent', false) @view = new EnrollmentsView() - + # Make three classrooms, sharing users from a pool of 10, 5 of which are enrolled prepaid = factories.makePrepaid() students = new Users(_.times(10, (i) -> factories.makeUser({}, { prepaid: if i%2 then prepaid else null })) ) - + userSlices = [ new Users(students.slice(0, 5)) new Users(students.slice(3, 8)) new Users(students.slice(7, 10)) ] - + classrooms = new Classrooms(factories.makeClassroom({}, {members: userSlice}) for userSlice in userSlices) @view.classrooms.fakeRequests[0].respondWith({ status: 200, responseText: classrooms.stringify() }) for request, i in @view.members.fakeRequests request.respondWith({status: 200, responseText: userSlices[i].stringify()}) - + # Make prepaids of various status prepaids = new Prepaids([ factories.makePrepaid({}, {redeemers: new Users(_.times(5, -> factories.makeUser()))}) @@ -40,12 +40,12 @@ describe 'EnrollmentsView', -> endDate: moment().add(14, 'months').toISOString() }) factories.makePrepaid( # empty - { maxRedeemers: 2 }, + { maxRedeemers: 2 }, {redeemers: new Users(_.times(2, -> factories.makeUser()))} ) ]) @view.prepaids.fakeRequests[0].respondWith({ status: 200, responseText: prepaids.stringify() }) - + # Make a few courses, one free courses = new Courses([ factories.makeCourse({free: true}) @@ -54,24 +54,18 @@ describe 'EnrollmentsView', -> factories.makeCourse({free: false}) ]) @view.courses.fakeRequests[0].respondWith({ status: 200, responseText: courses.stringify() }) - + jasmine.demoEl(@view.$el) window.view = @view @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(), '2–4')).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 'when the teacher has made contact', -> beforeEach -> me.set('enrollmentRequestSent', true) @view.render() - + it 'shows confirmation and a mailto link to schools@codecombat.com', -> if not @view.$('#request-sent-btn').length 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 # if not @view.$('a[href="mailto:schools@codecombat.com"]').length # fail('Mailto: link not found.') - + describe 'when there are no prepaids to show', -> beforeEach (done) -> @view.prepaids.reset([]) @view.updatePrepaidGroups() _.defer(done) - + it 'fills the void with the rest of the page content', -> expect(@view.$('#actions-col').length).toBe(0) -