mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
added some custom cells for resources.
This commit is contained in:
parent
c93548c9f6
commit
bf499ed98a
5 changed files with 76 additions and 17 deletions
30
UI/Shared/Cells/EpisodeNumberCell.js
Normal file
30
UI/Shared/Cells/EpisodeNumberCell.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
"use strict";
|
||||
NzbDrone.Shared.Cells.EpisodeNumberCell = Backgrid.Cell.extend({
|
||||
|
||||
className: "episode-number-cell",
|
||||
|
||||
render: function () {
|
||||
|
||||
var airDate = this.model.get(this.column.get("airDate"));
|
||||
|
||||
var result = 'Unknown';
|
||||
|
||||
if (airDate) {
|
||||
|
||||
result = new Date(airDate).toLocaleDateString();
|
||||
}
|
||||
else {
|
||||
var season = this.model.get(this.column.get("season")).pad(2);
|
||||
|
||||
var episodes = _.map(this.model.get(this.column.get("episodes")), function (episodeNumber) {
|
||||
return episodeNumber.pad(2);
|
||||
});
|
||||
|
||||
result = 'S{0}-E{1}'.format(season, episodes.join());
|
||||
}
|
||||
|
||||
this.$el.html(result);
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue