basic implementation of the wanted tab (#31)
* top buttons don't yet work * new missing module for movies * find missing movies method to movie service * new movie status cell with text * adapted UI missing collection and layoutpull/333/head
parent
10dc3993df
commit
da2d075aa8
@ -0,0 +1,42 @@
|
||||
var NzbDroneCell = require('./NzbDroneCell');
|
||||
|
||||
//used in Wanted tab
|
||||
module.exports = NzbDroneCell.extend({
|
||||
className : 'movie-status-text-cell',
|
||||
|
||||
render : function() {
|
||||
this.$el.empty();
|
||||
var monitored = this.model.get('monitored');
|
||||
var status = this.model.get('status');
|
||||
var inCinemas = this.model.get("inCinemas");
|
||||
var date = new Date(inCinemas);
|
||||
var timeSince = new Date().getTime() - date.getTime();
|
||||
var numOfMonths = timeSince / 1000 / 60 / 60 / 24 / 30;
|
||||
|
||||
if (status === 'released') {
|
||||
this.$el.html('<div class="released-banner"><i class="icon-sonarr-movie-released grid-icon" title=""></i> Released</div>');
|
||||
this._setStatusWeight(3);
|
||||
}
|
||||
|
||||
if (numOfMonths > 3) {
|
||||
this.$el.html('<div class="released-banner"><i class="icon-sonarr-movie-released grid-icon" title=""></i> Released</div>');//TODO: Update for PreDB.me
|
||||
this._setStatusWeight(2);
|
||||
}
|
||||
|
||||
if (numOfMonths < 3) {
|
||||
this.$el.html('<div class="cinemas-banner"><i class="icon-sonarr-movie-cinemas grid-icon" title=""></i> In Cinemas</div>');
|
||||
this._setStatusWeight(2);
|
||||
}
|
||||
|
||||
if (status === "announced") {
|
||||
this.$el.html('<div class="announced-banner"><i class="icon-sonarr-movie-announced grid-icon" title=""></i> Announced</div>');
|
||||
this._setStatusWeight(1);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_setStatusWeight : function(weight) {
|
||||
this.model.set('statusWeight', weight, { silent : true });
|
||||
}
|
||||
});
|
Loading…
Reference in new issue