From 066d6e7fc1463102fbff441fb564a02d6e9067c4 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Thu, 27 Aug 2015 16:52:02 -0700 Subject: [PATCH] Courses UI: Add FAQ popup to landing page --- app/styles/courses/mock1/courses.sass | 14 +++++++++++++- app/templates/courses/mock1/courses.jade | 6 +++++- app/views/courses/mock1/CoursesView.coffee | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/app/styles/courses/mock1/courses.sass b/app/styles/courses/mock1/courses.sass index 16ad739a7..00934aba9 100644 --- a/app/styles/courses/mock1/courses.sass +++ b/app/styles/courses/mock1/courses.sass @@ -12,6 +12,9 @@ .course-panel margin: 20px + .faq-blurb + font-size: 14px + .row-pick-class display: none @@ -56,4 +59,13 @@ font-size: 20px .img-quote - height: 140px + height: 160px + + .popover + z-index: 1050 + min-width: 400px + + h3 + background: transparent + border: 0 + font-size: 30px diff --git a/app/templates/courses/mock1/courses.jade b/app/templates/courses/mock1/courses.jade index 7cdc64d62..821356a72 100644 --- a/app/templates/courses/mock1/courses.jade +++ b/app/templates/courses/mock1/courses.jade @@ -68,7 +68,11 @@ 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 diff --git a/app/views/courses/mock1/CoursesView.coffee b/app/views/courses/mock1/CoursesView.coffee index 6a3200b71..d910316a2 100644 --- a/app/views/courses/mock1/CoursesView.coffee +++ b/app/views/courses/mock1/CoursesView.coffee @@ -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 = "

Courses FAQ

" + popoverContent = "

Q: What's the difference between these courses and the single player game?

" + popoverContent += "

A: The single player game is designed for individuals, while the courses are designed for classes.

" + popoverContent += "

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.

" + @$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}")