Merge branch 'master' into production

This commit is contained in:
Nick Winter 2015-08-28 10:45:19 -07:00
commit 4ca476713e
7 changed files with 55 additions and 11 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 KiB

View file

@ -12,6 +12,9 @@
.course-panel
margin: 20px
.faq-blurb
font-size: 14px
.row-pick-class
display: none
@ -31,9 +34,6 @@
.center
text-align: center
.caption-text
font-size: 14px
.concepts-container
width: 200px
@ -48,9 +48,24 @@
.monitoring-img-container
margin-top: 10px
.praise-caption
font-size: 14px
.praise-quote
font-size: 24px
font-size: 20px
font-style: italic
.progress-container
font-size: 20px
.img-quote
height: 160px
.popover
z-index: 1050
min-width: 400px
h3
background: transparent
border: 0
font-size: 30px

View file

@ -15,7 +15,8 @@
width: 500px
height: 60px
display: flex
display: none
//display: flex // set if present
flex-direction: row
&:hover

View file

@ -68,11 +68,17 @@ block content
li No coding experience necesssary
li Easily monitor student progress
div Purchase a course for your entire class. It's easy to sign up your students!
p Purchase a course for your entire class. It's easy to sign up your students!
p.faq-blurb
span.spr See the courses
a.spr.courses-faq FAQ
span for more information.
.col-md-6
img.img-quote(src="/images/pages/courses/coco_complab.png")
p
.well.well-sm
div.praise-quote "#{praise.quote}"
div.caption-text - #{praise.source}
div.praise-caption - #{praise.source}
h2.center Choose Your Course:

View file

@ -28,6 +28,10 @@ module.exports = class CoursesView extends RootView
context.studentMode = @studentMode
context
afterRender: ->
super()
@setupCoursesFAQPopover()
initData: ->
mockData = require 'views/courses/mock1/CoursesMockData'
@courses = mockData.courses
@ -39,6 +43,23 @@ module.exports = class CoursesView extends RootView
@instances = mockData.instances
@praise = mockData.praise[_.random(0, mockData.praise.length - 1)]
setupCoursesFAQPopover: ->
popoverTitle = "<h3>Courses FAQ<button type='button' class='close' onclick='$(&#39;.courses-faq&#39;).popover(&#39;hide&#39;);'>&times;</button></h3>"
popoverContent = "<p><strong>Q:</strong> What's the difference between these courses and the single player game?</p>"
popoverContent += "<p><strong>A:</strong> The single player game is designed for individuals, while the courses are designed for classes.</p>"
popoverContent += "<p>The single player game has items, gems, hero selection, leveling up, and in-app purchases. Courses have classroom management features and streamlined student-focused level pacing.</p>"
@$el.find('.courses-faq').popover(
animation: true
html: true
placement: 'top'
trigger: 'click'
title: popoverTitle
content: popoverContent
container: @$el
).on 'shown.bs.popover', =>
application.tracker?.trackEvent 'Subscription payment methods hover'
onClickBuy: (e) ->
courseID = $(e.target).data('course-id') ? 0
app.router.navigate("/courses/mock1/enroll/#{courseID}")

View file

@ -49,6 +49,7 @@ module.exports = class DuelStatsView extends CocoView
super()
for player in @players
@buildAvatar player.heroID, player.team
@$el.css 'display', 'flex' # Show it
buildAvatar: (heroID, team) ->
@avatars ?= {}

View file

@ -37,8 +37,8 @@ getRandomSessions = (user, callback) ->
# Determine whether to play a random match, an internal league match, or an external league match.
# Only people in a league will end up simulating internal league matches (for leagues they're in) except by dumb chance.
# If we don't like that, we can rework sampleByLevel to have an opportunity to switch to internal leagues if the first session had a league affiliation.
leagueIDs = user.get('clans') or []
#leagueIDs = leagueIDs.concat user.get('courseInstances') or []
leagueIDs = user?.get('clans') or []
#leagueIDs = leagueIDs.concat user?.get('courseInstances') or []
leagueIDs = (leagueID + '' for leagueID in leagueIDs) # Make sure to fetch them as strings.
return sampleByLevel callback unless leagueIDs.length and Math.random() > 1 / leagueIDs.length
leagueID = _.sample leagueIDs