parent
17d7083412
commit
be95311471
@ -0,0 +1,16 @@
|
||||
var TemplatedCell = require('./TemplatedCell');
|
||||
|
||||
module.exports = TemplatedCell.extend({
|
||||
className : 'in-cinemas-cell',
|
||||
|
||||
render : function() {
|
||||
var monthNames = ["January", "February", "March", "April", "May", "June",
|
||||
"July", "August", "September", "October", "November", "December"
|
||||
];
|
||||
var cinemasDate = new Date(this.model.get("inCinemas"));
|
||||
var year = cinemasDate.getFullYear();
|
||||
var month = monthNames[cinemasDate.getMonth()];
|
||||
this.$el.html(month + " " + year); //Hack, but somehow handlebar helper does not work.
|
||||
return this;
|
||||
}
|
||||
});
|
@ -0,0 +1,45 @@
|
||||
var vent = require('vent');
|
||||
var NzbDroneCell = require('./NzbDroneCell');
|
||||
var CommandController = require('../Commands/CommandController');
|
||||
|
||||
module.exports = NzbDroneCell.extend({
|
||||
className : 'series-actions-cell',
|
||||
|
||||
ui : {
|
||||
refresh : '.x-refresh'
|
||||
},
|
||||
|
||||
events : {
|
||||
'click .x-edit' : '_editSeries',
|
||||
'click .x-refresh' : '_refreshSeries'
|
||||
},
|
||||
|
||||
render : function() {
|
||||
this.$el.empty();
|
||||
|
||||
this.$el.html('<i class="icon-sonarr-refresh x-refresh hidden-xs" title="" data-original-title="Update movie info and scan disk"></i> ' +
|
||||
'<i class="icon-sonarr-edit x-edit" title="" data-original-title="Edit Movie"></i>');
|
||||
|
||||
CommandController.bindToCommand({
|
||||
element : this.$el.find('.x-refresh'),
|
||||
command : {
|
||||
name : 'refreshMovie',
|
||||
movieId : this.model.get('id')
|
||||
}
|
||||
});
|
||||
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
},
|
||||
|
||||
_editSeries : function() {
|
||||
vent.trigger(vent.Commands.EditSeriesCommand, { series : this.model });
|
||||
},
|
||||
|
||||
_refreshSeries : function() {
|
||||
CommandController.Execute('refreshMovie', {
|
||||
name : 'refreshMovie',
|
||||
movieId : this.model.id
|
||||
});
|
||||
}
|
||||
});
|
@ -0,0 +1,6 @@
|
||||
var TemplatedCell = require('./TemplatedCell');
|
||||
|
||||
module.exports = TemplatedCell.extend({
|
||||
className : 'movie-links-cell',
|
||||
template : 'Cells/MovieLinksTemplate'
|
||||
});
|
@ -0,0 +1,11 @@
|
||||
<span class="series-info-links">
|
||||
<!--<a href="{{traktUrl}}" class="label label-info">Trakt</a>-->
|
||||
{{#if website}}
|
||||
<a href="{{homepage}}" class="label label-info">Homepage</a>
|
||||
{{/if}}
|
||||
<a href="{{tmdbUrl}}" class="label label-info">The Movie DB</a>
|
||||
|
||||
{{#if imdbId}}
|
||||
<a href="{{imdbUrl}}" class="label label-info">IMDB</a>
|
||||
{{/if}}
|
||||
</span>
|
@ -0,0 +1,46 @@
|
||||
var NzbDroneCell = require('./NzbDroneCell');
|
||||
|
||||
module.exports = NzbDroneCell.extend({
|
||||
className : 'movie-status-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('<i class="icon-sonarr-movie-released grid-icon" title="Released"></i>');
|
||||
this._setStatusWeight(3);
|
||||
}
|
||||
|
||||
if (numOfMonths > 3) {
|
||||
this.$el.html('<i class="icon-sonarr-movie-released grid-icon" title="Released"></i>');//TODO: Update for PreDB.me
|
||||
this._setStatusWeight(2);
|
||||
}
|
||||
|
||||
if (numOfMonths < 3) {
|
||||
this.$el.html('<i class="icon-sonarr-movie-cinemas grid-icon" title="In Cinemas"></i>');
|
||||
this._setStatusWeight(2);
|
||||
}
|
||||
|
||||
if (status === "announced") {
|
||||
this.$el.html('<i class="icon-sonarr-movie-announced grid-icon" title="Announced"></i>');
|
||||
this._setStatusWeight(1);
|
||||
}
|
||||
|
||||
else if (!monitored) {
|
||||
this.$el.html('<i class="icon-sonarr-series-unmonitored grid-icon" title="Not Monitored"></i>');
|
||||
this._setStatusWeight(0);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_setStatusWeight : function(weight) {
|
||||
this.model.set('statusWeight', weight, { silent : true });
|
||||
}
|
||||
});
|
@ -0,0 +1,6 @@
|
||||
var TemplatedCell = require('./TemplatedCell');
|
||||
|
||||
module.exports = TemplatedCell.extend({
|
||||
className : 'series-title-cell',
|
||||
template : 'Cells/SeriesTitleTemplate',
|
||||
});
|
Loading…
Reference in new issue