From 9547bd1021e0a08fb583f56675e663328e859723 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Tue, 4 Aug 2015 14:29:44 -0700 Subject: [PATCH] Add sales copy to beginning of courses landing page --- app/core/Router.coffee | 2 +- app/styles/courses/mock1/courses.sass | 30 ++++++++++++++++++++++ app/templates/courses/mock1/courses.jade | 26 ++++++++++++++++++- app/views/courses/mock1/CoursesView.coffee | 11 +++++--- 4 files changed, 64 insertions(+), 5 deletions(-) diff --git a/app/core/Router.coffee b/app/core/Router.coffee index 51c7a6be1..469c46fe6 100644 --- a/app/core/Router.coffee +++ b/app/core/Router.coffee @@ -61,7 +61,7 @@ module.exports = class CocoRouter extends Backbone.Router 'courses/mock1': go('courses/mock1/CoursesView') 'courses/mock1/:courseID': go('courses/mock1/CourseDetailsView') 'courses/mock1/:courseID/info': go('courses/mock1/CourseInfoView') - 'courses/mock1/:courseID/enroll': go('courses/mock1/CourseEnrollView') + 'courses/mock1/enroll': go('courses/mock1/CourseEnrollView') 'db/*path': 'routeToServer' 'demo(/*subpath)': go('DemoView') diff --git a/app/styles/courses/mock1/courses.sass b/app/styles/courses/mock1/courses.sass index c2e9cbac6..41d6f2f17 100644 --- a/app/styles/courses/mock1/courses.sass +++ b/app/styles/courses/mock1/courses.sass @@ -20,3 +20,33 @@ .or margin-bottom: 20px font-size: 14pt + + .btn-enroll + margin-top: 20px + + .center + text-align: center + + .caption-text + font-size: 14px + + .concepts-container + width: 200px + + .contact-container + margin-top: 20px + text-align: center + + .info-container + margin: 0% 10% + font-size: 18px + + .monitoring-img-container + margin-top: 10px + + .praise-quote + font-size: 24px + font-style: italic + + .progress-container + font-size: 20px diff --git a/app/templates/courses/mock1/courses.jade b/app/templates/courses/mock1/courses.jade index ee9f4e411..96e3e443a 100644 --- a/app/templates/courses/mock1/courses.jade +++ b/app/templates/courses/mock1/courses.jade @@ -5,7 +5,6 @@ block content //- DO NOT localize / i18n div TODO: Add already enrolled view checkbox - div TODO: Add sales copy at beginning div(style='border-bottom: 1px solid black') span *UNDER CONSTRUCTION, send feedback to a.spl(href='mailto:team@codecombat.com') team@codecombat.com @@ -53,6 +52,31 @@ block content button.btn.btn-success.btn-lg.btn-buy(data-course-id="#{courseID}") Buy this course h1.center Courses + + .info-container + //- p.center.gameplay-img-container + //- img(src="/images/pages/courses/101_info.png" width='800') + + .container-fluid + .row + .col-md-6 + div With CodeCombat courses, you and your students will: + ul + li Learn more in less time + li With no experience necesssary + li Monitor student progress + br + .col-md-6 + p + div.praise-quote "#{praise.quote}" + div.caption-text - #{praise.source} + //- .row + //- .col-md-12 + //- div.center + //- button.btn.btn-success.btn-lg.btn-buy Enroll Now! + + //- h2.center Available Courses + .container-fluid - var i = 0 while i < courses.length diff --git a/app/views/courses/mock1/CoursesView.coffee b/app/views/courses/mock1/CoursesView.coffee index 69ed85ecd..0956707ff 100644 --- a/app/views/courses/mock1/CoursesView.coffee +++ b/app/views/courses/mock1/CoursesView.coffee @@ -21,6 +21,7 @@ module.exports = class CoursesView extends RootView context = super() context.courses = @courses ? [] context.instances = @instances ? [] + context.praise = @praise context initData: -> @@ -32,11 +33,15 @@ module.exports = class CoursesView extends RootView else break @instances = mockData.instances + @praise = mockData.praise[_.random(0, mockData.praise.length - 1)] onClickBuy: (e) -> - courseID = $(e.target).data('course-id') - app.router.navigate "/courses/mock1/#{courseID}/enroll" - window.location.reload() + $('#continueModal').modal('hide') + courseID = $(e.target).data('course-id') ? 0 + viewClass = require 'views/courses/mock1/CourseEnrollView' + viewArgs = [{}, courseID] + navigationEvent = route: "/courses/mock1/enroll", viewClass: viewClass, viewArgs: viewArgs + Backbone.Mediator.publish 'router:navigate', navigationEvent onClickContinue: (e) -> courseID = $(e.target).data('course-id')