From a93832aabe087b0a673f7f221af3274590b0bd28 Mon Sep 17 00:00:00 2001 From: Matt Tuchfarber Date: Thu, 26 Oct 2017 15:41:59 -0400 Subject: [PATCH] Add hero to main.html and use for program page Adding hero to main.html allows for full width marketing images to be used. This commit includes the addition of the hero block into main.html along with the program marketing page's use of that new hero block. --- .../sass/views/_program-marketing-page.scss | 42 ++++--- .../courseware/program_marketing.html | 117 ++++++++++-------- lms/templates/main.html | 2 + 3 files changed, 91 insertions(+), 70 deletions(-) diff --git a/lms/static/sass/views/_program-marketing-page.scss b/lms/static/sass/views/_program-marketing-page.scss index 6e8149d151..c89abf4852 100644 --- a/lms/static/sass/views/_program-marketing-page.scss +++ b/lms/static/sass/views/_program-marketing-page.scss @@ -1,28 +1,15 @@ -#program-details-page { - font-size: 16px; - +#program-details-hero { .program_title { font-weight: bold; - margin-top: $baseline + margin-top: $baseline; } .logo { height: 100px; } - .section_title { - margin-bottom: $baseline; - color: theme-color("dark"); - } - - .thick_rule { - height: 4px; - border: 0; - background-color: theme-color('secondary'); - } - .main-banner { - color: white; + color: $white; margin-bottom: 1px; background-size: cover; background-repeat: no-repeat; @@ -50,7 +37,7 @@ button { background-color: transparent; - color: $white + color: $white; } iframe { @@ -70,13 +57,32 @@ .quick-nav { background-color: theme-color('light'); - margin-bottom: $baseline/2; .nav-item { font-size: 18px; color: $white; } } +} + +#program-details-page { + margin-top: $baseline; + font-size: $font-size-base; + + .logo { + height: 100px; + } + + .section_title { + margin-bottom: $baseline; + color: theme-color("dark"); + } + + .thick_rule { + height: 4px; + border: 0; + background-color: theme-color('secondary'); + } .program-info { .quote { diff --git a/lms/templates/courseware/program_marketing.html b/lms/templates/courseware/program_marketing.html index 7fbc53dd39..d6de91f064 100644 --- a/lms/templates/courseware/program_marketing.html +++ b/lms/templates/courseware/program_marketing.html @@ -41,11 +41,8 @@ endorser_position = endorser.get('position') or {} endorser_title = endorser_position.get('title') endorser_org = endorser_position.get('organization_name') or corporate_endorsement_name expected_learning_items = program['expected_learning_items'] -authoring_organizations = program['authoring_organizations'] min_hours_effort_per_week = program['min_hours_effort_per_week'] max_hours_effort_per_week = program['max_hours_effort_per_week'] -video_url = program['video'].get('src') if program['video'] else '' -banner_image = program.get('banner_image', {}).get('large', {}).get('url', '') %> <%block name="js_extra"> @@ -53,56 +50,72 @@ banner_image = program.get('banner_image', {}).get('large', {}).get('url', '') <%block name="pagetitle">${program['title']} +<%block name="marketing_hero"> + <% + banner_image = program.get('banner_image', {}).get('large', {}).get('url', '') + authoring_organizations = program['authoring_organizations'] + video_url = program['video'].get('src') if program['video'] else '' + %> +
+
+
+
+
+ % if authoring_organizations and authoring_organizations[0]['logo_image_url']: +
+ +
+ % endif +
+

${program['title']}

+
+
+

${program['subtitle']}

+
+
+ % if program.get('is_learner_eligible_for_one_click_purchase'): + + ${_('Purchase the Program')} + + % else: + + ${_('Start Learning')} + + % endif +
+
+
+ % if video_url: +
+ + +
+ % endif +
+
+
+
+ +
+ +
-
-
- % if authoring_organizations and authoring_organizations[0]['logo_image_url']: -
- -
- % endif -
-

${program['title']}

-
-
-

${program['subtitle']}

-
-
- % if program.get('is_learner_eligible_for_one_click_purchase'): - - ${_('Purchase the Program')} - - % else: - - ${_('Start Learning')} - - % endif -
-
-
- % if video_url: -
- - -
- % endif -
-
-
diff --git a/lms/templates/main.html b/lms/templates/main.html index 0b22f14958..9e740e325d 100644 --- a/lms/templates/main.html +++ b/lms/templates/main.html @@ -156,6 +156,8 @@ from pipeline_mako import render_require_js_path_overrides % endif <%include file="/page_banner.html" /> + +
<%block name="marketing_hero">
${self.body()}