Commit 7091ed0f by Harry Rein Committed by GitHub

Merge pull request #16337 from edx/HarryRein/home-page-styling-fixes

Course home page styling with bootstrap.
parents 52897d58 d4e93fc6
...@@ -69,7 +69,7 @@ class CourseHomePage(CoursePage): ...@@ -69,7 +69,7 @@ class CourseHomePage(CoursePage):
Search within a class for a particular term. Search within a class for a particular term.
""" """
self.q(css='.search-form > .search-input').fill(search_term) self.q(css='.search-form > .search-input').fill(search_term)
self.q(css='.search-form > .search-button').click() self.q(css='.search-form .search-button').click()
return CourseSearchResultsPage(self.browser, self.course_id) return CourseSearchResultsPage(self.browser, self.course_id)
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
.course-header { .course-header {
@include float(left); @include float(left);
@include margin($baseline, 0, 0, $baseline); @include margin($baseline*1.25, 0, 0, $baseline);
font-size: $font-size-lg; font-size: $font-size-lg;
color: theme-color("dark"); color: theme-color("dark");
...@@ -319,6 +319,7 @@ ...@@ -319,6 +319,7 @@
.mobile-nav-link { .mobile-nav-link {
position: static; position: static;
transform: none; transform: none;
padding: 0;
a { a {
font-size: $font-size-base; font-size: $font-size-base;
......
...@@ -45,21 +45,28 @@ ...@@ -45,21 +45,28 @@
padding: 20px; padding: 20px;
.page-header-search { .page-header-search {
@include media-breakpoint-up(md) { @include margin-right($baseline);
margin-right: $baseline;
} flex-grow: 1;
.search-form { .search-form {
display: flex; display: flex;
} }
} }
.form-actions {
@include media-breakpoint-down(xs) {
margin-top: $baseline/2;
}
}
.page-header-main { .page-header-main {
flex-grow: 1; // This column should consume all the available space flex-grow: 1; // This column should consume all the available space
} }
.page-header-secondary { .page-header-secondary {
display: flex; display: flex;
flex-wrap: wrap;
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
margin-left: $baseline; margin-left: $baseline;
......
...@@ -64,7 +64,7 @@ $lms-inactive-color: theme-color("disabled") !default; ...@@ -64,7 +64,7 @@ $lms-inactive-color: theme-color("disabled") !default;
$success-color: theme-color("success") !default; $success-color: theme-color("success") !default;
$success-color-hover: theme-color("success") !default; $success-color-hover: theme-color("success") !default;
$lms-hero-color: #005e90 !default; $lms-hero-color: #005e90 !default;
$lms-purchase-color: theme-color("success") !default; $lms-purchase-color: rgba(0, 155, 0, 1) !default;
$border-color-2: $gray-400 !default; $border-color-2: $gray-400 !default;
$link-hover: #065683 !default; // wcag2a compliant $link-hover: #065683 !default; // wcag2a compliant
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
margin: 0 auto 0; margin: 0 auto 0;
padding: ($baseline*0.75); padding: ($baseline*0.75);
background-color: $lms-preview-menu-color; background-color: theme-color("primary");
box-sizing: border-box; box-sizing: border-box;
@media print { @media print {
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
display: inline-block; display: inline-block;
margin-bottom: 0; margin-bottom: 0;
vertical-align: middle; vertical-align: middle;
color: theme-color("inverse");
} }
.action-preview-select { .action-preview-select {
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
.goal-option { .goal-option {
text-decoration: none; text-decoration: none;
font-size: font-size(x-small); font-size: $font-size-base;
padding: $baseline/2; padding: $baseline/2;
margin: $baseline/4 $baseline/4 0; margin: $baseline/4 $baseline/4 0;
flex-grow: 1; flex-grow: 1;
...@@ -213,12 +213,12 @@ ...@@ -213,12 +213,12 @@
@include float(left); @include float(left);
border: 1px solid $lms-border-color; border: 1px solid $lms-border-color;
padding: $baseline*0.75 $baseline*0.75 $baseline*0.25; padding: $baseline*0.75 $baseline*0.75 $baseline*0.5;
border-radius: 5px; border-radius: 5px;
position: relative; position: relative;
width: 100%; width: 100%;
cursor: pointer; cursor: pointer;
margin-bottom: $baseline/2; margin-bottom: $baseline;
&.hidden { &.hidden {
display: none; display: none;
...@@ -245,8 +245,8 @@ ...@@ -245,8 +245,8 @@
.current-goal-container { .current-goal-container {
.title { .title {
@include margin($baseline/5, $baseline*0.4, 0, 0);
@include float(left); @include float(left);
@include margin-right($baseline/4);
} }
.title-label { .title-label {
...@@ -324,6 +324,7 @@ ...@@ -324,6 +324,7 @@
list-style-type: none; list-style-type: none;
border: 1px solid transparent; border: 1px solid transparent;
border-radius: 3px; border-radius: 3px;
margin-bottom: $baseline/4;
a.outline-item { a.outline-item {
display: flex; display: flex;
...@@ -369,6 +370,10 @@ ...@@ -369,6 +370,10 @@
&:hover { &:hover {
border: 1px solid $lms-active-color; border: 1px solid $lms-active-color;
} }
&:last-child {
margin-bottom: 0;
}
} }
&:last-child { &:last-child {
......
// Styles for course search results // Styles for course search results
.search-results { .search-results {
flex-grow: 1;
.search-result-list { .search-result-list {
list-style: none; list-style: none;
margin: 0; margin: 0;
......
...@@ -24,29 +24,15 @@ ...@@ -24,29 +24,15 @@
box-shadow: none; box-shadow: none;
-webkit-transition: background-color 0.5s; -webkit-transition: background-color 0.5s;
transition: background-color 0.5s; transition: background-color 0.5s;
cursor: pointer;
&.active { &.active,
&:hover {
color: theme-color("success"); color: theme-color("success");
background-color: theme-color("inverse"); background-color: theme-color("inverse");
border-color: theme-color("success"); border-color: theme-color("success");
background-image: none; background-image: none;
box-shadow: none; box-shadow: none;
&:hover {
color: theme-color("inverse");
background-color: $success-color-hover;
border-color: $success-color-hover;
background-image: none;
box-shadow: none;
}
}
&:hover {
color: theme-color("inverse");
background-color: $success-color-hover;
border-color: $success-color-hover;
background-image: none;
box-shadow: none;
} }
} }
...@@ -113,6 +99,7 @@ ...@@ -113,6 +99,7 @@
right: $baseline; right: $baseline;
background-color: theme-color("success"); background-color: theme-color("success");
border-color: theme-color("success"); border-color: theme-color("success");
color: theme-color("inverse");
background-image: none; background-image: none;
box-shadow: none; box-shadow: none;
......
...@@ -25,8 +25,9 @@ ...@@ -25,8 +25,9 @@
// Message copy // Message copy
.vc-title { .vc-title {
font-size: 1.25rem; font-size: 1.25rem;
font-weight: 700; font-weight: $font-weight-light;
margin-bottom: 1rem; margin-bottom: 1rem;
width: calc(100% - 70px);
} }
.vc-selling-points { .vc-selling-points {
...@@ -55,11 +56,32 @@ ...@@ -55,11 +56,32 @@
} }
} }
// Upgrade button
.btn-upgrade {
color: theme-color("inverse");
background-color: $lms-purchase-color;
font-size: $font-size-base;
-webkit-transition: $btn-transition;
transition: $btn-transition;
&:hover {
background-color: theme-color("success");
}
}
// Show/hide button // Show/hide button
.vc-toggle { .vc-toggle {
@include float(right); @include right($baseline/2);
top: $baseline/2;
position: absolute;
color: theme-color("inverse"); color: theme-color("inverse");
&:hover {
cursor: pointer;
text-decoration: none;
color: theme-color("light");
}
} }
// Cert image // Cert image
...@@ -80,30 +102,47 @@ ...@@ -80,30 +102,47 @@
// Collapsed upgrade message // Collapsed upgrade message
.vc-message.polite { .vc-message.polite {
@include padding($baseline/2, 0, $baseline/2, $baseline);
padding-top: $baseline/2; padding-top: $baseline/2;
padding-bottom: $baseline/2; padding-bottom: $baseline/2;
min-height: 46px; min-height: 46px;
display: flex; display: flex;
flex-flow: row wrap;
align-items: center; align-items: center;
.vc-title { .vc-title {
margin: 0;
@include margin-right(auto); @include margin-right(auto);
margin: 0;
flex-grow: 1;
} }
.vc-cta { .vc-cta {
@include margin-right(1rem); flex-grow: 1;
} }
.vc-toggle { .vc-toggle {
@include right(0);
margin: 0 $baseline/2;
order: 99; order: 99;
position: relative;
white-space: nowrap;
width: $baseline*6;
top: 0;
} }
.vc-fade:not(.vc-polite-only) { .vc-fade:not(.vc-polite-only) {
display: none; display: none;
} }
@include media-breakpoint-down(sm) {
flex-flow: row wrap;
.vc-title {
width: auto;
margin-bottom: $baseline/2;
}
}
} }
@media (max-width: $grid-breakpoints-sm) { @media (max-width: $grid-breakpoints-sm) {
......
...@@ -28,7 +28,7 @@ from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG, SHOW_REV ...@@ -28,7 +28,7 @@ from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG, SHOW_REV
<div class="page-header-secondary"> <div class="page-header-secondary">
% if settings.FEATURES.get('ENABLE_COURSEWARE_SEARCH'): % if settings.FEATURES.get('ENABLE_COURSEWARE_SEARCH'):
<div class="page-header-search"> <div class="page-header-search">
<form class="search-form" role="search" action="${reverse('openedx.course_search.course_search_results', args=[course_key])}"> <form class="search-form input-group" role="search" action="${reverse('openedx.course_search.course_search_results', args=[course_key])}">
<label class="field-label sr-only" for="search" id="search-hint">${_('Search the course')}</label> <label class="field-label sr-only" for="search" id="search-hint">${_('Search the course')}</label>
<input <input
class="field-input input-text search-input form-control" class="field-input input-text search-input form-control"
...@@ -37,7 +37,9 @@ from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG, SHOW_REV ...@@ -37,7 +37,9 @@ from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG, SHOW_REV
id="search" id="search"
placeholder="${_('Search the course')}" placeholder="${_('Search the course')}"
/> />
<span class="input-group-btn">
<button class="btn btn-outline-primary search-button" type="submit">${_('Search')}</button> <button class="btn btn-outline-primary search-button" type="submit">${_('Search')}</button>
</span>
</form> </form>
</div> </div>
% endif % endif
...@@ -81,7 +83,7 @@ from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG, SHOW_REV ...@@ -81,7 +83,7 @@ from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG, SHOW_REV
</ul> </ul>
<div class="vc-cta vc-fade vc-polite-only"> <div class="vc-cta vc-fade vc-polite-only">
<a class="btn-upgrade" <a class="btn btn-upgrade"
href="${ upgrade_url }" href="${ upgrade_url }"
data-creative="hero_matthew_smith" data-creative="hero_matthew_smith"
data-position="hero">${_("Upgrade ({price})").format(price=upgrade_price)}</a> data-position="hero">${_("Upgrade ({price})").format(price=upgrade_price)}</a>
......
...@@ -517,7 +517,7 @@ class CourseHomeFragmentViewTests(ModuleStoreTestCase): ...@@ -517,7 +517,7 @@ class CourseHomeFragmentViewTests(ModuleStoreTestCase):
response = self.client.get(self.url) response = self.client.get(self.url)
self.assertIn('vc-message', response.content) self.assertIn('vc-message', response.content)
url = EcommerceService().get_checkout_page_url(self.verified_mode.sku) url = EcommerceService().get_checkout_page_url(self.verified_mode.sku)
self.assertIn('<a class="btn-upgrade"', response.content) self.assertIn('<a class="btn btn-upgrade"', response.content)
self.assertIn(url, response.content) self.assertIn(url, response.content)
self.assertIn('Upgrade (${price})</a>'.format(price=self.verified_mode.min_price), response.content) self.assertIn('Upgrade (${price})</a>'.format(price=self.verified_mode.min_price), response.content)
......
...@@ -172,7 +172,7 @@ def _register_course_goal_message(request, course): ...@@ -172,7 +172,7 @@ def _register_course_goal_message(request, course):
'{initial_tag}{goal_text}{closing_tag}' '{initial_tag}{goal_text}{closing_tag}'
).format( ).format(
initial_tag=HTML( initial_tag=HTML(
'<button tabindex="0" aria-label="{aria_label_choice}" class="goal-option btn" ' '<button tabindex="0" aria-label="{aria_label_choice}" class="goal-option btn-outline-primary" '
'data-choice="{goal_key}">' 'data-choice="{goal_key}">'
).format( ).format(
goal_key=goal_key, goal_key=goal_key,
......
...@@ -19,7 +19,7 @@ from openedx.features.course_experience import course_home_page_title ...@@ -19,7 +19,7 @@ from openedx.features.course_experience import course_home_page_title
%> %>
<%block name="content"> <%block name="content">
<div class="course-view pzge-content-container" id="course-container"> <div class="course-view page-content-container" id="course-container">
<header class="page-header has-secondary"> <header class="page-header has-secondary">
<div class="page-header-main"> <div class="page-header-main">
<nav aria-label="${_('Search Results')}" class="sr-is-focusable" tabindex="-1"> <nav aria-label="${_('Search Results')}" class="sr-is-focusable" tabindex="-1">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment