diff --git a/src/UI/Handlebars/Helpers/Quality.js b/src/UI/Handlebars/Helpers/Quality.js index d0050f577..292c04937 100644 --- a/src/UI/Handlebars/Helpers/Quality.js +++ b/src/UI/Handlebars/Helpers/Quality.js @@ -2,20 +2,18 @@ define( [ 'handlebars', - 'Quality/QualityProfileCollection', - 'underscore' - ], function (Handlebars, QualityProfileCollection, _) { + 'Quality/QualityProfileCollection' + ], function (Handlebars, QualityProfileCollection) { Handlebars.registerHelper('qualityProfile', function (profileId) { var profile = QualityProfileCollection.get(profileId); if (profile) { - return new Handlebars.SafeString('' + profile.get("name") + ''); + return new Handlebars.SafeString('' + profile.get('name') + ''); } return undefined; }); - }); diff --git a/src/UI/History/Details/HistoryDetailsAge.js b/src/UI/History/Details/HistoryDetailsAge.js new file mode 100644 index 000000000..d28dd317a --- /dev/null +++ b/src/UI/History/Details/HistoryDetailsAge.js @@ -0,0 +1,19 @@ +'use strict'; +define( + [ + 'handlebars' + ], function (Handlebars) { + + 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('