Finished Series Index Table formatting

This commit is contained in:
Mark McDowall 2013-04-22 23:06:55 -07:00
commit 4cc4e8133e
6 changed files with 95 additions and 48 deletions

View file

@ -71,49 +71,6 @@ define('app', function () {
console.log('starting application');
//TODO: move these out of here
Backgrid.SeriesStatusCell = Backgrid.Cell.extend({
className: "series-status-cell",
render: function () {
this.$el.empty();
var monitored = this.model.get('monitored');
var status = this.model.get('status');
if (!monitored) {
this.$el.html('<i class="icon-pause grid-icon" title="Not Monitored"></i>');
}
else if (status === 0) {
this.$el.html('<i class="icon-play grid-icon" title="Continuing"></i>');
}
else {
this.$el.html('<i class="icon-stop grid-icon" title="Ended"></i>');
}
return this;
}
});
var AirDateFormatter = Backgrid.AirDateFormatter = function () {};
AirDateFormatter.prototype = new Backgrid.CellFormatter();
_.extend(AirDateFormatter.prototype, {
/**
Converts any value to a string using Ecmascript's implicit type
conversion. If the given value is `null` or `undefined`, an empty string is
returned instead.
@member Backgrid.StringFormatter
@param {*} rawValue
@return {string}
*/
fromRaw: function (rawValue) {
return 'Hello World';
if (_.isUndefined(rawValue) || _.isNull(rawValue)) return '';
return rawValue + '';
}
});
});
NzbDrone.addRegions({
@ -122,7 +79,6 @@ define('app', function () {
notificationRegion: '#notification-region'
});
window.NzbDrone.start();
return NzbDrone;