mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
4ca476713e
7 changed files with 55 additions and 11 deletions
BIN
app/assets/images/pages/courses/coco_complab.png
Normal file
BIN
app/assets/images/pages/courses/coco_complab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 603 KiB |
|
@ -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
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
|
||||
width: 500px
|
||||
height: 60px
|
||||
display: flex
|
||||
display: none
|
||||
//display: flex // set if present
|
||||
flex-direction: row
|
||||
|
||||
&:hover
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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='$('.courses-faq').popover('hide');'>×</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}")
|
||||
|
|
|
@ -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 ?= {}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue