mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-26 22:46:53 -04:00
UI Cleanup - Updated Activity subtree.
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
var Handlebars = require('handlebars');
|
||||
|
||||
module.exports = (function(){
|
||||
Handlebars.registerHelper('historyAge', function(){
|
||||
var unit = 'days';
|
||||
var age = this.age;
|
||||
if(age < 2) {
|
||||
unit = 'hours';
|
||||
age = parseFloat(this.ageHours).toFixed(1);
|
||||
}
|
||||
return new Handlebars.SafeString('<dt>Age (when grabbed):</dt><dd>{0} {1}</dd>'.format(age, unit));
|
||||
});
|
||||
}).call(this);
|
||||
Handlebars.registerHelper('historyAge', function() {
|
||||
|
||||
var unit = 'days';
|
||||
var age = this.age;
|
||||
|
||||
if (age < 2) {
|
||||
unit = 'hours';
|
||||
age = parseFloat(this.ageHours).toFixed(1);
|
||||
}
|
||||
|
||||
return new Handlebars.SafeString('<dt>Age (when grabbed):</dt><dd>{0} {1}</dd>'.format(age, unit));
|
||||
});
|
||||
|
||||
@@ -4,20 +4,32 @@ var Marionette = require('marionette');
|
||||
var HistoryDetailsView = require('./HistoryDetailsView');
|
||||
|
||||
module.exports = Marionette.Layout.extend({
|
||||
template : 'Activity/History/Details/HistoryDetailsLayoutTemplate',
|
||||
regions : {bodyRegion : '.modal-body'},
|
||||
events : {"click .x-mark-as-failed" : '_markAsFailed'},
|
||||
onShow : function(){
|
||||
this.bodyRegion.show(new HistoryDetailsView({model : this.model}));
|
||||
template : 'Activity/History/Details/HistoryDetailsLayoutTemplate',
|
||||
|
||||
regions : {
|
||||
bodyRegion : '.modal-body'
|
||||
},
|
||||
_markAsFailed : function(){
|
||||
|
||||
events : {
|
||||
'click .x-mark-as-failed' : '_markAsFailed'
|
||||
},
|
||||
|
||||
onShow : function() {
|
||||
this.bodyRegion.show(new HistoryDetailsView({ model : this.model }));
|
||||
},
|
||||
|
||||
_markAsFailed : function() {
|
||||
var url = window.NzbDrone.ApiRoot + '/history/failed';
|
||||
var data = {id : this.model.get('id')};
|
||||
var data = {
|
||||
id : this.model.get('id')
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url : url,
|
||||
type : 'POST',
|
||||
data : data
|
||||
});
|
||||
|
||||
vent.trigger(vent.Commands.CloseModalCommand);
|
||||
}
|
||||
});
|
||||
@@ -1,4 +1,6 @@
|
||||
var Marionette = require('marionette');
|
||||
require('./HistoryDetailsAge');
|
||||
|
||||
module.exports = Marionette.ItemView.extend({template : 'Activity/History/Details/HistoryDetailsViewTemplate'});
|
||||
module.exports = Marionette.ItemView.extend({
|
||||
template : 'Activity/History/Details/HistoryDetailsViewTemplate'
|
||||
});
|
||||
Reference in New Issue
Block a user