2018-07-08 21:22:10 -04:00
|
|
|
const Mn = require('backbone.marionette');
|
|
|
|
const template = require('./main.ejs');
|
|
|
|
|
|
|
|
module.exports = Mn.View.extend({
|
|
|
|
className: 'text-center m-7',
|
|
|
|
template: template,
|
|
|
|
|
2018-07-08 22:21:03 -04:00
|
|
|
options: {
|
|
|
|
btn_color: 'teal'
|
|
|
|
},
|
|
|
|
|
2018-07-08 21:22:10 -04:00
|
|
|
ui: {
|
|
|
|
action: 'a'
|
|
|
|
},
|
|
|
|
|
|
|
|
events: {
|
|
|
|
'click @ui.action': function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
this.getOption('action')();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
templateContext: function () {
|
|
|
|
return {
|
2018-07-08 22:21:03 -04:00
|
|
|
title: this.getOption('title'),
|
|
|
|
subtitle: this.getOption('subtitle'),
|
|
|
|
link: this.getOption('link'),
|
|
|
|
action: typeof this.getOption('action') === 'function',
|
|
|
|
btn_color: this.getOption('btn_color')
|
2018-07-08 21:22:10 -04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|