- {{{right}}}
+ // language=Handlebars
+ templateContent = `
+ {{#unless noEdit}}
+
+
+ {{{avatar}}}
- {{/unless}}
-
-
-
- {{{avatar}}}
-
-
-
- {{{message}}}
-
+
+ {{#if iconHtml}}{{{iconHtml}}}{{/if}}
+ {{{message}}}
-
- `,
+
+
+
+
+
+ `
- data: function () {
- let iconClass = ({
- 'success': 'fas fa-check fa-sm',
- 'danger': 'fas fa-times fa-sm',
- 'warning': 'fas fa-question fa-sm',
- })[this.style] || '';
+ data() {
+ const statusIconClass = ({
+ 'success': 'fas fa-check fa-sm',
+ 'danger': 'fas fa-times fa-sm',
+ 'warning': 'fas fa-question fa-sm',
+ })[this.style] || '';
- return _.extend({
- statusText: this.statusText,
- style: this.style,
- iconClass: iconClass,
- }, Dep.prototype.data.call(this));
- },
+ return {
+ ...super.data(),
+ statusText: this.statusText,
+ style: this.style,
+ statusIconClass: statusIconClass,
+ iconHtml: this.getIconHtml(),
+ };
+ }
- init: function () {
- if (this.getUser().isAdmin()) {
- this.isRemovable = true;
- }
+ init() {
+ if (this.getUser().isAdmin()) {
+ this.isRemovable = true;
+ }
- Dep.prototype.init.call(this);
- },
+ super.init();
+ }
- setup: function () {
- this.inviteeType = this.model.get('relatedType');
- this.inviteeId = this.model.get('relatedId');
- this.inviteeName = this.model.get('relatedName');
+ setup() {
+ this.inviteeType = this.model.get('relatedType');
+ this.inviteeId = this.model.get('relatedId');
+ this.inviteeName = this.model.get('relatedName');
- let data = this.model.get('data') || {};
+ const data = this.model.get('data') || {};
- let status = data.status || 'Tentative';
- this.style = data.style || 'default';
- this.statusText = this.getLanguage().translateOption(status, 'acceptanceStatus', 'Meeting');
+ const status = data.status || 'Tentative';
+ this.style = data.style || 'default';
+ this.statusText = this.getLanguage().translateOption(status, 'acceptanceStatus', 'Meeting');
- this.messageName = 'eventConfirmation' + status;
+ this.messageName = 'eventConfirmation' + status;
- if (this.isThis) {
- this.messageName += 'This';
- }
+ if (this.isThis) {
+ this.messageName += 'This';
+ }
- this.messageData['invitee'] =
- $('
')
- .attr('href', '#' + this.inviteeType + '/view/' + this.inviteeId)
- .attr('data-id', this.inviteeId)
- .attr('data-scope', this.inviteeType)
- .text(this.inviteeName);
+ this.messageData['invitee'] =
+ $('')
+ .attr('href', '#' + this.inviteeType + '/view/' + this.inviteeId)
+ .attr('data-id', this.inviteeId)
+ .attr('data-scope', this.inviteeType)
+ .text(this.inviteeName);
- this.createMessage();
- },
- });
-});
+ this.createMessage();
+ }
+}
+
+// noinspection JSUnusedGlobalSymbols
+export default EventConfirmationNoteView;