Commit fd397964 by Peter Fogg

Styling and template changes for the Course Home page.

ECOM-2810
parent 1cd5086b
...@@ -186,7 +186,10 @@ class VerifiedUpgradeDeadlineDate(DateSummary): ...@@ -186,7 +186,10 @@ class VerifiedUpgradeDeadlineDate(DateSummary):
""" """
css_class = 'verified-upgrade-deadline' css_class = 'verified-upgrade-deadline'
title = _('Verification Upgrade Deadline') title = _('Verification Upgrade Deadline')
description = _('You are still eligible to upgrade to a Verified Certificate!') description = _(
'You are still eligible to upgrade to a Verified Certificate! '
'Pursue it to highlight the knowledge and skills you gain in this course.'
)
link_text = _('Upgrade to Verified Certificate') link_text = _('Upgrade to Verified Certificate')
@property @property
......
...@@ -11,6 +11,7 @@ from django.core.urlresolvers import reverse ...@@ -11,6 +11,7 @@ from django.core.urlresolvers import reverse
from survey.models import SurveyForm, SurveyAnswer from survey.models import SurveyForm, SurveyAnswer
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...@@ -29,7 +30,7 @@ class SurveyViewsTests(ModuleStoreTestCase): ...@@ -29,7 +30,7 @@ class SurveyViewsTests(ModuleStoreTestCase):
# Create two accounts # Create two accounts
self.password = 'abc' self.password = 'abc'
self.student = User.objects.create_user('student', 'student@test.com', self.password) self.student = UserFactory.create(username='student', email='student@test.com', password=self.password)
self.test_survey_name = 'TestSurvey' self.test_survey_name = 'TestSurvey'
self.test_form = ''' self.test_form = '''
......
...@@ -231,40 +231,41 @@ ...@@ -231,40 +231,41 @@
.date-summary-container { .date-summary-container {
.date-summary { .date-summary {
@include clearfix; @include clearfix;
margin-top: $baseline/2;
margin-bottom: $baseline/2;
padding: 10px; padding: 10px;
background-color: $gray-l4;
@include border-left(3px solid $gray-l3); @include border-left(3px solid $gray-l3);
.heading {
@extend %t-title7;
color: $gray-d2;
}
.description { .description {
margin-top: $baseline/2; margin-top: $baseline/2;
margin-bottom: $baseline/2; margin-bottom: $baseline/2;
display: inline-block; display: inline-block;
color: $lighter-base-font-color; color: $gray-d1;
font-size: 80%; @extend %t-title8;
} }
.date-summary-link { .date-summary-link {
@include float(right); @extend %t-title8;
font-size: 80%;
font-weight: $font-semibold; font-weight: $font-semibold;
a { a {
color: $base-font-color; color: $link-color;
font-weight: normal;
} }
} }
.date { .date {
color: $lighter-base-font-color; color: $gray-d1;
font-size: 80%; @extend %t-title9;
} }
&-todays-date { &-todays-date {
@include border-left(3px solid $blue); @include border-left(3px solid $blue);
.heading { .heading {
font-weight: $font-regular; @extend %t-title8;
font-size: 80%;
} }
} }
......
...@@ -32,9 +32,16 @@ body.view-in-course { ...@@ -32,9 +32,16 @@ body.view-in-course {
.wrapper-course-material .course-material, .wrapper-course-material .course-material,
.wrapper-preview-menu .preview-menu { .wrapper-preview-menu .preview-menu {
width: auto; width: auto;
}
.wrapper-preview-menu .preview-menu {
padding: 15px 2%; padding: 15px 2%;
} }
.wrapper-course-material .course-material {
padding: ($baseline/2) 0 0 0;
}
.wrapper-course-material .course-material .course-tabs { .wrapper-course-material .course-material .course-tabs {
padding: 0; padding: 0;
} }
......
...@@ -514,7 +514,7 @@ $light-gray: rgb(221, 221, 221) !default; ...@@ -514,7 +514,7 @@ $light-gray: rgb(221, 221, 221) !default;
$dark-gray: rgb(51, 51, 51) !default; $dark-gray: rgb(51, 51, 51) !default;
$border-color: rgb(200, 200, 200) !default; $border-color: rgb(200, 200, 200) !default;
$sidebar-color: rgb(246, 246, 246) !default; $sidebar-color: rgb(246, 246, 246) !default;
$outer-border-color: rgb(170, 170, 170); $outer-border-color: $gray-l3;
$light-gray: rgb(221,221,221) !default; $light-gray: rgb(221,221,221) !default;
// used by descriptor css // used by descriptor css
......
.home-wrapper {
max-width: 1180px;
margin: 0 auto;
.home {
margin: $baseline;
.page-title {
margin-bottom: 5px;
color: $dark-gray1;
font-size: 24px;
}
.page-subtitle {
color: $dark-gray2;
font-size: 14px;
text-transform: none;
}
}
}
div.info-wrapper { div.info-wrapper {
background-color: rgb(252, 252, 252);
section.updates { section.updates {
@extend .content; @extend .content;
@include padding-left($baseline);
line-height: lh(); line-height: lh();
> h1 { h1 {
@extend .top-header; @include text-align(left);
@extend %t-strong;
@extend %t-title6;
margin-bottom: $baseline;
font-style: normal;
} }
> p { > p {
...@@ -19,10 +47,10 @@ div.info-wrapper { ...@@ -19,10 +47,10 @@ div.info-wrapper {
> li,article { > li,article {
@extend .clearfix; @extend .clearfix;
border-bottom: 1px solid lighten($border-color, 10%); padding: $baseline;
list-style-type: none; list-style-type: none;
margin-bottom: lh(1.5); margin-bottom: lh(1.5);
padding-bottom: lh(.75); background-color: $white;
ol, ul { ol, ul {
ol,ul { ol,ul {
...@@ -31,8 +59,9 @@ div.info-wrapper { ...@@ -31,8 +59,9 @@ div.info-wrapper {
} }
h2 { h2 {
font-size: $body-font-size; @extend %t-title9;
font-weight: bold; margin-bottom: ($baseline/4);
text-transform: none;
background: url('#{$static-path}/images/calendar-icon.png') 0 center no-repeat; background: url('#{$static-path}/images/calendar-icon.png') 0 center no-repeat;
padding-left: $baseline; padding-left: $baseline;
} }
...@@ -81,8 +110,7 @@ div.info-wrapper { ...@@ -81,8 +110,7 @@ div.info-wrapper {
padding: 20px 30px; padding: 20px 30px;
margin: 0; margin: 0;
@extend .sidebar; @extend .sidebar;
border-radius: 0 4px 4px 0; background: rgba(0, 0, 0, 0);
@include border-left(1px solid #ddd);
box-shadow: none; box-shadow: none;
font-size: 14px; font-size: 14px;
...@@ -97,15 +125,14 @@ div.info-wrapper { ...@@ -97,15 +125,14 @@ div.info-wrapper {
h1 { h1 {
@include text-align(left); @include text-align(left);
@extend %t-strong;
@extend %t-title6;
margin-bottom: 0; margin-bottom: 0;
padding: 12px 26px 20px 0; padding: 12px 26px 20px 0;
font-size: 18px;
font-style: normal; font-style: normal;
font-weight: bold;
} }
ul { ul {
background-color: #f6f6f6;
margin-bottom: 14px; margin-bottom: 14px;
} }
...@@ -119,7 +146,8 @@ div.info-wrapper { ...@@ -119,7 +146,8 @@ div.info-wrapper {
padding: 0; padding: 0;
color: $link-color; color: $link-color;
&:hover, &:focus { &:hover,
&:focus {
background: transparent; background: transparent;
} }
} }
...@@ -154,7 +182,8 @@ div.info-wrapper { ...@@ -154,7 +182,8 @@ div.info-wrapper {
display: inline-block; display: inline-block;
padding: 0; padding: 0;
&:hover, &:focus { &:hover,
&:focus {
background: transparent; background: transparent;
} }
} }
...@@ -175,7 +204,8 @@ div.info-wrapper { ...@@ -175,7 +204,8 @@ div.info-wrapper {
display: inline-block; display: inline-block;
padding: 0; padding: 0;
&:hover, &:focus { &:hover,
&:focus {
background: transparent; background: transparent;
} }
} }
...@@ -191,7 +221,8 @@ div.info-wrapper { ...@@ -191,7 +221,8 @@ div.info-wrapper {
position: absolute; position: absolute;
width: 100%; width: 100%;
&:hover, &:focus { &:hover,
&:focus {
opacity: 0.6; opacity: 0.6;
filter: alpha(opacity=60); filter: alpha(opacity=60);
......
...@@ -24,8 +24,7 @@ ...@@ -24,8 +24,7 @@
display: table; display: table;
table-layout: fixed; table-layout: fixed;
width: 100%; width: 100%;
border-radius: 3px; border: 1px solid $border-color-2;
border: 1px solid $outer-border-color;
background: $container-bg; background: $container-bg;
box-shadow: 0 1px 2px $shadow-l2; box-shadow: 0 1px 2px $shadow-l2;
} }
......
...@@ -15,48 +15,50 @@ ...@@ -15,48 +15,50 @@
ol.course-tabs { ol.course-tabs {
@include border-top-radius(4px); @include border-top-radius(4px);
@include clearfix(); @include clearfix();
@include margin-left(10px);
padding: ($baseline*0.75) 0 ($baseline*0.75) 0; padding: ($baseline*0.75) 0 ($baseline*0.75) 0;
li { li {
@include float(left); @include float(left);
list-style: none; list-style: none;
margin-right: 6px;
&.prominent { &.prominent {
margin-right: 16px; margin-right: 16px;
background: rgba(255, 255, 255, .5); @include margin-right(16px);
background: rgba(255, 255, 255, 0.5);
border-radius: 3px; border-radius: 3px;
} }
&.prominent + li { &.prominent + li {
padding-left: ($baseline*0.75); @include padding-left($baseline*0.75);
border-left: 1px solid #333; @include border-left(1px solid $gray-d3);
} }
a { a {
border-radius: 3px; @include padding(($baseline/2), ($baseline*0.75), 13px, ($baseline*0.75));
color: #555; @extend %t-title7;
@extend %t-strong;
border-bottom: 3px solid transparent;
color: $gray-d1;
display: block; display: block;
text-align: center; text-align: center;
padding: ($baseline/2) 13px 12px;
font-size: 14px;
font-weight: bold;
text-decoration: none; text-decoration: none;
// text-shadow: 0 1px 0 rgba(0, 0, 0, .4); // text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
&:hover, &:focus { &:hover,
color: #333; &:focus {
background: rgba(255, 255, 255, .6); color: $blue;
border-bottom: 3px solid $blue;
} }
&.active { &.active {
// background: $shadow; border-bottom: 3px solid $gray-d4;
@include linear-gradient(top, rgba(0, 0, 0, .4), rgba(0, 0, 0, .25));
background-color: transparent; background-color: transparent;
box-shadow: 0 1px 0 rgba(255, 255, 255, .5), 0 1px 1px rgba(0, 0, 0, .3) inset; color: $gray-d4;
color: $white;
text-shadow: 0 1px 0 rgba(0, 0, 0, .4); &:hover,
&:focus {
color: $gray-d4;
}
} }
} }
} }
...@@ -87,7 +89,7 @@ header.global.slim { ...@@ -87,7 +89,7 @@ header.global.slim {
} }
.guest .secondary { .guest .secondary {
margin-right: 0; @include margin-right(0);
} }
.guest .secondary a { .guest .secondary a {
......
...@@ -115,8 +115,8 @@ header.global { ...@@ -115,8 +115,8 @@ header.global {
.user { .user {
@include float(right); @include float(right);
@extend %ui-print-excluded; @extend %ui-print-excluded;
margin-top: ($baseline/4);
padding-left: 0; padding-left: 0;
margin: 0;
.settings-language-form { .settings-language-form {
margin-top: 4px; margin-top: 4px;
...@@ -135,7 +135,7 @@ header.global { ...@@ -135,7 +135,7 @@ header.global {
&:last-child { &:last-child {
> a { > a {
padding: ($baseline/5) ($baseline/2); padding: ($baseline/2);
&.shopping-cart { &.shopping-cart {
border-radius: 4px; border-radius: 4px;
...@@ -147,14 +147,19 @@ header.global { ...@@ -147,14 +147,19 @@ header.global {
} }
} }
a.user-link { .user-link {
@include padding(5px, 2px, 10px, 10px); padding: 0;
position: relative; position: relative;
text-transform: none; text-transform: none;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
letter-spacing: 0; letter-spacing: 0;
.user-image-frame {
max-width: ($baseline*2);
border-radius: 10%;
}
.icon { .icon {
display: inline-block; display: inline-block;
@include float(left); @include float(left);
...@@ -163,35 +168,9 @@ header.global { ...@@ -163,35 +168,9 @@ header.global {
color: $m-gray; color: $m-gray;
} }
.avatar { .label-username {
@include float(right);
// CASE: right to left layout @include margin(($baseline*0.75), ($baseline/4), ($baseline*0.75), ($baseline*0.75));
display: inline-block;
@include left(8px);
opacity: 0.5;
overflow: hidden;
top: 4px;
margin-top: 1px;
margin-right: 2px;
@include transition(all 0.15s linear 0s);
width: 19px;
}
div {
margin-top: 3px;
float: right;
margin-left: 4px;
}
div {
margin-top: 3px;
float: right;
margin-left: 4px;
}
&:hover, &:focus {
.avatar {
opacity: 0.8;
}
} }
} }
...@@ -471,7 +450,6 @@ header.global-new { ...@@ -471,7 +450,6 @@ header.global-new {
.user { .user {
@include float(right); @include float(right);
margin-top: 4px;
> .primary { > .primary {
display: block; display: block;
...@@ -489,7 +467,7 @@ header.global-new { ...@@ -489,7 +467,7 @@ header.global-new {
> a { > a {
@include border-radius(0, 4px, 4px, 0); @include border-radius(0, 4px, 4px, 0);
@include border-left(none); @include border-left(none);
padding: ($baseline/5) ($baseline/2); padding: ($baseline/2) ($baseline/2);
&.shopping-cart { &.shopping-cart {
border-radius: 4px; border-radius: 4px;
...@@ -500,14 +478,19 @@ header.global-new { ...@@ -500,14 +478,19 @@ header.global-new {
} }
} }
} }
a.user-link { .user-link {
@include padding(5px, 2px, 10px, 10px); padding: 0;
position: relative; position: relative;
text-transform: none; text-transform: none;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
letter-spacing: 0; letter-spacing: 0;
.user-image-frame {
max-width: ($baseline/2);
border-radius: 10%;
}
.icon { .icon {
display: inline-block; display: inline-block;
@include float(left); @include float(left);
...@@ -516,35 +499,9 @@ header.global-new { ...@@ -516,35 +499,9 @@ header.global-new {
color: $m-gray; color: $m-gray;
} }
.avatar { .label-username {
@include float(right);
// CASE: right to left layout @include margin(($baseline*0.75), ($baseline/4), ($baseline*0.75), ($baseline*0.75));
display: inline-block;
@include left(8px);
opacity: 0.5;
overflow: hidden;
top: 4px;
margin-top: 1px;
margin-right: 2px;
@include transition(all 0.15s linear 0s);
width: 19px;
}
div {
margin-top: 3px;
float: right;
margin-left: 4px;
}
div {
margin-top: 3px;
float: right;
margin-left: 4px;
}
&:hover, &:focus {
.avatar {
opacity: 0.8;
}
} }
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
% endif % endif
% if link and link_text: % if link and link_text:
<span class="date-summary-link"> <span class="date-summary-link">
<a href="${link}">${link_text} <i class="fa fa-arrow-right" aria-hidden="true"></i></a> <a href="${link}">${link_text}</a>
</span> </span>
% endif % endif
</div> </div>
......
...@@ -14,50 +14,55 @@ from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration ...@@ -14,50 +14,55 @@ from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
<%static:css group='style-course'/> <%static:css group='style-course'/>
</%block> </%block>
% if show_enroll_banner: % if show_enroll_banner:
<div class="wrapper-msg urgency-low" id="failed-verification-banner"> <div class="wrapper-msg urgency-low" id="failed-verification-banner">
<div class="msg msg-reverify is-dismissable"> <div class="msg msg-reverify is-dismissable">
<div class="msg-content"> <div class="msg-content">
<h2 class="title">${_("You are not enrolled yet")}</h2> <h2 class="title">${_("You are not enrolled yet")}</h2>
<div class="copy"> <div class="copy">
<p class='enroll-message'> <p class='enroll-message'>
${_(u"You are not currently enrolled in this course. {link_start}Sign up now!{link_end}").format( ${_(u"You are not currently enrolled in this course. {link_start}Sign up now!{link_end}").format(
link_start=u"<a href={}>".format(url_to_enroll), link_start=u"<a href={}>".format(url_to_enroll),
link_end=u"</a>" link_end=u"</a>"
)} )}
</p> </p>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
% endif % endif
<%include file="/courseware/course_navigation.html" args="active_page='info'" /> <%include file="/courseware/course_navigation.html" args="active_page='info'" />
<%block name="js_extra"> <%block name="js_extra">
<script type="text/javascript" src="${static.url('js/jquery.treeview.js')}"></script> <script type="text/javascript" src="${static.url('js/jquery.treeview.js')}"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
$(document).ready(function(){ $(document).ready(function(){
$(".handouts").treeview({collapsed:true, unique:true/*, cookieId: "treeview-book-nav", persist: "cookie"*/}); $(".handouts").treeview({collapsed:true, unique:true/*, cookieId: "treeview-book-nav", persist: "cookie"*/});
}); });
</script> </script>
</%block> </%block>
<%block name="bodyclass">view-in-course view-course-info ${course.css_class or ''}</%block> <%block name="bodyclass">view-in-course view-course-info ${course.css_class or ''}</%block>
<section class="container"> <section class="container">
<div class="home-wrapper">
<section class="home">
<h1 class="page-title">${_("Welcome to {org}'s {course_name}!").format(org=course.id.org, course_name=course.id.course) | h}</h1>
<h2 class="page-subtitle">${course.display_name | h}</h2>
</section>
</div>
<div class="info-wrapper"> <div class="info-wrapper">
% if user.is_authenticated(): % if user.is_authenticated():
<section class="updates"> <section class="updates">
% if studio_url is not None and masquerade and masquerade.role == 'staff': % if studio_url is not None and masquerade and masquerade.role == 'staff':
<div class="wrap-instructor-info studio-view"> <div class="wrap-instructor-info studio-view">
<a class="instructor-info-action" href="${studio_url}"> <a class="instructor-info-action" href="${studio_url}">
${_("View Updates in Studio")} ${_("View Updates in Studio")}
</a> </a>
</div> </div>
% endif % endif
<h1>${_("Course Updates &amp; News")}</h1> <h1>${_("Course Updates and News")}</h1>
${get_course_info_section(request, masquerade_user, course, 'updates')} ${get_course_info_section(request, masquerade_user, course, 'updates')}
</section> </section>
<section aria-label="${_('Handout Navigation')}" class="handouts"> <section aria-label="${_('Handout Navigation')}" class="handouts">
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from microsite_configuration.templatetags.microsite import platform_name
from openedx.core.djangoapps.user_api.accounts.image_helpers import get_profile_image_urls_for_user
# App that handles subdomain specific branding # App that handles subdomain specific branding
from branding import api as branding_api from branding import api as branding_api
# app that handles site status messages # app that handles site status messages
...@@ -76,7 +79,12 @@ site_status_msg = get_site_status_msg(course_id) ...@@ -76,7 +79,12 @@ site_status_msg = get_site_status_msg(course_id)
<li class="primary"> <li class="primary">
<a href="${reverse('dashboard')}" class="user-link"> <a href="${reverse('dashboard')}" class="user-link">
<span class="sr">${_("Dashboard for:")}</span> <span class="sr">${_("Dashboard for:")}</span>
<div>${user.username}</div> <%
username = user.username
profile_image_url = get_profile_image_urls_for_user(user)['medium']
%>
<img class="user-image-frame" src="${profile_image_url}" alt="${_('Profile image for {username}').format(username=username)}">
<div class="label-username">${username}</div>
</a> </a>
</li> </li>
<li class="primary"> <li class="primary">
......
...@@ -6,6 +6,9 @@ from django.core.urlresolvers import reverse ...@@ -6,6 +6,9 @@ from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from lms.djangoapps.ccx.overrides import get_current_ccx from lms.djangoapps.ccx.overrides import get_current_ccx
from microsite_configuration import microsite
from microsite_configuration.templatetags.microsite import platform_name
from openedx.core.djangoapps.user_api.accounts.image_helpers import get_profile_image_urls_for_user
# App that handles subdomain specific branding # App that handles subdomain specific branding
from branding import api as branding_api from branding import api as branding_api
...@@ -101,9 +104,12 @@ site_status_msg = get_site_status_msg(course_id) ...@@ -101,9 +104,12 @@ site_status_msg = get_site_status_msg(course_id)
<li class="primary"> <li class="primary">
<a href="${reverse('dashboard')}" class="user-link"> <a href="${reverse('dashboard')}" class="user-link">
<span class="sr">${_("Dashboard for:")}</span> <span class="sr">${_("Dashboard for:")}</span>
<div> <%
${user.username} username = user.username
</div> profile_image_url = get_profile_image_urls_for_user(user)['medium']
%>
<img class="user-image-frame" src="${profile_image_url}" alt="${_('Profile image for {username}').format(username=username)}">
<div class="label-username">${username}</div>
</a> </a>
</li> </li>
<li class="primary"> <li class="primary">
......
...@@ -538,6 +538,11 @@ class TestAccountAPI(UserAPITestCase): ...@@ -538,6 +538,11 @@ class TestAccountAPI(UserAPITestCase):
verify_change_info(name_change_info[0], old_name, self.user.username, "Donald Duck",) verify_change_info(name_change_info[0], old_name, self.user.username, "Donald Duck",)
verify_change_info(name_change_info[1], "Mickey Mouse", self.user.username, "Donald Duck") verify_change_info(name_change_info[1], "Mickey Mouse", self.user.username, "Donald Duck")
@patch.dict(
'openedx.core.djangoapps.user_api.accounts.image_helpers.PROFILE_IMAGE_SIZES_MAP',
{'full': 50, 'medium': 30, 'small': 10},
clear=True
)
def test_patch_email(self): def test_patch_email(self):
""" """
Test that the user can request an email change through the accounts API. Test that the user can request an email change through the accounts API.
......
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