mirror of
https://github.com/Radarr/Radarr
synced 2025-02-26 08:02:56 +00:00
parent
281e516495
commit
c2d40051d4
2 changed files with 22 additions and 17 deletions
|
@ -11,24 +11,26 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="form-group" style="display: inline-block; float: left; margin-bottom: 0;">
|
<div class="form-horizontal" style="margin-top: 15px;">
|
||||||
<label class="col-sm-3 control-label">Show Existing</label>
|
<div class="form-group" style="margin-bottom: 0px;">
|
||||||
|
<label class="col-sm-3 control-label">Display Existing Movies</label>
|
||||||
|
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-8">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<label class="checkbox toggle well">
|
<label class="checkbox toggle well">
|
||||||
<input class="x-show-existing" type="checkbox" checked="checked" name="showExisting"/>
|
<input class="x-show-existing" type="checkbox" checked="checked" name="showExisting"/>
|
||||||
<p>
|
<p>
|
||||||
<span>Yes</span>
|
<span>Yes</span>
|
||||||
<span>No</span>
|
<span>No</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="btn btn-primary slide-button"/>
|
<div class="btn btn-primary slide-button"/>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<span class="help-inline-checkbox">
|
<span class="help-inline-checkbox">
|
||||||
<i class="icon-sonarr-form-info" title="Should Radarr display movies already in your collection?"/>
|
<i class="icon-sonarr-form-info" title="Should Radarr display movies already in your collection?"/>
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
var Marionette = require('marionette');
|
var Marionette = require('marionette');
|
||||||
var SearchResultView = require('./SearchResultView');
|
var SearchResultView = require('./SearchResultView');
|
||||||
|
var MoviesCollection = require('../Movies/MoviesCollection');
|
||||||
var vent = require('vent');
|
var vent = require('vent');
|
||||||
|
|
||||||
module.exports = Marionette.CollectionView.extend({
|
module.exports = Marionette.CollectionView.extend({
|
||||||
|
@ -43,13 +44,15 @@ module.exports = Marionette.CollectionView.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
appendHtml : function(collectionView, itemView, index) {
|
appendHtml : function(collectionView, itemView, index) {
|
||||||
if(this.isExisting) {
|
var tmdbId = itemView.model.get('tmdbId');
|
||||||
|
var existingMovies = MoviesCollection.where({ tmdbId: tmdbId });
|
||||||
|
if(existingMovies.length > 0) {
|
||||||
if(this.showExisting) {
|
if(this.showExisting) {
|
||||||
if (index < this.showing || index === 0) {
|
if (index < this.showing || index === 0) {
|
||||||
collectionView.$el.append(itemView.el);
|
collectionView.$el.append(itemView.el);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(!this.isExisting) {
|
} else {
|
||||||
if (index < this.showing || index === 0) {
|
if (index < this.showing || index === 0) {
|
||||||
collectionView.$el.append(itemView.el);
|
collectionView.$el.append(itemView.el);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue