Ongoing rewrite work

This commit is contained in:
Jamie Curnow
2018-07-09 11:22:10 +10:00
parent 30924a6922
commit 54d220a191
72 changed files with 3656 additions and 113 deletions

View File

@ -0,0 +1,7 @@
<i class="fe fe-alert-triangle mr-2" aria-hidden="true"></i>
<%= code ? '<strong>' + code + '</strong> &mdash; ' : '' %>
<%- message %>
<% if (retry) { %>
<br><br><a href="#" class="btn btn-sm btn-warning retry">Try again</a>
<% } %>

View File

@ -0,0 +1,29 @@
'use strict';
const Mn = require('backbone.marionette');
const template = require('./main.ejs');
module.exports = Mn.View.extend({
template: template,
className: 'alert alert-icon alert-warning m-5',
ui: {
retry: 'a.retry'
},
events: {
'click @ui.retry': function (e) {
e.preventDefault();
this.getOption('retry')();
}
},
templateContext: function () {
return {
message: this.getOption('message'),
code: this.getOption('code'),
retry: typeof this.getOption('retry') === 'function'
};
}
});