Revert "Revert "Adding background image for xseries certificates on dashboard side bar panel""
This commit is contained in:
31
lms/static/js/learner_dashboard/views/certificate_view.js
Normal file
31
lms/static/js/learner_dashboard/views/certificate_view.js
Normal file
@@ -0,0 +1,31 @@
|
||||
;(function (define) {
|
||||
'use strict';
|
||||
define(['backbone',
|
||||
'jquery',
|
||||
'underscore',
|
||||
'gettext',
|
||||
'text!../../../templates/learner_dashboard/certificate.underscore'
|
||||
],
|
||||
function(
|
||||
Backbone,
|
||||
$,
|
||||
_,
|
||||
gettext,
|
||||
certificateTpl
|
||||
) {
|
||||
return Backbone.View.extend({
|
||||
el: '.certificates-list',
|
||||
tpl: _.template(certificateTpl),
|
||||
initialize: function(data) {
|
||||
this.context = data.context;
|
||||
this.render();
|
||||
},
|
||||
render: function() {
|
||||
if (this.context.certificatesData.length > 0) {
|
||||
this.$el.html(this.tpl(this.context));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
}).call(this, define || RequireJS.define);
|
||||
@@ -6,6 +6,7 @@
|
||||
'underscore',
|
||||
'gettext',
|
||||
'js/learner_dashboard/views/explore_new_programs_view',
|
||||
'js/learner_dashboard/views/certificate_view',
|
||||
'text!../../../templates/learner_dashboard/sidebar.underscore'
|
||||
],
|
||||
function(
|
||||
@@ -14,6 +15,7 @@
|
||||
_,
|
||||
gettext,
|
||||
NewProgramsView,
|
||||
CertificateView,
|
||||
sidebarTpl
|
||||
) {
|
||||
return Backbone.View.extend({
|
||||
@@ -34,6 +36,10 @@
|
||||
this.newProgramsView = new NewProgramsView({
|
||||
context: this.context
|
||||
});
|
||||
|
||||
this.newCertificateView = new CertificateView({
|
||||
context: this.context
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user