diff --git a/lms/static/js/spec/learner_dashboard/program_card_view_spec.js b/lms/static/js/spec/learner_dashboard/program_card_view_spec.js index c43f89f064..34b95c2cc3 100644 --- a/lms/static/js/spec/learner_dashboard/program_card_view_spec.js +++ b/lms/static/js/spec/learner_dashboard/program_card_view_spec.js @@ -108,7 +108,7 @@ define([ completed = program.completed.length, total = completed + program.in_progress.length + program.not_started.length; - expect(view.$('.certificate-status').html()).toEqual('You have earned certificates in ' + completed + ' of the ' + total + ' courses so far.'); + expect(view.$('.certificate-status .status-text').not('.secondary').html()).toEqual('You have earned certificates in ' + completed + ' of the ' + total + ' courses so far.'); }); it('should render cards if there is no progressData', function() { diff --git a/lms/static/sass/elements/_program-card.scss b/lms/static/sass/elements/_program-card.scss index 430f20cf59..e46cfafce9 100644 --- a/lms/static/sass/elements/_program-card.scss +++ b/lms/static/sass/elements/_program-card.scss @@ -3,6 +3,14 @@ @import '../base/grid-settings'; @import 'neat/neat'; // lib - Neat +%hide-until-focus { + @include left(0); + display: inline-block; + position: absolute; + top: -($baseline*30); + overflow: hidden; +} + .program-card{ @include span-columns(12); border: 1px solid $border-color-l3; @@ -13,11 +21,11 @@ display: inline; .card-link{ + @include left(0); position: absolute; top: 0; bottom: 0; right: 0; - left: 0; border: 0; z-index: 1; opacity: 0.8; @@ -25,14 +33,16 @@ &:focus{ opacity: 1; } + .banner-image-container{ position: relative; overflow: hidden; height: 116px; + .banner-image{ + @include left(50%); position: absolute; top: 0; - left: 50%; z-index: 0; transform: translate(-50%, 0); min-height: 100%; @@ -89,8 +99,30 @@ } .certificate-status { - font-size: em(12); - color: $gray; + .status-text { + font-size: em(12); + color: $gray; + } + + .secondary { + @extend %hide-until-focus; + } + + .status-text { + &:focus, + &:active { + position: relative; + top: auto; + width: auto; + height: auto; + margin: 0; + text-decoration: none; + + & ~ .status-text { + @extend %hide-until-focus; + } + } + } } .progress { @@ -98,9 +130,9 @@ background: $x-light; .bar { + @include float(left); height: 100%; position: relative; - float: left; &.complete { background: $success-dark; diff --git a/lms/templates/learner_dashboard/program_card.underscore b/lms/templates/learner_dashboard/program_card.underscore index 8a1e0be567..1d1e7fd0ac 100644 --- a/lms/templates/learner_dashboard/program_card.underscore +++ b/lms/templates/learner_dashboard/program_card.underscore @@ -9,35 +9,37 @@ <% if (progress) { %> -

<%= interpolate( - gettext('You have earned certificates in %(completed_courses)s of the %(total_courses)s courses so far.'), - {completed_courses: progress.total.completed, total_courses: progress.total.courses}, true - ) %>

+

+ <%= interpolate( + ngettext( + '%(count)s course is in progress.', + '%(count)s courses are in progress.', + progress.total.in_progress + ), + {count: progress.total.in_progress}, true + ) %> + + <%= interpolate( + ngettext( + '%(count)s course has not been started.', + '%(count)s courses have not been started.', + progress.total.not_started + ), + {count: progress.total.not_started}, true + ) %> + + <%= interpolate( + gettext('You have earned certificates in %(completed_courses)s of the %(total_courses)s courses so far.'), + {completed_courses: progress.total.completed, total_courses: progress.total.courses}, true + ) %> +

<% } %> <% if (progress) { %>
-
- <%= interpolate( - ngettext( - '%(count)s course are in progress.', - '%(count)s courses are in progress.', - progress.total.in_progress - ), - {count: progress.total.in_progress}, true - ) %> -
-
- <%= interpolate( - ngettext( - '%(count)s course have not been started.', - '%(count)s courses have not been started.', - progress.total.not_started - ), - {count: progress.total.not_started}, true - ) %> -
+
+
<% } %>