UI Cleanup - Updated Navbar, Profile, Quality and Release subtrees.

This commit is contained in:
Taloth Saldono
2015-02-13 22:47:42 +01:00
parent 29d9e3dadf
commit 860f55996c
10 changed files with 217 additions and 146 deletions
+10 -4
View File
@@ -5,25 +5,31 @@ require('../Shared/FormatHelpers');
module.exports = Backgrid.Cell.extend({
className : 'age-cell',
render : function(){
render : function() {
var age = this.model.get('age');
var ageHours = this.model.get('ageHours');
var published = moment(this.model.get('publishDate'));
var publishedFormatted = published.format('{0} {1}'.format(UiSettings.get('shortDateFormat'), UiSettings.time(true, true)));
var formatted = age;
var suffix = this.plural(age, 'day');
if(age === 0) {
if (age === 0) {
formatted = ageHours.toFixed(1);
suffix = this.plural(Math.round(ageHours), 'hour');
}
this.$el.html('<div title="{2}">{0} {1}</div>'.format(formatted, suffix, publishedFormatted));
this.delegateEvents();
return this;
},
plural : function(input, unit){
if(input === 1) {
plural : function(input, unit) {
if (input === 1) {
return unit;
}
return unit + 's';
}
});