Commit db9037bc by Zubair Afzal

Merge pull request #12104 from…

Merge pull request #12104 from edx/tasawer/story/ecom-3201-handle-empty-list-of-courses-and-programs

Updated dashboard UI for empty list of courses and programs
parents 5f572dfc 628843f6
......@@ -499,11 +499,11 @@ class DashboardTest(ModuleStoreTestCase):
self.client.login(username="jack", password="test")
response = self.client.get(reverse("dashboard"))
# "Find courses" is shown in the side panel
self.assertContains(response, "Find courses")
# "Explore courses" is shown in the side panel
self.assertContains(response, "Explore courses")
# But other links are hidden in the navigation
self.assertNotContains(response, "How it Works")
self.assertNotContains(response, "How it works")
self.assertNotContains(response, "Schools & Partners")
def test_course_mode_info_with_honor_enrollment(self):
......
......@@ -212,61 +212,94 @@
}
}
// +Dashboard - Course Listing
// ====================
.dashboard {
.my-courses {
.xseries-epmty-section{
@include float(left);
margin: 0;
width: flex-grid(9);
.wrapper-header-courses {
border-bottom: 4px solid $border-color-l4;
margin-bottom: $baseline;
.header-courses {
@extend %t-title5;
@include padding-right($baseline/2);
}
}
// CASE: empty dashboard
@include outer-container;
@include span-columns(9);
}
// CASE: empty dashboard
.empty-dashboard-message {
border: 3px solid $gray-l4;
background: $gray-l6;
padding: ($baseline*2) 0;
text-align: center;
p {
@include font-size(24);
color: $lighter-base-font-color;
font-style: italic;
margin-bottom: $baseline;
text-shadow: 0 1px rgba(255,255,255, 0.6);
}
a {
background: rgb(240,240,240);
@include background-image($button-bg-image);
background-color: $button-bg-color;
border: 1px solid $border-color-2;
border-radius: 4px;
background-color: $blue;
border: 1px solid $blue;
box-shadow: 0 1px 8px 0 $shadow-l1;
@include box-sizing(border-box);
color: $base-font-color;
color: $white;
font-family: $sans-serif;
display: inline-block;
letter-spacing: 1px;
@include margin-left($baseline/4);
padding: 5px 10px;
text-shadow: 0 1px rgba(255,255,255, 0.6);
margin-top: ($baseline/4);
margin-left: ($baseline/4);
padding: 15px 20px;
&:hover, &:focus {
color: $link-color;
background: $blue-l2;
text-decoration: none;
}
}
.find-xseries-programs {
@extend %btn-pl-black-base;
.action-xseries-icon {
@include float(left);
display: inline;
@include margin-right($baseline*0.4);
background: url('#{$static-path}/images/icon-sm-xseries-white.png') no-repeat;
background-color: transparent;
width: ($baseline*1.1);
height: ($baseline*1.1);
}
&:hover,
&:focus {
.action-xseries-icon {
@include float(left);
display: inline;
@include margin-right($baseline*0.4);
background: url('#{$static-path}/images/icon-sm-xseries-black.png') no-repeat;
background-color: transparent;
width: ($baseline*1.1);
height: ($baseline*1.1);
}
}
}
}
// ====================
// +Dashboard - Course Listing
// ====================
.dashboard {
.my-courses {
@include float(left);
margin: 0;
width: flex-grid(9);
.wrapper-header-courses {
border-bottom: 4px solid $border-color-l4;
margin-bottom: $baseline;
.header-courses {
@extend %t-title5;
@include padding-right($baseline/2);
}
}
// UI: course list
.listing-courses {
......
......@@ -103,12 +103,13 @@ from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_str
</ul>
% else:
<section class="empty-dashboard-message">
<p>${_("Looks like you haven't enrolled in any courses yet.")}</p>
<p>${_("You are not enrolled in any courses yet.")}</p>
% if settings.FEATURES.get('COURSES_ARE_BROWSABLE'):
<a href="${marketing_link('COURSES')}">
${_("Find courses now!")}
${_("Explore courses")}
</a>
%endif
</section>
% endif
......
......@@ -20,6 +20,17 @@ ProgramListFactory({
<%block name="pagetitle">${_("Programs")}</%block>
<div class="program-list-wrapper">
<div class="program-cards-container"></div>
% if not len(programs):
<div class="xseries-epmty-section">
<section class="empty-dashboard-message">
<p>${_("You are not enrolled in any XSeries Programs yet.")}</p>
<a class="find-xseries-programs" href="${xseries_url}"><i class="action-xseries-icon" aria-hidden="true"></i>
${_("Explore XSeries Programs")}
</a>
</section>
</div>
% else:
<div class="program-cards-container"></div>
% endif
<div class="sidebar"></div>
</div>
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