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
4a015f5f
Commit
4a015f5f
authored
Apr 14, 2016
by
AlasdairSwan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12126 from edx/alasdair/ECOM-3986-program-list-page-eventing
Update the program listing page sidebar approach
parents
2429a7c2
1c3868ef
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
17 deletions
+74
-17
lms/static/js/learner_dashboard/views/explore_new_programs_view.js
+44
-0
lms/static/js/learner_dashboard/views/program_card_view.js
+6
-0
lms/static/js/learner_dashboard/views/sidebar_view.js
+12
-3
lms/static/js/spec/learner_dashboard/sidebar_view_spec.js
+1
-1
lms/templates/learner_dashboard/explore_new_programs.underscore
+9
-0
lms/templates/learner_dashboard/sidebar.underscore
+2
-13
No files found.
lms/static/js/learner_dashboard/views/explore_new_programs_view.js
0 → 100644
View file @
4a015f5f
;(
function
(
define
)
{
'use strict'
;
define
([
'backbone'
,
'jquery'
,
'underscore'
,
'gettext'
,
'text!../../../templates/learner_dashboard/explore_new_programs.underscore'
],
function
(
Backbone
,
$
,
_
,
gettext
,
exploreTpl
)
{
return
Backbone
.
View
.
extend
({
el
:
'.program-advertise'
,
tpl
:
_
.
template
(
exploreTpl
),
initialize
:
function
(
data
)
{
this
.
context
=
data
.
context
;
this
.
$parentEl
=
$
(
this
.
parentEl
);
if
(
this
.
context
.
xseriesUrl
){
// Only render if there is an XSeries link
this
.
render
();
}
else
{
/**
* If not rendering remove el because
* styles are applied to it
*/
this
.
remove
();
}
},
render
:
function
()
{
this
.
$el
.
html
(
this
.
tpl
(
this
.
context
));
}
});
}
);
}).
call
(
this
,
define
||
RequireJS
.
define
);
lms/static/js/learner_dashboard/views/program_card_view.js
View file @
4a015f5f
...
...
@@ -17,16 +17,21 @@
picturefill
)
{
return
Backbone
.
View
.
extend
({
className
:
'program-card'
,
tpl
:
_
.
template
(
programCardTpl
),
initialize
:
function
()
{
this
.
render
();
},
render
:
function
()
{
var
templated
=
this
.
tpl
(
this
.
model
.
toJSON
());
this
.
$el
.
html
(
templated
);
this
.
postRender
();
},
postRender
:
function
()
{
if
(
navigator
.
userAgent
.
indexOf
(
'MSIE'
)
!==
-
1
||
navigator
.
appVersion
.
indexOf
(
'Trident/'
)
>
0
){
...
...
@@ -36,6 +41,7 @@
}.
bind
(
this
),
100
);
}
},
// Defer loading the rest of the page to limit FOUC
reLoadBannerImage
:
function
()
{
var
$img
=
this
.
$
(
'.program_card .banner-image'
),
...
...
lms/static/js/learner_dashboard/views/sidebar_view.js
View file @
4a015f5f
...
...
@@ -5,6 +5,7 @@
'jquery'
,
'underscore'
,
'gettext'
,
'js/learner_dashboard/views/explore_new_programs_view'
,
'text!../../../templates/learner_dashboard/sidebar.underscore'
],
function
(
...
...
@@ -12,19 +13,27 @@
$
,
_
,
gettext
,
NewProgramsView
,
sidebarTpl
)
{
return
Backbone
.
View
.
extend
({
el
:
'.sidebar'
,
tpl
:
_
.
template
(
sidebarTpl
),
initialize
:
function
(
data
)
{
this
.
context
=
data
.
context
;
},
render
:
function
()
{
if
(
this
.
context
.
xseriesUrl
){
//Only show the xseries advertising panel if the link is passed in
this
.
$el
.
html
(
this
.
tpl
(
this
.
context
));
}
this
.
postRender
();
},
postRender
:
function
()
{
this
.
newProgramsView
=
new
NewProgramsView
({
context
:
this
.
context
});
}
});
}
...
...
lms/static/js/spec/learner_dashboard/sidebar_view_spec.js
View file @
4a015f5f
...
...
@@ -34,7 +34,7 @@ define([
it
(
'should load the xseries advertising based on passed in xseries URL'
,
function
()
{
var
$sidebar
=
view
.
$el
;
expect
(
$sidebar
.
find
(
'.program-advertise .advertise-message'
).
html
().
trim
())
.
toEqual
(
'Browse recently launched courses and see what
\'
s new in our favorite subjects'
);
.
toEqual
(
'Browse recently launched courses and see what
\'
s new in
y
our favorite subjects'
);
expect
(
$sidebar
.
find
(
'.program-advertise .ad-link a'
).
attr
(
'href'
)).
toEqual
(
context
.
xseriesUrl
);
});
...
...
lms/templates/learner_dashboard/explore_new_programs.underscore
0 → 100644
View file @
4a015f5f
<div class="advertise-message">
<%- gettext('Browse recently launched courses and see what\'s new in your favorite subjects') %>
</div>
<div class="ad-link">
<a href="<%- xseriesUrl %>" class="btn">
<i class="icon fa fa-search" aria-hidden="true"></i>
<span><%- gettext('Explore New XSeries') %></span>
</a>
</div>
lms/templates/learner_dashboard/sidebar.underscore
View file @
4a015f5f
<div class="program-advertise">
<div class="advertise-message">
<%- gettext('Browse recently launched courses and see what\'s new in our favorite subjects') %>
</div>
<div class="ad-link">
<a href="<%- xseriesUrl %>" class="btn">
<i class="icon fa fa-search" aria-hidden="true"></i>
<span><%- gettext('Explore New XSeries') %></span>
</a>
</div
</div>
<div class="certificate-container">
</div>
<div class="program-advertise"></div>
<div class="certificate-container"></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