Files
edx-platform/cms/static/js/certificates/views/certificate_item.js
Syed Ali Abbas Zaidi f1fb38ed83 fix: multi lines and spaces issues (#31885)
* fix: multi lines and spaces issues

* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: remaining quotes issues

* fix: eslint object curly newline issue

* fix: eslint object curly spacing issue

* fix: eslint brace-style issues

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint linbreak style issue

* fix: eslint space unary operator issue

* fix: eslint line around directives issue

* fix: void and typeof space unary ops issue
2023-05-03 12:22:46 +05:00

44 lines
1.3 KiB
JavaScript

// Backbone Application View: Certificate Item
// Renders an editor view or a details view depending on the state of the underlying model.
define([
'gettext',
'js/views/list_item',
'js/certificates/views/certificate_details',
'js/certificates/views/certificate_editor'
],
function(gettext, ListItemView, CertificateDetailsView, CertificateEditorView) {
'use strict';
var CertificateItemView = ListItemView.extend({
events: {
'click .delete': 'deleteItem'
},
tagName: 'section',
baseClassName: 'certificate',
canDelete: true,
// Translators: This field pertains to the custom label for a certificate.
itemDisplayName: gettext('certificate'),
attributes: function() {
// Retrieves the defined attribute set
return {
id: this.model.get('id'),
tabindex: -1
};
},
createEditView: function() {
// Renders the editor view for this model
return new CertificateEditorView({model: this.model});
},
createDetailsView: function() {
// Renders the details view for this model
return new CertificateDetailsView({model: this.model});
}
});
return CertificateItemView;
});