Revert "Revert "Adding background image for xseries certificates on dashboard side bar panel""

This commit is contained in:
Adam
2016-04-19 16:17:26 -04:00
committed by Awais
parent 47e4804b52
commit 88192fd444
14 changed files with 216 additions and 8 deletions

View 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);

View File

@@ -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
});
}
});
}