Readarr/src/UI/Wanted/WantedLayout.js
Taloth Saldono d416dd4177 Repurposed the Missing page to include filter options and display episodes that haven't reached cutoff.
--HG--
rename : src/NzbDrone.Api/Missing/MissingModule.cs => src/NzbDrone.Api/Wanted/MissingModule.cs
rename : src/UI/Missing/ControlsColumnTemplate.html => src/UI/Wanted/ControlsColumnTemplate.html
rename : src/UI/Missing/MissingCollection.js => src/UI/Wanted/Missing/MissingCollection.js
rename : src/UI/Missing/MissingLayout.js => src/UI/Wanted/WantedLayout.js
rename : src/UI/Missing/MissingLayoutTemplate.html => src/UI/Wanted/WantedLayoutTemplate.html
extra : source : 2c76f3e423d39446f3bd7799b7344d7be63c70f5
2014-02-22 16:21:40 -08:00

69 lines
2 KiB
JavaScript

'use strict';
define(
[
'marionette',
'backbone',
'backgrid',
'Wanted/Missing/MissingLayout',
'Wanted/Cutoff/CutoffUnmetLayout'
], function (Marionette, Backbone, Backgrid, MissingLayout, CutoffUnmetLayout) {
return Marionette.Layout.extend({
template: 'Wanted/WantedLayoutTemplate',
regions: {
content : '#content'
//missing : '#missing',
//cutoff : '#cutoff'
},
ui: {
missingTab : '.x-missing-tab',
cutoffTab : '.x-cutoff-tab'
},
events: {
'click .x-missing-tab' : '_showMissing',
'click .x-cutoff-tab' : '_showCutoffUnmet'
},
initialize: function (options) {
if (options.action) {
this.action = options.action.toLowerCase();
}
},
onShow: function () {
switch (this.action) {
case 'cutoff':
this._showCutoffUnmet();
break;
default:
this._showMissing();
}
},
_navigate: function (route) {
Backbone.history.navigate(route);
},
_showMissing: function (e) {
if (e) {
e.preventDefault();
}
this.content.show(new MissingLayout());
this.ui.missingTab.tab('show');
this._navigate('/wanted/missing');
},
_showCutoffUnmet: function (e) {
if (e) {
e.preventDefault();
}
this.content.show(new CutoffUnmetLayout());
this.ui.cutoffTab.tab('show');
this._navigate('/wanted/cutoff');
}
});
});