parent
31d472a0a0
commit
ef4ad53277
@ -0,0 +1,40 @@
|
|||||||
|
'use strict';
|
||||||
|
define(
|
||||||
|
[
|
||||||
|
'backgrid',
|
||||||
|
'marionette',
|
||||||
|
'bootstrap'
|
||||||
|
], function (Backgrid, Marionette) {
|
||||||
|
|
||||||
|
return Backgrid.Cell.extend({
|
||||||
|
|
||||||
|
className: 'approval-status-cell',
|
||||||
|
template : 'Cells/ApprovalStatusCellTemplate',
|
||||||
|
|
||||||
|
|
||||||
|
render: function () {
|
||||||
|
|
||||||
|
var rejections = this.model.get(this.column.get('name'));
|
||||||
|
|
||||||
|
if (rejections.length === 0) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.templateFunction = Marionette.TemplateCache.get(this.template);
|
||||||
|
|
||||||
|
var html = this.templateFunction(rejections);
|
||||||
|
this.$el.html('<i class="icon-exclamation-sign"/>');
|
||||||
|
|
||||||
|
this.$el.popover({
|
||||||
|
content : html,
|
||||||
|
html : true,
|
||||||
|
trigger : 'hover',
|
||||||
|
title : 'Release Rejected',
|
||||||
|
placement: 'left',
|
||||||
|
container: this.$el
|
||||||
|
});
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
@ -1,26 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
define(
|
|
||||||
[
|
|
||||||
'backgrid'
|
|
||||||
], function (Backgrid) {
|
|
||||||
|
|
||||||
|
|
||||||
return Backgrid.Cell.extend({
|
|
||||||
|
|
||||||
className: 'approval-status-cell',
|
|
||||||
|
|
||||||
render: function () {
|
|
||||||
var rejections = this.model.get(this.column.get('name'));
|
|
||||||
|
|
||||||
var result = '';
|
|
||||||
|
|
||||||
_.each(rejections, function (reason) {
|
|
||||||
result += reason + ' ';
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$el.html(result);
|
|
||||||
this.delegateEvents();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in new issue