Show published date in history details and manual search

New: Hover over age in manual search to see published date
New: Show published date in history details for grab events
pull/6/head
Mark McDowall 10 years ago
parent 119677e2dd
commit a83f49ca32

@ -1,5 +1,5 @@
{{#if_eq eventType compare="grabbed"}} {{#if_eq eventType compare="grabbed"}}
<dl class="dl-horizontal"> <dl class="dl-horizontal info">
<dt>Name:</dt> <dt>Name:</dt>
<dd>{{sourceTitle}}</dd> <dd>{{sourceTitle}}</dd>
@ -33,6 +33,11 @@
{{#if age}} {{#if age}}
{{historyAge}} {{historyAge}}
{{/if}} {{/if}}
{{#if publishedDate}}
<dt>Published Date:</dt>
<dd>{{ShortDate publishedDate}} {{LTS publishedDate}}</dd>
{{/if}}
{{/with}} {{/with}}
</dl> </dl>
{{/if_eq}} {{/if_eq}}

@ -222,3 +222,7 @@ td.delete-episode-file-cell {
width : 200px; width : 200px;
} }
} }
.age-cell {
cursor : default;
}

@ -256,3 +256,9 @@ body {
max-width : 250px; max-width : 250px;
} }
} }
dl.info {
dt, dd {
padding-bottom: 5px;
}
}

@ -63,4 +63,12 @@ define(
return moment(input).format(UiSettings.time(false)); return moment(input).format(UiSettings.time(false));
}); });
Handlebars.registerHelper('LTS', function (input) {
if (!input) {
return '';
}
return moment(input).format('LTS');
});
}); });

File diff suppressed because it is too large Load Diff

@ -1,10 +1,10 @@
'use strict';
define( define(
[ [
'moment',
'backgrid', 'backgrid',
'Shared/UiSettingsModel',
'Shared/FormatHelpers' 'Shared/FormatHelpers'
], function (Backgrid, FormatHelpers) { ], function (moment, Backgrid, UiSettings, FormatHelpers) {
return Backgrid.Cell.extend({ return Backgrid.Cell.extend({
className: 'age-cell', className: 'age-cell',
@ -12,14 +12,17 @@ define(
render: function () { render: function () {
var age = this.model.get('age'); var age = this.model.get('age');
var ageHours = this.model.get('ageHours'); var ageHours = this.model.get('ageHours');
var published = moment(this.model.get('publishDate'));
var publishedFormatted = published.format('{0} LTS'.format(UiSettings.get('shortDateFormat')));
var formatted = age;
var suffix = this.plural(age, 'day');
if (age === 0) { if (age === 0) {
this.$el.html('{0} {1}'.format(ageHours.toFixed(1), this.plural(Math.round(ageHours), 'hour'))); formatted = ageHours.toFixed(1);
suffix = this.plural(Math.round(ageHours), 'hour');
} }
else { this.$el.html('<div title="{2}">{0} {1}</div>'.format(formatted, suffix, publishedFormatted));
this.$el.html('{0} {1}'.format(age, this.plural(age, 'day')));
}
this.delegateEvents(); this.delegateEvents();
return this; return this;
@ -34,3 +37,5 @@ define(
} }
}); });
}); });
'use strict';

@ -1,9 +1,3 @@
dl.info {
dt, dd {
padding-bottom: 5px;
}
}
.health-ok { .health-ok {
margin-bottom: 30px; margin-bottom: 30px;
} }
Loading…
Cancel
Save