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
3eb3373c
Commit
3eb3373c
authored
Mar 21, 2017
by
Matthew Piatetsky
Committed by
GitHub
Mar 21, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14730 from edx/ECOM-7477
ECOM-7477 Merge basic Backbone View outline
parents
6a55ef79
2975a459
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
134 additions
and
2 deletions
+134
-2
lms/static/js/learner_dashboard/program_details_factory_2017.js
+13
-0
lms/static/js/learner_dashboard/views/program_details_sidebar_view.js
+47
-0
lms/static/js/learner_dashboard/views/program_details_view_2017.js
+72
-0
lms/templates/learner_dashboard/program_details_2017.html
+2
-2
No files found.
lms/static/js/learner_dashboard/program_details_factory_2017.js
0 → 100644
View file @
3eb3373c
(
function
(
define
)
{
'use strict'
;
define
([
'js/learner_dashboard/views/program_details_view_2017'
],
function
(
ProgramDetailsView
)
{
return
function
(
options
)
{
var
ProgramDetails
=
new
ProgramDetailsView
(
options
);
return
ProgramDetails
;
};
});
}).
call
(
this
,
define
||
RequireJS
.
define
);
lms/static/js/learner_dashboard/views/program_details_sidebar_view.js
0 → 100644
View file @
3eb3373c
(
function
(
define
)
{
'use strict'
;
define
([
'backbone'
,
'jquery'
,
'underscore'
,
'gettext'
,
'js/learner_dashboard/views/explore_new_programs_view'
,
'js/learner_dashboard/views/certificate_view'
,
'text!../../../templates/learner_dashboard/sidebar.underscore'
],
function
(
Backbone
,
$
,
_
,
gettext
,
NewProgramsView
,
CertificateView
,
sidebarTpl
)
{
return
Backbone
.
View
.
extend
({
el
:
'.sidebar'
,
tpl
:
_
.
template
(
sidebarTpl
),
initialize
:
function
(
data
)
{
this
.
context
=
data
.
context
;
},
render
:
function
()
{
this
.
$el
.
html
(
this
.
tpl
(
this
.
context
));
this
.
postRender
();
},
postRender
:
function
()
{
this
.
newProgramsView
=
new
NewProgramsView
({
context
:
this
.
context
});
this
.
newCertificateView
=
new
CertificateView
({
context
:
this
.
context
});
}
});
}
);
}).
call
(
this
,
define
||
RequireJS
.
define
);
lms/static/js/learner_dashboard/views/program_details_view_2017.js
0 → 100644
View file @
3eb3373c
(
function
(
define
)
{
'use strict'
;
define
([
'backbone'
,
'jquery'
,
'underscore'
,
'gettext'
,
'edx-ui-toolkit/js/utils/html-utils'
,
'js/learner_dashboard/collections/course_card_collection'
,
'js/learner_dashboard/views/program_header_view'
,
'js/learner_dashboard/views/collection_list_view'
,
'js/learner_dashboard/views/course_card_view'
,
'js/learner_dashboard/views/program_details_sidebar_view'
,
'text!../../../templates/learner_dashboard/program_details_view.underscore'
],
function
(
Backbone
,
$
,
_
,
gettext
,
HtmlUtils
,
CourseCardCollection
,
HeaderView
,
CollectionListView
,
CourseCardView
,
SidebarView
,
pageTpl
)
{
return
Backbone
.
View
.
extend
({
el
:
'.js-program-details-wrapper'
,
tpl
:
HtmlUtils
.
template
(
pageTpl
),
initialize
:
function
(
options
)
{
this
.
options
=
options
;
this
.
programModel
=
new
Backbone
.
Model
(
this
.
options
.
programData
);
this
.
courseCardCollection
=
new
CourseCardCollection
(
this
.
programModel
.
get
(
'courses'
),
this
.
options
.
userPreferences
);
this
.
render
();
},
render
:
function
()
{
HtmlUtils
.
setHtml
(
this
.
$el
,
this
.
tpl
());
this
.
postRender
();
},
postRender
:
function
()
{
this
.
headerView
=
new
HeaderView
({
model
:
new
Backbone
.
Model
(
this
.
options
)
});
new
CollectionListView
({
el
:
'.js-course-list'
,
childView
:
CourseCardView
,
collection
:
this
.
courseCardCollection
,
context
:
this
.
options
,
titleContext
:
{
el
:
'h2'
,
title
:
'Course List'
}
}).
render
();
new
SidebarView
({
el
:
'.sidebar'
,
context
:
this
.
options
}).
render
();
}
});
}
);
}).
call
(
this
,
define
||
RequireJS
.
define
);
lms/templates/learner_dashboard/program_details_2017.html
View file @
3eb3373c
...
...
@@ -12,8 +12,8 @@ from openedx.core.djangolib.js_utils import (
%
>
<
%
block
name=
"js_extra"
>
<
%
static:require_module
module_name=
"js/learner_dashboard/program_details_factory
"
class_name=
"ProgramDetailsFactory
"
>
ProgramDetailsFactory({
<
%
static:require_module
module_name=
"js/learner_dashboard/program_details_factory
_2017"
class_name=
"ProgramDetailsFactory2017
"
>
ProgramDetailsFactory
2017
({
programData: ${program_data | n, dump_js_escaped_json},
urls: ${urls | n, dump_js_escaped_json},
userPreferences: ${user_preferences | n, dump_js_escaped_json},
...
...
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