Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a6da7159
Commit
a6da7159
authored
Apr 27, 2016
by
AlasdairSwan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12221 from edx/alasdair/ECOM-3200-program-card-learner-progress
Adding program progress bar to program cards
parents
625e76a5
cdb05c26
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
286 additions
and
57 deletions
+286
-57
common/test/acceptance/pages/lms/programs.py
+1
-1
lms/static/js/learner_dashboard/collections/program_progress_collection.js
+9
-0
lms/static/js/learner_dashboard/program_list_factory.js
+12
-4
lms/static/js/learner_dashboard/views/certificate_view.js
+3
-1
lms/static/js/learner_dashboard/views/collection_list_view.js
+8
-2
lms/static/js/learner_dashboard/views/program_card_view.js
+61
-3
lms/static/js/spec/learner_dashboard/collection_list_view_spec.js
+25
-3
lms/static/js/spec/learner_dashboard/program_card_view_spec.js
+56
-11
lms/static/sass/base/_variables.scss
+4
-0
lms/static/sass/elements/_program-card.scss
+47
-2
lms/static/sass/views/_program-list.scss
+9
-3
lms/templates/learner_dashboard/empty_programs_list.underscore
+7
-8
lms/templates/learner_dashboard/program_card.underscore
+42
-19
lms/templates/learner_dashboard/programs.html
+2
-0
No files found.
common/test/acceptance/pages/lms/programs.py
View file @
a6da7159
...
@@ -19,4 +19,4 @@ class ProgramListingPage(PageObject):
...
@@ -19,4 +19,4 @@ class ProgramListingPage(PageObject):
@property
@property
def
is_sidebar_present
(
self
):
def
is_sidebar_present
(
self
):
"""Check whether sidebar is present."""
"""Check whether sidebar is present."""
return
self
.
q
(
css
=
'.sidebar'
)
.
present
return
self
.
q
(
css
=
'.sidebar'
)
.
present
and
self
.
q
(
css
=
'.certificates-list'
)
.
present
lms/static/js/learner_dashboard/collections/program_progress_collection.js
0 → 100644
View file @
a6da7159
(
function
(
define
)
{
'use strict'
;
define
([
'backbone'
],
function
(
Backbone
)
{
return
Backbone
.
Collection
.
extend
({});
});
}).
call
(
this
,
define
||
RequireJS
.
define
);
lms/static/js/learner_dashboard/program_list_factory.js
View file @
a6da7159
...
@@ -5,15 +5,23 @@
...
@@ -5,15 +5,23 @@
'js/learner_dashboard/views/collection_list_view'
,
'js/learner_dashboard/views/collection_list_view'
,
'js/learner_dashboard/views/sidebar_view'
,
'js/learner_dashboard/views/sidebar_view'
,
'js/learner_dashboard/views/program_card_view'
,
'js/learner_dashboard/views/program_card_view'
,
'js/learner_dashboard/collections/program_collection'
'js/learner_dashboard/collections/program_collection'
,
'js/learner_dashboard/collections/program_progress_collection'
],
],
function
(
CollectionListView
,
SidebarView
,
ProgramCardView
,
ProgramCollection
)
{
function
(
CollectionListView
,
SidebarView
,
ProgramCardView
,
ProgramCollection
,
ProgressCollection
)
{
return
function
(
options
)
{
return
function
(
options
)
{
var
progressCollection
=
new
ProgressCollection
();
if
(
options
.
userProgress
)
{
progressCollection
.
set
(
options
.
userProgress
);
options
.
progressCollection
=
progressCollection
;
}
new
CollectionListView
({
new
CollectionListView
({
el
:
'.program-cards-container'
,
el
:
'.program-cards-container'
,
childView
:
ProgramCardView
,
childView
:
ProgramCardView
,
co
ntext
:
options
,
co
llection
:
new
ProgramCollection
(
options
.
programsData
)
,
co
llection
:
new
ProgramCollection
(
options
.
programsData
)
co
ntext
:
options
}).
render
();
}).
render
();
new
SidebarView
({
new
SidebarView
({
...
...
lms/static/js/learner_dashboard/views/certificate_view.js
View file @
a6da7159
...
@@ -21,7 +21,9 @@
...
@@ -21,7 +21,9 @@
this
.
render
();
this
.
render
();
},
},
render
:
function
()
{
render
:
function
()
{
if
(
this
.
context
.
certificatesData
.
length
>
0
)
{
var
certificatesData
=
this
.
context
.
certificatesData
||
[];
if
(
certificatesData
.
length
)
{
this
.
$el
.
html
(
this
.
tpl
(
this
.
context
));
this
.
$el
.
html
(
this
.
tpl
(
this
.
context
));
}
}
}
}
...
...
lms/static/js/learner_dashboard/views/collection_list_view.js
View file @
a6da7159
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
gettext
,
gettext
,
emptyProgramsListTpl
)
{
emptyProgramsListTpl
)
{
return
Backbone
.
View
.
extend
({
return
Backbone
.
View
.
extend
({
initialize
:
function
(
data
)
{
initialize
:
function
(
data
)
{
this
.
childView
=
data
.
childView
;
this
.
childView
=
data
.
childView
;
this
.
context
=
data
.
context
;
this
.
context
=
data
.
context
;
...
@@ -29,10 +30,15 @@
...
@@ -29,10 +30,15 @@
}
}
}
else
{
}
else
{
childList
=
[];
childList
=
[];
this
.
collection
.
each
(
function
(
program
)
{
var
child
=
new
this
.
childView
({
model
:
program
});
this
.
collection
.
each
(
function
(
model
)
{
var
child
=
new
this
.
childView
({
model
:
model
,
context
:
this
.
context
});
childList
.
push
(
child
.
el
);
childList
.
push
(
child
.
el
);
},
this
);
},
this
);
this
.
$el
.
html
(
childList
);
this
.
$el
.
html
(
childList
);
}
}
}
}
...
...
lms/static/js/learner_dashboard/views/program_card_view.js
View file @
a6da7159
...
@@ -20,19 +20,45 @@
...
@@ -20,19 +20,45 @@
className
:
'program-card'
,
className
:
'program-card'
,
attributes
:
function
()
{
return
{
'aria-labelledby'
:
'program-'
+
this
.
model
.
get
(
'id'
),
'role'
:
'group'
};
},
tpl
:
_
.
template
(
programCardTpl
),
tpl
:
_
.
template
(
programCardTpl
),
initialize
:
function
()
{
initialize
:
function
(
data
)
{
this
.
progressCollection
=
data
.
context
.
progressCollection
;
if
(
this
.
progressCollection
)
{
this
.
progressModel
=
this
.
progressCollection
.
findWhere
({
programId
:
this
.
model
.
get
(
'id'
)
});
}
this
.
render
();
this
.
render
();
},
},
render
:
function
()
{
render
:
function
()
{
var
templated
=
this
.
tpl
(
this
.
model
.
toJSON
());
var
orgList
=
_
.
map
(
this
.
model
.
get
(
'organizations'
),
function
(
org
)
{
this
.
$el
.
html
(
templated
);
return
gettext
(
org
.
key
);
}),
data
=
$
.
extend
(
this
.
model
.
toJSON
(),
this
.
getProgramProgress
(),
{
orgList
:
orgList
.
join
(
' '
)}
);
this
.
$el
.
html
(
this
.
tpl
(
data
));
this
.
postRender
();
this
.
postRender
();
},
},
postRender
:
function
()
{
postRender
:
function
()
{
// Add describedby to parent only if progess is present
if
(
this
.
progressModel
)
{
this
.
$el
.
attr
(
'aria-describedby'
,
'status-'
+
this
.
model
.
get
(
'id'
));
}
if
(
navigator
.
userAgent
.
indexOf
(
'MSIE'
)
!==
-
1
||
if
(
navigator
.
userAgent
.
indexOf
(
'MSIE'
)
!==
-
1
||
navigator
.
appVersion
.
indexOf
(
'Trident/'
)
>
0
){
navigator
.
appVersion
.
indexOf
(
'Trident/'
)
>
0
){
/* Microsoft Internet Explorer detected in. */
/* Microsoft Internet Explorer detected in. */
...
@@ -42,6 +68,38 @@
...
@@ -42,6 +68,38 @@
}
}
},
},
// Calculate counts for progress and percentages for styling
getProgramProgress
:
function
()
{
var
progress
=
this
.
progressModel
?
this
.
progressModel
.
toJSON
()
:
false
;
if
(
progress
)
{
progress
.
total
=
{
completed
:
progress
.
completed
.
length
,
in_progress
:
progress
.
in_progress
.
length
,
not_started
:
progress
.
not_started
.
length
};
progress
.
total
.
courses
=
progress
.
total
.
completed
+
progress
.
total
.
in_progress
+
progress
.
total
.
not_started
;
progress
.
percentage
=
{
completed
:
this
.
getWidth
(
progress
.
total
.
completed
,
progress
.
total
.
courses
),
in_progress
:
this
.
getWidth
(
progress
.
total
.
in_progress
,
progress
.
total
.
courses
)
};
}
return
{
progress
:
progress
};
},
getWidth
:
function
(
val
,
total
)
{
var
int
=
(
val
/
total
)
*
100
;
return
int
+
'%'
;
},
// Defer loading the rest of the page to limit FOUC
// Defer loading the rest of the page to limit FOUC
reLoadBannerImage
:
function
()
{
reLoadBannerImage
:
function
()
{
var
$img
=
this
.
$
(
'.program_card .banner-image'
),
var
$img
=
this
.
$
(
'.program_card .banner-image'
),
...
...
lms/static/js/spec/learner_dashboard/collection_list_view_spec.js
View file @
a6da7159
...
@@ -3,8 +3,10 @@ define([
...
@@ -3,8 +3,10 @@ define([
'jquery'
,
'jquery'
,
'js/learner_dashboard/views/program_card_view'
,
'js/learner_dashboard/views/program_card_view'
,
'js/learner_dashboard/collections/program_collection'
,
'js/learner_dashboard/collections/program_collection'
,
'js/learner_dashboard/views/collection_list_view'
'js/learner_dashboard/views/collection_list_view'
,
],
function
(
Backbone
,
$
,
ProgramCardView
,
ProgramCollection
,
CollectionListView
)
{
'js/learner_dashboard/collections/program_progress_collection'
],
function
(
Backbone
,
$
,
ProgramCardView
,
ProgramCollection
,
CollectionListView
,
ProgressCollection
)
{
'use strict'
;
'use strict'
;
/*jslint maxlen: 500 */
/*jslint maxlen: 500 */
...
@@ -12,6 +14,7 @@ define([
...
@@ -12,6 +14,7 @@ define([
describe
(
'Collection List View'
,
function
()
{
describe
(
'Collection List View'
,
function
()
{
var
view
=
null
,
var
view
=
null
,
programCollection
,
programCollection
,
progressCollection
,
context
=
{
context
=
{
programsData
:[
programsData
:[
{
{
...
@@ -58,16 +61,35 @@ define([
...
@@ -58,16 +61,35 @@ define([
w726h242
:
'http://www.edx.org/images/org2/test3'
w726h242
:
'http://www.edx.org/images/org2/test3'
}
}
}
}
],
userProgress
:
[
{
programId
:
146
,
completed
:
[
'courses'
,
'the'
,
'user'
,
'completed'
],
in_progress
:
[
'in'
,
'progress'
],
not_started
:
[
'courses'
,
'not'
,
'yet'
,
'started'
]
},
{
programId
:
147
,
completed
:
[
'Course 1'
],
in_progress
:
[],
not_started
:
[
'Course 2'
,
'Course 3'
,
'Course 4'
]
}
]
]
};
};
beforeEach
(
function
()
{
beforeEach
(
function
()
{
setFixtures
(
'<div class="program-cards-container"></div>'
);
setFixtures
(
'<div class="program-cards-container"></div>'
);
programCollection
=
new
ProgramCollection
(
context
.
programsData
);
programCollection
=
new
ProgramCollection
(
context
.
programsData
);
progressCollection
=
new
ProgressCollection
();
progressCollection
.
set
(
context
.
userProgress
);
context
.
progressCollection
=
progressCollection
;
view
=
new
CollectionListView
({
view
=
new
CollectionListView
({
el
:
'.program-cards-container'
,
el
:
'.program-cards-container'
,
childView
:
ProgramCardView
,
childView
:
ProgramCardView
,
collection
:
programCollection
collection
:
programCollection
,
context
:
context
});
});
view
.
render
();
view
.
render
();
});
});
...
...
lms/static/js/spec/learner_dashboard/program_card_view_spec.js
View file @
a6da7159
define
([
define
([
'backbone'
,
'backbone'
,
'jquery'
,
'jquery'
,
'js/learner_dashboard/views/program_card_view'
,
'js/learner_dashboard/collections/program_progress_collection'
,
'js/learner_dashboard/models/program_model'
'js/learner_dashboard/models/program_model'
,
],
function
(
Backbone
,
$
,
ProgramCardView
,
ProgramModel
)
{
'js/learner_dashboard/views/program_card_view'
],
function
(
Backbone
,
$
,
ProgressCollection
,
ProgramModel
,
ProgramCardView
)
{
'use strict'
;
'use strict'
;
/*jslint maxlen: 500 */
/*jslint maxlen: 500 */
...
@@ -33,13 +34,39 @@ define([
...
@@ -33,13 +34,39 @@ define([
w435h145
:
'http://www.edx.org/images/test2'
,
w435h145
:
'http://www.edx.org/images/test2'
,
w726h242
:
'http://www.edx.org/images/test3'
w726h242
:
'http://www.edx.org/images/test3'
}
}
},
userProgress
=
[
{
programId
:
146
,
completed
:
[
'courses'
,
'the'
,
'user'
,
'completed'
],
in_progress
:
[
'in'
,
'progress'
],
not_started
:
[
'courses'
,
'not'
,
'yet'
,
'started'
]
},
{
programId
:
147
,
completed
:
[
'Course 1'
],
in_progress
:
[],
not_started
:
[
'Course 2'
,
'Course 3'
,
'Course 4'
]
}
],
progressCollection
=
new
ProgressCollection
(),
cardRenders
=
function
(
$card
)
{
expect
(
$card
).
toBeDefined
();
expect
(
$card
.
find
(
'.title'
).
html
().
trim
()).
toEqual
(
program
.
name
);
expect
(
$card
.
find
(
'.category span'
).
html
().
trim
()).
toEqual
(
'XSeries Program'
);
expect
(
$card
.
find
(
'.organization'
).
html
().
trim
()).
toEqual
(
program
.
organizations
[
0
].
key
);
expect
(
$card
.
find
(
'.card-link'
).
attr
(
'href'
)).
toEqual
(
program
.
marketing_url
);
};
};
beforeEach
(
function
()
{
beforeEach
(
function
()
{
setFixtures
(
'<div class="program-card"></div>'
);
setFixtures
(
'<div class="program-card"></div>'
);
programModel
=
new
ProgramModel
(
program
);
programModel
=
new
ProgramModel
(
program
);
progressCollection
.
set
(
userProgress
);
view
=
new
ProgramCardView
({
view
=
new
ProgramCardView
({
model
:
programModel
model
:
programModel
,
context
:
{
progressCollection
:
progressCollection
}
});
});
});
});
...
@@ -51,13 +78,8 @@ define([
...
@@ -51,13 +78,8 @@ define([
expect
(
view
).
toBeDefined
();
expect
(
view
).
toBeDefined
();
});
});
it
(
'should load the program-cards based on passed in context'
,
function
()
{
it
(
'should load the program-card based on passed in context'
,
function
()
{
var
$cards
=
view
.
$el
;
cardRenders
(
view
.
$el
);
expect
(
$cards
).
toBeDefined
();
expect
(
$cards
.
find
(
'.title'
).
html
().
trim
()).
toEqual
(
program
.
name
);
expect
(
$cards
.
find
(
'.category span'
).
html
().
trim
()).
toEqual
(
'XSeries Program'
);
expect
(
$cards
.
find
(
'.organization'
).
html
().
trim
()).
toEqual
(
program
.
organizations
[
0
].
key
);
expect
(
$cards
.
find
(
'.card-link'
).
attr
(
'href'
)).
toEqual
(
program
.
marketing_url
);
});
});
it
(
'should call reEvaluatePicture if reLoadBannerImage is called'
,
function
(){
it
(
'should call reEvaluatePicture if reLoadBannerImage is called'
,
function
(){
...
@@ -75,6 +97,29 @@ define([
...
@@ -75,6 +97,29 @@ define([
expect
(
view
.
reLoadBannerImage
).
not
.
toThrow
(
'Picturefill had exceptions'
);
expect
(
view
.
reLoadBannerImage
).
not
.
toThrow
(
'Picturefill had exceptions'
);
});
});
it
(
'should calculate the correct percentages for progress bars'
,
function
()
{
expect
(
view
.
$
(
'.complete'
).
css
(
'width'
)).
toEqual
(
'40%'
);
expect
(
view
.
$
(
'.in-progress'
).
css
(
'width'
)).
toEqual
(
'20%'
);
});
it
(
'should display the correct completed courses message'
,
function
()
{
var
program
=
_
.
findWhere
(
userProgress
,
{
programId
:
146
}),
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.'
);
});
it
(
'should render cards if there is no progressData'
,
function
()
{
view
.
remove
();
view
=
new
ProgramCardView
({
model
:
programModel
,
context
:
{}
});
cardRenders
(
view
.
$el
);
expect
(
view
.
$
(
'.progress'
).
length
).
toEqual
(
0
);
});
});
});
}
}
);
);
lms/static/sass/base/_variables.scss
View file @
a6da7159
...
@@ -306,6 +306,10 @@ $credit-color-base: rgb(244,195,0); // accessible with black text
...
@@ -306,6 +306,10 @@ $credit-color-base: rgb(244,195,0); // accessible with black text
// edx-specific: Studio/Staff actions
// edx-specific: Studio/Staff actions
$staff-color
:
$pink
;
$staff-color
:
$pink
;
// from the edX Pattern Library
$x-light
:
#E5E9EB
;
$success-dark
:
#1E8142
;
$warning-base
:
#FDBC56
;
// ----------------------------
// ----------------------------
// #TYPOGRAPHY
// #TYPOGRAPHY
...
...
lms/static/sass/elements/_program-card.scss
View file @
a6da7159
...
@@ -6,11 +6,12 @@
...
@@ -6,11 +6,12 @@
.program-card
{
.program-card
{
@include
span-columns
(
12
);
@include
span-columns
(
12
);
border
:
1px
solid
$border-color-l3
;
border
:
1px
solid
$border-color-l3
;
border-bottom
:
none
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
$baseline
;
margin-bottom
:
$baseline
;
margin-bottom
:
$baseline
;
position
:
relative
;
position
:
relative
;
display
:
inline
;
display
:
inline
;
.card-link
{
.card-link
{
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
...
@@ -38,24 +39,34 @@
...
@@ -38,24 +39,34 @@
}
}
}
}
}
}
.text-section
{
.text-section
{
padding
:
40px
$baseline
$baseline
;
margin-top
:
106px
;
margin-top
:
106px
;
position
:
relative
;
.meta-info
{
.meta-info
{
@include
outer-container
;
@include
outer-container
;
margin-bottom
:
$baseline
*
0
.25
;
font-size
:
em
(
12
);
font-size
:
em
(
12
);
color
:
$gray
;
color
:
$gray
;
position
:
absolute
;
top
:
$baseline
;
width
:
calc
(
100%
-
40px
);
.organization
{
.organization
{
@include
span-columns
(
6
);
@include
span-columns
(
6
);
white-space
:
nowrap
;
white-space
:
nowrap
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.category
{
.category
{
@include
span-columns
(
6
);
@include
span-columns
(
6
);
text-align
:
right
;
text-align
:
right
;
.category-text
{
.category-text
{
@include
float
(
right
);
@include
float
(
right
);
}
}
.xseries-icon
{
.xseries-icon
{
@include
float
(
right
);
@include
float
(
right
);
@include
margin-right
(
$baseline
*
0
.25
);
@include
margin-right
(
$baseline
*
0
.25
);
...
@@ -67,24 +78,52 @@
...
@@ -67,24 +78,52 @@
}
}
}
}
}
}
.title
{
.title
{
@extend
%t-title4
;
font-size
:
em
(
24
);
font-size
:
em
(
24
);
color
:
$gray-d2
;
color
:
$gray-d2
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
line-height
:
1
.2
;
line-height
:
1
.2
;
}
}
}
}
.certificate-status
{
font-size
:
em
(
12
);
color
:
$gray
;
}
.progress
{
height
:
5px
;
background
:
$x-light
;
.bar
{
height
:
100%
;
position
:
relative
;
float
:
left
;
&
.complete
{
background
:
$success-dark
;
}
&
.in-progress
{
background
:
$warning-base
;
}
}
}
}
}
@include
media
(
$bp-small
)
{
@include
media
(
$bp-small
)
{
.program-card
{
.program-card
{
@include
omega
(
n
);
@include
omega
(
n
);
@include
span-columns
(
4
);
@include
span-columns
(
4
);
.card-link
{
.card-link
{
.banner-image-container
{
.banner-image-container
{
height
:
166px
;
height
:
166px
;
}
}
}
}
.text-section
{
.text-section
{
margin-top
:
156px
;
margin-top
:
156px
;
}
}
...
@@ -96,11 +135,13 @@
...
@@ -96,11 +135,13 @@
.program-card
{
.program-card
{
@include
omega
(
n
);
@include
omega
(
n
);
@include
span-columns
(
8
);
@include
span-columns
(
8
);
.card-link
{
.card-link
{
.banner-image-container
{
.banner-image-container
{
height
:
242px
;
height
:
242px
;
}
}
}
}
.text-section
{
.text-section
{
margin-top
:
232px
;
margin-top
:
232px
;
}
}
...
@@ -113,11 +154,13 @@
...
@@ -113,11 +154,13 @@
.program-card
{
.program-card
{
@include
omega
(
2n
);
@include
omega
(
2n
);
@include
span-columns
(
6
);
@include
span-columns
(
6
);
.card-link
{
.card-link
{
.banner-image-container
{
.banner-image-container
{
height
:
116px
;
height
:
116px
;
}
}
}
}
.text-section
{
.text-section
{
margin-top
:
106px
;
margin-top
:
106px
;
}
}
...
@@ -128,11 +171,13 @@
...
@@ -128,11 +171,13 @@
.program-card
{
.program-card
{
@include
omega
(
2n
);
@include
omega
(
2n
);
@include
span-columns
(
6
);
@include
span-columns
(
6
);
.card-link
{
.card-link
{
.banner-image-container
{
.banner-image-container
{
height
:
145px
;
height
:
145px
;
}
}
}
}
.text-section
{
.text-section
{
margin-top
:
135px
;
margin-top
:
135px
;
}
}
...
...
lms/static/sass/views/_program-list.scss
View file @
a6da7159
...
@@ -99,11 +99,17 @@ $pl-button-color: #0079bc;
...
@@ -99,11 +99,17 @@ $pl-button-color: #0079bc;
padding
:
(
$baseline
*
2
)
0
;
padding
:
(
$baseline
*
2
)
0
;
text-align
:
center
;
text-align
:
center
;
p
{
.text
{
@include
font-size
(
24
);
@include
font-size
(
24
);
color
:
$lighter-base-font-color
;
margin
:
{
margin-bottom
:
$baseline
;
top
:
0
;
bottom
:
$baseline
;
}
text-shadow
:
0
1px
rgba
(
255
,
255
,
255
,
0
.6
);
text-shadow
:
0
1px
rgba
(
255
,
255
,
255
,
0
.6
);
text-transform
:
none
;
font-family
:
$sans-serif
;
letter-spacing
:
initial
;
color
:
$black
;
}
}
a
{
a
{
...
...
lms/templates/learner_dashboard/empty_programs_list.underscore
View file @
a6da7159
<section class="empty-programs-message">
<section class="empty-programs-message">
<h2 class="text"><%- gettext('You are not enrolled in any XSeries Programs yet.') %></h2>
<p><%- gettext('You are not enrolled in any XSeries Programs yet.') %></p>
<a class="find-xseries-programs" href="<%- xseriesUrl %>">
<a class="find-xseries-programs" href="<%- xseriesUrl %>">
<span class="action-xseries-icon" aria-hidden="true"></span>
<i class="action-xseries-icon" aria-hidden="true"></i>
<span><%- gettext('Explore XSeries Programs') %></span>
<span><%- gettext('Explore XSeries Programs') %></span>
</a>
</a>
</section>
</section>
lms/templates/learner_dashboard/program_card.underscore
View file @
a6da7159
<div class="text-section">
<h3 id="program-<%- id %>" class="title"><%- gettext(name) %></h3>
<div class="meta-info">
<div class="organization"><%- orgList %></div>
<div class="category">
<span class="category-text"><%- gettext(type) %></span>
<span class="xseries-icon" aria-hidden="true"></span>
</div>
</div>
<% if (progress) { %>
<p id="status-<%- id %>" class="certificate-status"><%= 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
) %></p>
<% } %>
</div>
<% if (progress) { %>
<div class="progress">
<div class="bar complete" style="width:<%- progress.percentage.completed %>;"></div>
<div class="bar in-progress" style="width:<%- progress.percentage.in_progress %>;">
<span class="sr"><%= interpolate(
ngettext(
'%(count)s course are in progress.',
'%(count)s courses are in progress.',
progress.total.in_progress
),
{count: progress.total.in_progress}, true
) %></span>
</div>
<div class="bar not-started">
<span class="sr"><%= 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
) %></span>
</div>
</div>
<% } %>
<a href="<%- marketingUrl %>" class="card-link">
<a href="<%- marketingUrl %>" class="card-link">
<div class="banner-image-container">
<div class="banner-image-container">
<picture>
<picture>
...
@@ -6,25 +47,7 @@
...
@@ -6,25 +47,7 @@
<source srcset="<%- mediumBannerUrl %>" media="(max-width: <%- breakpoints.max.small %>)">
<source srcset="<%- mediumBannerUrl %>" media="(max-width: <%- breakpoints.max.small %>)">
<source srcset="<%- largeBannerUrl %>" media="(max-width: <%- breakpoints.max.medium %>)">
<source srcset="<%- largeBannerUrl %>" media="(max-width: <%- breakpoints.max.medium %>)">
<source srcset="<%- smallBannerUrl %>" media="(max-width: <%- breakpoints.max.large %>)">
<source srcset="<%- smallBannerUrl %>" media="(max-width: <%- breakpoints.max.large %>)">
<img class="banner-image" srcset="<%- mediumBannerUrl %>" alt="<%
- gettext(nam
e)%>">
<img class="banner-image" srcset="<%- mediumBannerUrl %>" alt="<%
= interpolate(gettext('Learn more about %(programName)s.'), {programName: name}, tru
e)%>">
</picture>
</picture>
</div>
</div>
</a>
</a>
<div class="text-section">
<div class="meta-info">
<div class="organization">
<% _.each(organizations, function(org){ %>
<%- gettext(org.key) %>
<% }); %>
</div>
<div class="category">
<span class="category-text"><%- gettext(type) %></span>
<i class="xseries-icon" aria-hidden="true"></i>
</div>
</div>
<div class="title" aria-hidden="true">
<%- gettext(name) %>
</div>
</div>
<div class="progress">
</div>
lms/templates/learner_dashboard/programs.html
View file @
a6da7159
...
@@ -21,8 +21,10 @@ ProgramListFactory({
...
@@ -21,8 +21,10 @@ ProgramListFactory({
</
%
block>
</
%
block>
<
%
block
name=
"pagetitle"
>
${_("Programs")}
</
%
block>
<
%
block
name=
"pagetitle"
>
${_("Programs")}
</
%
block>
<main
id=
"main"
aria-label=
"Content"
tabindex=
"-1"
>
<main
id=
"main"
aria-label=
"Content"
tabindex=
"-1"
>
<div
class=
"program-list-wrapper"
>
<div
class=
"program-list-wrapper"
>
<h2
class=
"sr"
>
${_("Your Programs")}
</h2>
<div
class=
"program-cards-container"
></div>
<div
class=
"program-cards-container"
></div>
<div
class=
"sidebar"
></div>
<div
class=
"sidebar"
></div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment