mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 03:52:33 +02:00
removed NzbDrone. namespace, everything is done using require.
This commit is contained in:
parent
ef62af75df
commit
b0bd3f34f1
@ -10,8 +10,6 @@ module.exports = function (grunt) {
|
||||
'UI/JsLibraries/backbone.modelbinder.js' : 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.ModelBinder.js',
|
||||
'UI/JsLibraries/backbone.mutators.js' : 'http://raw.github.com/asciidisco/Backbone.Mutators/master/backbone.mutators.js',
|
||||
'UI/JsLibraries/backbone.shortcuts.js' : 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js',
|
||||
'UI/JsLibraries/backbone.relational.js' : 'http://raw.github.com/PaulUithol/Backbone-relational/0.8.5/backbone-relational.js',
|
||||
'UI/JsLibraries/backbone.associations.js' : 'http://raw.github.com/dhruvaray/backbone-associations/master/backbone-associations.js',
|
||||
|
||||
'UI/JsLibraries/backbone.pageable.js' : 'http://raw.github.com/wyuenho/backbone-pageable/master/lib/backbone-pageable.js',
|
||||
'UI/JsLibraries/backbone.backgrid.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/backgrid.js',
|
||||
@ -28,6 +26,7 @@ module.exports = function (grunt) {
|
||||
'UI/JsLibraries/require.js' : 'http://raw.github.com/jrburke/requirejs/master/require.js',
|
||||
'UI/JsLibraries/sugar.js' : 'http://raw.github.com/andrewplummer/Sugar/master/release/sugar-full.development.js',
|
||||
'UI/JsLibraries/underscore.js' : 'http://underscorejs.org/underscore.js',
|
||||
'UI/JsLibraries/lodash.underscore.js' : 'http://raw.github.com/bestiejs/lodash/master/dist/lodash.underscore.js',
|
||||
'UI/JsLibraries/lunr.js' : 'http://raw.github.com/olivernn/lunr.js/master/lunr.js',
|
||||
|
||||
'UI/JsLibraries/messenger.js' : 'http://raw.github.com/HubSpot/messenger/master/build/js/messenger.js',
|
||||
@ -36,6 +35,7 @@ module.exports = function (grunt) {
|
||||
|
||||
'UI/Content/bootstrap.toggle-switch.css' : 'http://raw.github.com/ghinda/css-toggle-switch/gh-pages/toggle-switch.css',
|
||||
|
||||
/*
|
||||
'UI/Content/FontAwesome/fontawesome.otf' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/FontAwesome.otf?raw=true',
|
||||
'UI/Content/FontAwesome/fontawesome-webfont.eot' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/fontawesome-webfont.eot?raw=true',
|
||||
'UI/Content/FontAwesome/fontawesome-webfont.svg' : 'http://github.com/FortAwesome/Font-Awesome/blob/master/build/assets/font-awesome/font/fontawesome-webfont.svg?raw=true',
|
||||
@ -51,6 +51,7 @@ module.exports = function (grunt) {
|
||||
'UI/Content/FontAwesome/mixins.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/mixins.less',
|
||||
'UI/Content/FontAwesome/path.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/path.less',
|
||||
'UI/Content/FontAwesome/variables.less' : 'http://raw.github.com/FortAwesome/Font-Awesome/master/build/assets/font-awesome/less/variables.less'
|
||||
*/
|
||||
},
|
||||
|
||||
clean: {
|
||||
@ -125,6 +126,9 @@ module.exports = function (grunt) {
|
||||
},
|
||||
|
||||
watch: {
|
||||
options: {
|
||||
nospawn: false,
|
||||
},
|
||||
bootstrap : {
|
||||
files: ['UI/**/Bootstrap/**', 'UI/**/FontAwesome/**'],
|
||||
tasks: ['less:bootstrap']
|
||||
|
@ -5,7 +5,6 @@
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="jQuery-1.9.1" level="application" />
|
||||
<orderEntry type="library" name="libraries" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
@ -35,10 +35,7 @@
|
||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
||||
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
|
||||
<option name="SPACE_AFTER_COLON" value="false" />
|
||||
<option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
|
||||
<option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
|
||||
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
|
||||
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
|
||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
||||
<option name="ARRAY_INITIALIZER_WRAP" value="2" />
|
||||
<option name="IF_BRACE_FORCE" value="3" />
|
||||
<option name="DOWHILE_BRACE_FORCE" value="3" />
|
||||
|
@ -4,6 +4,7 @@
|
||||
<w>backgrid</w>
|
||||
<w>bnzbd</w>
|
||||
<w>clickable</w>
|
||||
<w>couldn</w>
|
||||
<w>mouseenter</w>
|
||||
<w>mouseleave</w>
|
||||
</words>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptLibraryMappings">
|
||||
<file url="PROJECT" libraries="{libraries}" />
|
||||
<file url="PROJECT" libraries="{jQuery-1.9.1}" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
|
@ -63,7 +63,7 @@
|
||||
<option passfail="false" />
|
||||
<option white="false" />
|
||||
<option maxerr="50" />
|
||||
<option predef="NzbDrone, define, Backbone, _, window,Handlebars,require,$,Marionette, Backgrid, jQuery, signalR" />
|
||||
<option predef="window, define, require ,$" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
|
@ -1,51 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="libraries" type="javaScript">
|
||||
<properties>
|
||||
<sourceFilesUrls>
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/bootstrap.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.debug.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/sugar.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.shortcuts.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.pager.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/handlebars.runtime.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.bootstrap.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.modelbinder.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/fullcalendar.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.collectionbinder.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/underscore.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/bootstrap.slider.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.viewswapper.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/require.js" />
|
||||
<item url="file://$PROJECT_DIR$/JsLibraries/backbone.mutators.js" />
|
||||
</sourceFilesUrls>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrapSwitch.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/toastr-1.1.5.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrap.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.debug.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/sugar.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.shortcuts.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.pager.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/handlebars.runtime.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.bootstrap.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/jquery.tablesorter.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.modelbinder.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.collectionbinder.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/fullcalendar.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/underscore.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/bootstrap.slider.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.marionette.viewswapper.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/backbone.mutators.js" />
|
||||
<root url="file://$PROJECT_DIR$/JsLibraries/require.js" />
|
||||
</CLASSES>
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
@ -1,13 +1,9 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'AddSeries/Collection',
|
||||
'AddSeries/SearchResultCollectionView',
|
||||
'Shared/SpinnerView',
|
||||
'app',
|
||||
'AddSeries/RootFolders/Collection',
|
||||
'AddSeries/SearchResultView',
|
||||
'Shared/SpinnerView'
|
||||
], function (Marionette, AddSeriesCollection, SearchResultCollectionView, SpinnerView) {
|
||||
return Marionette.Layout.extend({
|
||||
|
@ -1,12 +1,11 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'backbone',
|
||||
'Series/SeriesModel'
|
||||
], function (App, Backbone, SeriesModel) {
|
||||
], function (Backbone, SeriesModel) {
|
||||
return Backbone.Collection.extend({
|
||||
url : Constants.ApiRoot + '/series/lookup',
|
||||
url : window.ApiRoot + '/series/lookup',
|
||||
model: SeriesModel,
|
||||
|
||||
parse: function (response) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
@ -6,12 +6,12 @@ define(
|
||||
'mixins/backbone.signalr.mixin'
|
||||
], function (Backbone, RootFolderModel) {
|
||||
|
||||
var rootFolderCollection = Backbone.Collection.extend({
|
||||
url : NzbDrone.Constants.ApiRoot + '/rootfolder',
|
||||
var RootFolderCollection = Backbone.Collection.extend({
|
||||
url : window.ApiRoot + '/rootfolder',
|
||||
model: RootFolderModel
|
||||
});
|
||||
|
||||
var collection = new rootFolderCollection().BindSignalR();
|
||||
var collection = new RootFolderCollection().BindSignalR();
|
||||
|
||||
return collection;
|
||||
});
|
||||
|
@ -1,12 +1,12 @@
|
||||
'use strict';
|
||||
define([
|
||||
'app',
|
||||
'Calendar/UpcomingCollectionView',
|
||||
'Calendar/CalendarView',
|
||||
'Shared/Toolbar/ToolbarLayout'
|
||||
],
|
||||
function () {
|
||||
NzbDrone.Calendar.CalendarLayout = Backbone.Marionette.Layout.extend({
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Calendar/UpcomingCollection',
|
||||
'Calendar/UpcomingCollectionView',
|
||||
'Calendar/CalendarView',
|
||||
], function (Marionette, UpcomingCollection, UpcomingCollectionView, CalendarView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Calendar/CalendarLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
@ -15,7 +15,7 @@ define([
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
this.upcomingCollection = new NzbDrone.Calendar.UpcomingCollection();
|
||||
this.upcomingCollection = new UpcomingCollection();
|
||||
this.upcomingCollection.fetch();
|
||||
},
|
||||
|
||||
@ -25,13 +25,13 @@ define([
|
||||
},
|
||||
|
||||
_showUpcoming: function () {
|
||||
this.upcoming.show(new NzbDrone.Calendar.UpcomingCollectionView({
|
||||
this.upcoming.show(new UpcomingCollectionView({
|
||||
collection: this.upcomingCollection
|
||||
}));
|
||||
},
|
||||
|
||||
_showCalendar: function () {
|
||||
this.calendar.show(new NzbDrone.Calendar.CalendarView());
|
||||
this.calendar.show(new CalendarView());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1,81 +1,87 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define(['app', 'Calendar/Collection','fullcalendar'], function () {
|
||||
NzbDrone.Calendar.CalendarView = Backbone.Marionette.ItemView.extend({
|
||||
initialize : function () {
|
||||
this.collection = new NzbDrone.Calendar.Collection();
|
||||
},
|
||||
render: function () {
|
||||
$(this.$el).empty().fullCalendar({
|
||||
defaultView : 'basicWeek',
|
||||
allDayDefault : false,
|
||||
ignoreTimezone: false,
|
||||
weekMode : 'variable',
|
||||
timeFormat : 'h(:mm)tt',
|
||||
header : {
|
||||
left : 'prev,next today',
|
||||
center: 'title',
|
||||
right : 'month,basicWeek'
|
||||
},
|
||||
buttonText : {
|
||||
prev: '<i class="icon-arrow-left"></i>',
|
||||
next: '<i class="icon-arrow-right"></i>'
|
||||
},
|
||||
events : this.getEvents,
|
||||
eventRender : function (event, element) {
|
||||
$(element).addClass(event.statusLevel);
|
||||
$(element).children('.fc-event-inner').addClass(event.statusLevel);
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Calendar/Collection',
|
||||
'fullcalendar'
|
||||
], function (Marionette, CalendarCollection) {
|
||||
|
||||
element.popover({
|
||||
title : '{seriesTitle} - {season}x{episode} - {episodeTitle}'.assign({
|
||||
seriesTitle : event.title,
|
||||
season : event.seasonNumber,
|
||||
episode : event.episodeNumber.pad(2),
|
||||
episodeTitle: event.episodeTitle
|
||||
}),
|
||||
content : event.overview,
|
||||
placement: 'bottom',
|
||||
trigger : 'manual'
|
||||
});
|
||||
},
|
||||
eventMouseover: function () {
|
||||
$(this).popover('show');
|
||||
},
|
||||
eventMouseout : function () {
|
||||
$(this).popover('hide');
|
||||
}
|
||||
});
|
||||
var _instance;
|
||||
|
||||
NzbDrone.Calendar.CalendarView.Instance = this;
|
||||
},
|
||||
return Marionette.ItemView.extend({
|
||||
initialize: function () {
|
||||
this.collection = new CalendarCollection();
|
||||
},
|
||||
render : function () {
|
||||
$(this.$el).empty().fullCalendar({
|
||||
defaultView : 'basicWeek',
|
||||
allDayDefault : false,
|
||||
ignoreTimezone: false,
|
||||
weekMode : 'variable',
|
||||
timeFormat : 'h(:mm)tt',
|
||||
header : {
|
||||
left : 'prev,next today',
|
||||
center: 'title',
|
||||
right : 'month,basicWeek'
|
||||
},
|
||||
buttonText : {
|
||||
prev: '<i class="icon-arrow-left"></i>',
|
||||
next: '<i class="icon-arrow-right"></i>'
|
||||
},
|
||||
events : this.getEvents,
|
||||
eventRender : function (event, element) {
|
||||
$(element).addClass(event.statusLevel);
|
||||
$(element).children('.fc-event-inner').addClass(event.statusLevel);
|
||||
|
||||
onShow: function () {
|
||||
this.$('.fc-button-today').click();
|
||||
},
|
||||
element.popover({
|
||||
title : '{seriesTitle} - {season}x{episode} - {episodeTitle}'.assign({
|
||||
seriesTitle : event.title,
|
||||
season : event.seasonNumber,
|
||||
episode : event.episodeNumber.pad(2),
|
||||
episodeTitle: event.episodeTitle
|
||||
}),
|
||||
content : event.overview,
|
||||
placement: 'bottom',
|
||||
trigger : 'manual'
|
||||
});
|
||||
},
|
||||
eventMouseover: function () {
|
||||
$(this).popover('show');
|
||||
},
|
||||
eventMouseout : function () {
|
||||
$(this).popover('hide');
|
||||
}
|
||||
});
|
||||
|
||||
getEvents: function (start, end, callback) {
|
||||
var bbView = NzbDrone.Calendar.CalendarView.Instance;
|
||||
_instance = this;
|
||||
},
|
||||
|
||||
var startDate = Date.create(start).format(Date.ISO8601_DATETIME);
|
||||
var endDate = Date.create(end).format(Date.ISO8601_DATETIME);
|
||||
onShow: function () {
|
||||
this.$('.fc-button-today').click();
|
||||
},
|
||||
|
||||
bbView.collection.fetch({
|
||||
data : { start: startDate, end: endDate },
|
||||
success: function (calendarCollection) {
|
||||
_.each(calendarCollection.models, function (element) {
|
||||
var episodeTitle = element.get('title');
|
||||
var seriesTitle = element.get('series').get('title');
|
||||
var start = element.get('airDate');
|
||||
getEvents: function (start, end, callback) {
|
||||
var startDate = Date.create(start).format(Date.ISO8601_DATETIME);
|
||||
var endDate = Date.create(end).format(Date.ISO8601_DATETIME);
|
||||
|
||||
element.set('title', seriesTitle);
|
||||
element.set('episodeTitle', episodeTitle);
|
||||
element.set('start', start);
|
||||
element.set('allDay', false);
|
||||
});
|
||||
_instance.collection.fetch({
|
||||
data : { start: startDate, end: endDate },
|
||||
success: function (calendarCollection) {
|
||||
_.each(calendarCollection.models, function (element) {
|
||||
var episodeTitle = element.get('title');
|
||||
var seriesTitle = element.get('series').get('title');
|
||||
var start = element.get('airDate');
|
||||
|
||||
callback(calendarCollection.toJSON());
|
||||
}
|
||||
});
|
||||
}
|
||||
element.set('title', seriesTitle);
|
||||
element.set('episodeTitle', episodeTitle);
|
||||
element.set('start', start);
|
||||
element.set('allDay', false);
|
||||
});
|
||||
|
||||
callback(calendarCollection.toJSON());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,13 +1,17 @@
|
||||
'use strict';
|
||||
define(['app', 'Series/EpisodeModel'], function () {
|
||||
NzbDrone.Calendar.Collection = Backbone.Collection.extend({
|
||||
url : NzbDrone.Constants.ApiRoot + '/calendar',
|
||||
model : NzbDrone.Series.EpisodeModel,
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Series/EpisodeModel'
|
||||
], function (Backbone, EpisodeModel) {
|
||||
return Backbone.Collection.extend({
|
||||
url : window.ApiRoot + '/calendar',
|
||||
model: EpisodeModel,
|
||||
|
||||
comparator: function(model) {
|
||||
var date = new Date(model.get('airDate'));
|
||||
var time = date.getTime();
|
||||
return time;
|
||||
}
|
||||
comparator: function (model) {
|
||||
var date = new Date(model.get('airDate'));
|
||||
var time = date.getTime();
|
||||
return time;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,13 +1,17 @@
|
||||
'use strict';
|
||||
define(['app', 'Series/EpisodeModel'], function () {
|
||||
NzbDrone.Calendar.UpcomingCollection = Backbone.Collection.extend({
|
||||
url : NzbDrone.Constants.ApiRoot + '/calendar',
|
||||
model : NzbDrone.Series.EpisodeModel,
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Series/EpisodeModel'
|
||||
], function (Backbone, EpisodeModel) {
|
||||
return Backbone.Collection.extend({
|
||||
url : window.ApiRoot + '/calendar',
|
||||
model: EpisodeModel,
|
||||
|
||||
comparator: function(model) {
|
||||
var date = new Date(model.get('airDate'));
|
||||
var time = date.getTime();
|
||||
return time;
|
||||
}
|
||||
comparator: function (model) {
|
||||
var date = new Date(model.get('airDate'));
|
||||
var time = date.getTime();
|
||||
return time;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,7 +1,11 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define(['app', 'Calendar/UpcomingItemView'], function () {
|
||||
NzbDrone.Calendar.UpcomingCollectionView = Backbone.Marionette.CollectionView.extend({
|
||||
itemView: NzbDrone.Calendar.UpcomingItemView
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Calendar/UpcomingItemView'
|
||||
], function (Marionette, UpcomingItemView) {
|
||||
return Marionette.CollectionView.extend({
|
||||
itemView: UpcomingItemView
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,12 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'app',
|
||||
'Calendar/UpcomingCollection'
|
||||
|
||||
], function () {
|
||||
NzbDrone.Calendar.UpcomingItemView = Backbone.Marionette.ItemView.extend({
|
||||
template : 'Calendar/UpcomingItemTemplate',
|
||||
tagName : 'div'
|
||||
define(
|
||||
[
|
||||
'marionette'
|
||||
], function (Marionette) {
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'Calendar/UpcomingItemTemplate',
|
||||
tagName : 'div'
|
||||
});
|
||||
});
|
||||
});
|
@ -1,121 +1,121 @@
|
||||
.calendar {
|
||||
th, td {
|
||||
border-color: #eeeeee;
|
||||
border-color : #eeeeee;
|
||||
}
|
||||
|
||||
.primary {
|
||||
border-color: #007ccd;
|
||||
background-color: #007ccd;
|
||||
border-color : #007ccd;
|
||||
background-color : #007ccd;
|
||||
}
|
||||
|
||||
.fc-event-skin {
|
||||
background-color: #007ccd;
|
||||
border: 1px solid #007ccd;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
background-color : #007ccd;
|
||||
border : 1px solid #007ccd;
|
||||
border-radius : 4px;
|
||||
text-align : center;
|
||||
}
|
||||
|
||||
.info {
|
||||
border-color: #14b8d4;
|
||||
background-color: #14b8d4;
|
||||
border-color : #14b8d4;
|
||||
background-color : #14b8d4;
|
||||
}
|
||||
|
||||
.inverse {
|
||||
border-color: #333333;
|
||||
background-color: #333333;
|
||||
border-color : #333333;
|
||||
background-color : #333333;
|
||||
}
|
||||
|
||||
.warning {
|
||||
border-color: #ffa93c;
|
||||
background-color: #ffa93c;
|
||||
border-color : #ffa93c;
|
||||
background-color : #ffa93c;
|
||||
}
|
||||
|
||||
.danger {
|
||||
border-color: #ea494a;
|
||||
background-color: #ea494a;
|
||||
border-color : #ea494a;
|
||||
background-color : #ea494a;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #eeeeee;
|
||||
background-color : #eeeeee;
|
||||
}
|
||||
|
||||
.purple {
|
||||
border-color: #7932ea;
|
||||
background-color: #7932ea;
|
||||
border-color : #7932ea;
|
||||
background-color : #7932ea;
|
||||
}
|
||||
|
||||
.success {
|
||||
border-color: #4cb158;
|
||||
background-color: #4cb158;
|
||||
border-color : #4cb158;
|
||||
background-color : #4cb158;
|
||||
}
|
||||
h2 {
|
||||
font-size: 17.5px;
|
||||
font-size : 17.5px;
|
||||
}
|
||||
}
|
||||
|
||||
.event {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
border-top: 1px solid #eeeeee;
|
||||
padding-top: 10px;
|
||||
display : inline-block;
|
||||
width : 100%;
|
||||
margin-bottom : 10px;
|
||||
border-top : 1px solid #eeeeee;
|
||||
padding-top : 10px;
|
||||
|
||||
.primary {
|
||||
border-color: #007ccd;
|
||||
border-color : #007ccd;
|
||||
}
|
||||
|
||||
.info {
|
||||
border-color: #14b8d4;
|
||||
border-color : #14b8d4;
|
||||
}
|
||||
|
||||
h4 {
|
||||
text-transform: none !important;
|
||||
font-weight: 500;
|
||||
color: #008dcd;
|
||||
margin: 5px 0px;
|
||||
text-transform : none !important;
|
||||
font-weight : 500;
|
||||
color : #008dcd;
|
||||
margin : 5px 0px;
|
||||
}
|
||||
|
||||
.inverse {
|
||||
border-color: #333333;
|
||||
border-color : #333333;
|
||||
}
|
||||
|
||||
.warning {
|
||||
border-color: #ffa93c;
|
||||
border-color : #ffa93c;
|
||||
}
|
||||
|
||||
p {
|
||||
color: #999999;
|
||||
color : #999999;
|
||||
}
|
||||
|
||||
.danger {
|
||||
border-color: #ea494a;
|
||||
border-color : #ea494a;
|
||||
}
|
||||
|
||||
.date {
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
border-left: 4px solid #eeeeee;
|
||||
padding-left: 16px;
|
||||
float: left;
|
||||
margin-right: 20px;
|
||||
text-align : center;
|
||||
display : inline-block;
|
||||
border-left : 4px solid #eeeeee;
|
||||
padding-left : 16px;
|
||||
float : left;
|
||||
margin-right : 20px;
|
||||
|
||||
h4 {
|
||||
line-height: 1em;
|
||||
color: #555555;
|
||||
font-weight: 300;
|
||||
line-height : 1em;
|
||||
color : #555555;
|
||||
font-weight : 300;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-weight: 500;
|
||||
line-height: 0.8em;
|
||||
font-weight : 500;
|
||||
line-height : 0.8em;
|
||||
}
|
||||
}
|
||||
|
||||
.purple {
|
||||
border-color: #7932ea;
|
||||
border-color : #7932ea;
|
||||
}
|
||||
|
||||
.success {
|
||||
border-color: #4cb158;
|
||||
border-color : #4cb158;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,19 @@
|
||||
'use strict';
|
||||
define(['app', 'Shared/FormatHelpers', 'Cells/NzbDroneCell'], function () {
|
||||
return NzbDrone.Cells.NzbDroneCell.extend({
|
||||
className: 'air-date-cell',
|
||||
define(
|
||||
[
|
||||
'backgrid',
|
||||
'Shared/FormatHelpers'
|
||||
], function (Backgrid, FormatHelpers) {
|
||||
return Backgrid.Cell.extend({
|
||||
className: 'air-date-cell',
|
||||
|
||||
render: function () {
|
||||
render: function () {
|
||||
|
||||
this.$el.empty();
|
||||
var airDate = this.model.get(this.column.get('name'));
|
||||
this.$el.html(NzbDrone.Shared.FormatHelpers.DateHelper(airDate));
|
||||
return this;
|
||||
this.$el.empty();
|
||||
var airDate = this.model.get(this.column.get('name'));
|
||||
this.$el.html(FormatHelpers.DateHelper(airDate));
|
||||
return this;
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,49 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
define(['app', 'Cells/NzbDroneCell'], function () {
|
||||
return NzbDrone.Cells.NzbDroneCell.extend({
|
||||
define(
|
||||
[
|
||||
'Cells/NzbDroneCell'
|
||||
], function (NzbDroneCell) {
|
||||
return NzbDroneCell.extend({
|
||||
|
||||
className: 'episode-number-cell',
|
||||
className: 'episode-number-cell',
|
||||
|
||||
render: function () {
|
||||
render: function () {
|
||||
|
||||
this.$el.empty();
|
||||
this.$el.empty();
|
||||
|
||||
var airDateField = this.column.get('airDate') || 'airDate';
|
||||
var seasonField = this.column.get('seasonNumber') || 'seasonNumber';
|
||||
var episodeField = this.column.get('episodes') || 'episodeNumber';
|
||||
var airDateField = this.column.get('airDate') || 'airDate';
|
||||
var seasonField = this.column.get('seasonNumber') || 'seasonNumber';
|
||||
var episodeField = this.column.get('episodes') || 'episodeNumber';
|
||||
|
||||
if (this.cellValue) {
|
||||
if (this.cellValue) {
|
||||
|
||||
var airDate = this.cellValue.get(airDateField);
|
||||
var seasonNumber = this.cellValue.get(seasonField);
|
||||
var episodes = this.cellValue.get(episodeField);
|
||||
var airDate = this.cellValue.get(airDateField);
|
||||
var seasonNumber = this.cellValue.get(seasonField);
|
||||
var episodes = this.cellValue.get(episodeField);
|
||||
|
||||
var result = 'Unknown';
|
||||
var result = 'Unknown';
|
||||
|
||||
if (episodes) {
|
||||
if (episodes) {
|
||||
|
||||
var paddedEpisodes;
|
||||
var paddedEpisodes;
|
||||
|
||||
if (episodes.constructor === Array) {
|
||||
paddedEpisodes = _.map(episodes,function (episodeNumber) {
|
||||
return episodeNumber.pad(2);
|
||||
}).join();
|
||||
if (episodes.constructor === Array) {
|
||||
paddedEpisodes = _.map(episodes,function (episodeNumber) {
|
||||
return episodeNumber.pad(2);
|
||||
}).join();
|
||||
}
|
||||
else {
|
||||
paddedEpisodes = episodes.pad(2);
|
||||
}
|
||||
|
||||
result = 'S{0}-E{1}'.format(seasonNumber.pad(2), paddedEpisodes);
|
||||
}
|
||||
else {
|
||||
paddedEpisodes = episodes.pad(2);
|
||||
else if (airDate) {
|
||||
result = new Date(airDate).toLocaleDateString();
|
||||
}
|
||||
|
||||
result = 'S{0}-E{1}'.format(seasonNumber.pad(2), paddedEpisodes);
|
||||
this.$el.html(result);
|
||||
}
|
||||
else if (airDate) {
|
||||
result = new Date(airDate).toLocaleDateString();
|
||||
}
|
||||
|
||||
this.$el.html(result);
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,34 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
define(['app','cells/nzbdronecell' ], function () {
|
||||
return NzbDrone.Cells.NzbDroneCell.extend({
|
||||
define(
|
||||
[
|
||||
'backgrid'
|
||||
], function (Backgrid) {
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
className: 'episode-status-cell',
|
||||
className: 'episode-status-cell',
|
||||
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
|
||||
if (this.model) {
|
||||
if (this.model) {
|
||||
|
||||
var icon;
|
||||
var icon;
|
||||
|
||||
if (this.model.get('episodeFile')) {
|
||||
icon = 'icon-ok';
|
||||
if (this.model.get('episodeFile')) {
|
||||
icon = 'icon-ok';
|
||||
|
||||
}
|
||||
else {
|
||||
if (this.model.get('hasAired')) {
|
||||
icon = 'icon-warning-sign';
|
||||
}
|
||||
else {
|
||||
icon = 'icon-time';
|
||||
if (this.model.get('hasAired')) {
|
||||
icon = 'icon-warning-sign';
|
||||
}
|
||||
else {
|
||||
icon = 'icon-time';
|
||||
}
|
||||
}
|
||||
|
||||
this.$el.html('<i class="{0}"/>'.format(icon));
|
||||
}
|
||||
|
||||
this.$el.html('<i class="{0}"/>'.format(icon));
|
||||
return this;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,22 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
define(['app', 'Cells/NzbDroneCell'], function () {
|
||||
return NzbDrone.Cells.NzbDroneCell.extend({
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'Cells/NzbDroneCell',
|
||||
'Episode/Layout'
|
||||
], function (App, NzbDroneCell, EpisodeLayout) {
|
||||
return NzbDroneCell.extend({
|
||||
|
||||
className: 'episode-title-cell',
|
||||
className: 'episode-title-cell',
|
||||
|
||||
events: {
|
||||
'click': 'showDetails'
|
||||
},
|
||||
events: {
|
||||
'click': 'showDetails'
|
||||
},
|
||||
|
||||
showDetails: function () {
|
||||
var view = new NzbDrone.Episode.Layout({ model: this.cellValue });
|
||||
NzbDrone.modalRegion.show(view);
|
||||
},
|
||||
showDetails: function () {
|
||||
var view = new EpisodeLayout({ model: this.cellValue });
|
||||
App.modalRegion.show(view);
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.$el.html(this.cellValue.get('title'));
|
||||
return this;
|
||||
}
|
||||
render: function () {
|
||||
this.$el.html(this.cellValue.get('title'));
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,15 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
define(['app', 'Shared/FormatHelpers','backgrid'], function () {
|
||||
NzbDrone.Cells.FileSizeCell = Backgrid.Cell.extend({
|
||||
define(
|
||||
[
|
||||
'backgrid',
|
||||
'Shared/FormatHelpers'
|
||||
], function (Backgrid, FormatHelpers) {
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
className: 'file-size-cell',
|
||||
className: 'file-size-cell',
|
||||
|
||||
render: function () {
|
||||
var size = this.model.get(this.column.get('name'));
|
||||
this.$el.html(NzbDrone.Shared.FormatHelpers.FileSizeHelper(size));
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
render: function () {
|
||||
var size = this.model.get(this.column.get('name'));
|
||||
this.$el.html(FormatHelpers.FileSizeHelper(size));
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,13 +1,16 @@
|
||||
'use strict';
|
||||
define(['app','backgrid'], function () {
|
||||
NzbDrone.Cells.IndexerCell = Backgrid.Cell.extend({
|
||||
define(
|
||||
[
|
||||
'backgrid'
|
||||
], function (Backgrid) {
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
class : 'indexer-cell',
|
||||
class : 'indexer-cell',
|
||||
|
||||
render: function () {
|
||||
var indexer = this.model.get(this.column.get('name'));
|
||||
this.$el.html(indexer);
|
||||
return this;
|
||||
}
|
||||
render: function () {
|
||||
var indexer = this.model.get(this.column.get('name'));
|
||||
this.$el.html(indexer);
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,44 +1,47 @@
|
||||
'use strict';
|
||||
|
||||
define(['app','backgrid'], function () {
|
||||
NzbDrone.Cells.NzbDroneCell = Backgrid.Cell.extend({
|
||||
define(
|
||||
[
|
||||
'backgrid'
|
||||
], function (Backgrid) {
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
_originalInit: Backgrid.Cell.prototype.initialize,
|
||||
_originalInit: Backgrid.Cell.prototype.initialize,
|
||||
|
||||
|
||||
initialize: function () {
|
||||
this._originalInit.apply(this, arguments);
|
||||
this.cellValue = this._getValue();
|
||||
initialize: function () {
|
||||
this._originalInit.apply(this, arguments);
|
||||
this.cellValue = this._getValue();
|
||||
|
||||
this.listenTo(this.model, 'change', this._refresh);
|
||||
},
|
||||
this.listenTo(this.model, 'change', this._refresh);
|
||||
},
|
||||
|
||||
_refresh: function () {
|
||||
this.cellValue = this._getValue();
|
||||
this.render();
|
||||
},
|
||||
_refresh: function () {
|
||||
this.cellValue = this._getValue();
|
||||
this.render();
|
||||
},
|
||||
|
||||
_getValue: function () {
|
||||
_getValue: function () {
|
||||
|
||||
var name = this.column.get('name');
|
||||
var name = this.column.get('name');
|
||||
|
||||
if (name === 'this') {
|
||||
return this.model;
|
||||
if (name === 'this') {
|
||||
return this.model;
|
||||
}
|
||||
|
||||
var value = this.model.get(name);
|
||||
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
//if not a model
|
||||
if (!value.get && typeof value === 'object') {
|
||||
value = new Backbone.Model(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
var value = this.model.get(name);
|
||||
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
//if not a model
|
||||
if (!value.get && typeof value === 'object') {
|
||||
value = new Backbone.Model(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,9 +1,12 @@
|
||||
'use strict';
|
||||
define(['app', 'Cells/TemplatedCell'], function (App, TemplatedCell) {
|
||||
return TemplatedCell.extend({
|
||||
define(
|
||||
[
|
||||
'Cells/TemplatedCell'
|
||||
], function (TemplatedCell) {
|
||||
return TemplatedCell.extend({
|
||||
|
||||
className: 'quality-cell',
|
||||
template : 'Cells/QualityTemplate'
|
||||
className: 'quality-cell',
|
||||
template : 'Cells/QualityTemplate'
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,15 +1,18 @@
|
||||
'use strict';
|
||||
define(['app','Cells/NzbDroneCell'], function () {
|
||||
return NzbDrone.Cells.NzbDroneCell.extend({
|
||||
define(
|
||||
[
|
||||
'Cells/NzbDroneCell'
|
||||
], function (NzbDroneCell) {
|
||||
return NzbDroneCell.extend({
|
||||
|
||||
className : 'relative-date-cell',
|
||||
className: 'relative-date-cell',
|
||||
|
||||
render: function () {
|
||||
render: function () {
|
||||
|
||||
var date = this.model.get(this.column.get('name'));
|
||||
this.$el.html(Date.create(date).relative());
|
||||
var date = this.model.get(this.column.get('name'));
|
||||
this.$el.html(Date.create(date).relative());
|
||||
|
||||
return this;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,25 +0,0 @@
|
||||
'use strict';
|
||||
define(['app','cells/nzbdronecell'], function () {
|
||||
return NzbDrone.Cells.NzbDroneCell.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 === 'continuing') {
|
||||
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;
|
||||
}
|
||||
});
|
||||
});
|
@ -1,9 +1,12 @@
|
||||
'use strict';
|
||||
define(['app', 'Cells/TemplatedCell'], function (App, TemplatedCell) {
|
||||
return TemplatedCell.extend({
|
||||
define(
|
||||
[
|
||||
'Cells/TemplatedCell'
|
||||
], function (TemplatedCell) {
|
||||
return TemplatedCell.extend({
|
||||
|
||||
className: 'series-title',
|
||||
template : 'Cells/SeriesTitleTemplate'
|
||||
className: 'series-title',
|
||||
template : 'Cells/SeriesTitleTemplate'
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,17 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
define(['app','Cells/NzbDroneCell'], function () {
|
||||
return NzbDrone.Cells.NzbDroneCell.extend({
|
||||
render: function () {
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Cells/NzbDroneCell'
|
||||
], function (Marionette, NzbDroneCell) {
|
||||
return NzbDroneCell.extend({
|
||||
|
||||
var templateName = this.column.get('template') || this.template;
|
||||
|
||||
this.templateFunction = Marionette.TemplateCache.get(templateName);
|
||||
var data = this.cellValue.toJSON();
|
||||
var html = this.templateFunction(data);
|
||||
this.$el.html(html);
|
||||
render: function () {
|
||||
|
||||
return this;
|
||||
}
|
||||
var templateName = this.column.get('template') || this.template;
|
||||
|
||||
this.templateFunction = Marionette.TemplateCache.get(templateName);
|
||||
var data = this.cellValue.toJSON();
|
||||
var html = this.templateFunction(data);
|
||||
this.$el.html(html);
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,39 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
define(['app', 'Episode/Layout'], function () {
|
||||
return Backgrid.Cell.extend({
|
||||
define(
|
||||
[
|
||||
'backgrid'
|
||||
], function (Backgrid) {
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
className: 'toggle-cell clickable',
|
||||
className: 'toggle-cell clickable',
|
||||
|
||||
events: {
|
||||
'click': '_onClick'
|
||||
},
|
||||
events: {
|
||||
'click': '_onClick'
|
||||
},
|
||||
|
||||
|
||||
_onClick: function () {
|
||||
var name = this.column.get('name');
|
||||
this.model.set(name, !this.model.get(name));
|
||||
this.render();
|
||||
_onClick: function () {
|
||||
var name = this.column.get('name');
|
||||
this.model.set(name, !this.model.get(name));
|
||||
this.render();
|
||||
|
||||
this.model.save();
|
||||
},
|
||||
this.model.save();
|
||||
},
|
||||
|
||||
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
|
||||
|
||||
this.$el.html('<i />');
|
||||
this.$el.html('<i />');
|
||||
|
||||
var name = this.column.get('name');
|
||||
var name = this.column.get('name');
|
||||
|
||||
if (this.model.get(name)) {
|
||||
this.$('i').addClass(this.column.get('trueClass'));
|
||||
if (this.model.get(name)) {
|
||||
this.$('i').addClass(this.column.get('trueClass'));
|
||||
}
|
||||
else {
|
||||
this.$('i').addClass(this.column.get('falseClass'));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
else {
|
||||
this.$('i').addClass(this.column.get('falseClass'));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,17 +1,16 @@
|
||||
'use strict';
|
||||
define(['app'], function () {
|
||||
define({
|
||||
Execute: function (name, properties) {
|
||||
var data = { command: name };
|
||||
|
||||
NzbDrone.Commands.Execute = function (name, properties) {
|
||||
var data = { command: name };
|
||||
if (properties) {
|
||||
$.extend(data, properties);
|
||||
}
|
||||
|
||||
if (properties) {
|
||||
$.extend(data, properties);
|
||||
return $.ajax({
|
||||
type: 'POST',
|
||||
url : window.ApiRoot + '/command',
|
||||
data: JSON.stringify(data)
|
||||
});
|
||||
}
|
||||
|
||||
return $.ajax({
|
||||
type: 'POST',
|
||||
url : NzbDrone.Constants.ApiRoot + '/command',
|
||||
data: JSON.stringify(data)
|
||||
});
|
||||
};
|
||||
});
|
||||
});
|
||||
|
49
UI/Config.js
49
UI/Config.js
@ -2,41 +2,38 @@
|
||||
define(
|
||||
[
|
||||
'app'
|
||||
], function () {
|
||||
|
||||
NzbDrone.Config = {
|
||||
], function (App) {
|
||||
return {
|
||||
Events: {
|
||||
ConfigUpdatedEvent: 'ConfigUpdatedEvent'
|
||||
},
|
||||
Keys : {
|
||||
DefaultQualityProfileId: 'DefaultQualityProfileId'
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
NzbDrone.Config.GetValue = function (key, defaultValue) {
|
||||
GetValue: function (key, defaultValue) {
|
||||
|
||||
var storeValue = localStorage.getItem(key);
|
||||
var storeValue = localStorage.getItem(key);
|
||||
|
||||
if (!storeValue) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return storeValue.toString();
|
||||
},
|
||||
|
||||
SetValue: function (key, value) {
|
||||
|
||||
console.log('Config: [{0}] => [{1}] '.format(key, value));
|
||||
|
||||
if (this.GetValue(key) === value.toString()) {
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.setItem(key, value);
|
||||
App.vent.trigger(this.Events.ConfigUpdatedEvent, {key: key, value: value});
|
||||
|
||||
if (!storeValue) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
return storeValue.toString();
|
||||
};
|
||||
|
||||
NzbDrone.Config.SetValue = function (key, value) {
|
||||
|
||||
console.log('Config: [{0}] => [{1}] '.format(key, value));
|
||||
|
||||
if (NzbDrone.Config.GetValue(key) === value.toString()) {
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.setItem(key, value);
|
||||
NzbDrone.vent.trigger(NzbDrone.Config.Events.ConfigUpdatedEvent, {key: key, value: value});
|
||||
|
||||
};
|
||||
|
||||
return NzbDrone.Config;
|
||||
|
||||
});
|
||||
|
@ -244,10 +244,6 @@ ul.messenger-theme-future {
|
||||
-ms-border-radius: 4px;
|
||||
-o-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #5c5b5b), color-stop(100%, #353535));
|
||||
background-image: -webkit-linear-gradient(#5c5b5b, #353535);
|
||||
background-image: -moz-linear-gradient(#5c5b5b, #353535);
|
||||
|
@ -1,4 +1,4 @@
|
||||
.control-group {
|
||||
.control-group {
|
||||
.controls {
|
||||
i.danger {
|
||||
color: #b94a48;
|
||||
@ -19,6 +19,14 @@
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.help-inline-checkbox {
|
||||
padding-left: 5px;
|
||||
display: inline-block;
|
||||
@ -35,6 +43,8 @@
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
textarea.nzb-restrictions {
|
||||
width: 260px;
|
||||
}
|
||||
}
|
||||
|
@ -1,40 +1,36 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'marionette',
|
||||
'History/HistoryLayout',
|
||||
'Settings/SettingsLayout',
|
||||
'AddSeries/AddSeriesLayout',
|
||||
'Missing/MissingLayout',
|
||||
'History/HistoryLayout',
|
||||
'Form/FormBuilder',
|
||||
'Series/Index/SeriesIndexLayout',
|
||||
'Calendar/CalendarLayout',
|
||||
'Shared/NotificationView',
|
||||
'Shared/NotFoundView',
|
||||
'MainMenuView',
|
||||
'Series/Details/SeriesDetailsLayout',
|
||||
'Series/EpisodeCollection',
|
||||
'Missing/MissingLayout',
|
||||
'Series/SeriesModel',
|
||||
'Calendar/CalendarLayout',
|
||||
'Logs/Layout',
|
||||
'Release/Layout',
|
||||
'Shared/FormatHelpers',
|
||||
'Shared/TemplateHelpers',
|
||||
'Shared/Footer/View'
|
||||
], function (App, SettingsLayout, AddSeriesLayout, MissingLayout, HistoryLayout) {
|
||||
var controller = Backbone.Marionette.Controller.extend({
|
||||
'Shared/NotFoundView'
|
||||
], function (App, Marionette, HistoryLayout, SettingsLayout, AddSeriesLayout, SeriesIndexLayout, SeriesDetailsLayout, MissingLayout, SeriesModel, CalendarLayout, NotFoundView,
|
||||
LogsLayout, ReleaseLayout) {
|
||||
return Marionette.Controller.extend({
|
||||
|
||||
series : function () {
|
||||
this._setTitle('NzbDrone');
|
||||
App.mainRegion.show(new NzbDrone.Series.Index.SeriesIndexLayout());
|
||||
App.mainRegion.show(new SeriesIndexLayout());
|
||||
},
|
||||
seriesDetails: function (query) {
|
||||
|
||||
var self = this;
|
||||
this._setTitle('Loading Series');
|
||||
var series = new NzbDrone.Series.SeriesModel({ id: query });
|
||||
var series = new SeriesModel({ id: query });
|
||||
series.fetch({
|
||||
success: function (seriesModel) {
|
||||
self._setTitle(seriesModel.get('title'));
|
||||
App.mainRegion.show(new NzbDrone.Series.Details.SeriesDetailsLayout({ model: seriesModel }));
|
||||
App.mainRegion.show(new SeriesDetailsLayout({ model: seriesModel }));
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -46,7 +42,7 @@ define(
|
||||
|
||||
calendar: function () {
|
||||
this._setTitle('Calendar');
|
||||
App.mainRegion.show(new NzbDrone.Calendar.CalendarLayout());
|
||||
App.mainRegion.show(new CalendarLayout());
|
||||
},
|
||||
|
||||
|
||||
@ -69,17 +65,17 @@ define(
|
||||
|
||||
rss: function () {
|
||||
this._setTitle('RSS');
|
||||
App.mainRegion.show(new NzbDrone.Release.Layout());
|
||||
App.mainRegion.show(new ReleaseLayout());
|
||||
},
|
||||
|
||||
logs: function () {
|
||||
this._setTitle('logs');
|
||||
App.mainRegion.show(new NzbDrone.Logs.Layout());
|
||||
App.mainRegion.show(new LogsLayout());
|
||||
},
|
||||
|
||||
notFound: function () {
|
||||
this._setTitle('Not Found');
|
||||
App.mainRegion.show(new NzbDrone.Shared.NotFoundView(this));
|
||||
App.mainRegion.show(new NotFoundView(this));
|
||||
},
|
||||
|
||||
|
||||
@ -112,8 +108,5 @@ define(
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return new controller();
|
||||
|
||||
});
|
||||
|
||||
|
@ -1,78 +1,85 @@
|
||||
'use strict';
|
||||
define(['app', 'Shared/SpinnerView', 'Episode/Summary/View', 'Episode/Search/Layout', 'Release/Collection'], function () {
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Episode/Summary/View',
|
||||
'Episode/Search/Layout',
|
||||
'Release/Collection',
|
||||
'Shared/SpinnerView'
|
||||
], function (Marionette, SummaryView, SearchLayout, ReleaseCollection, SpinnerView) {
|
||||
|
||||
NzbDrone.Episode.Layout = Backbone.Marionette.Layout.extend({
|
||||
template: 'Episode/LayoutTemplate',
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Episode/LayoutTemplate',
|
||||
|
||||
|
||||
regions: {
|
||||
summary : '#episode-summary',
|
||||
activity: '#episode-activity',
|
||||
search : '#episode-search'
|
||||
},
|
||||
regions: {
|
||||
summary : '#episode-summary',
|
||||
activity: '#episode-activity',
|
||||
search : '#episode-search'
|
||||
},
|
||||
|
||||
ui: {
|
||||
summary : '.x-episode-summary',
|
||||
activity: '.x-episode-activity',
|
||||
search : '.x-episode-search'
|
||||
},
|
||||
ui: {
|
||||
summary : '.x-episode-summary',
|
||||
activity: '.x-episode-activity',
|
||||
search : '.x-episode-search'
|
||||
},
|
||||
|
||||
events: {
|
||||
events: {
|
||||
|
||||
'click .x-episode-summary' : 'showSummary',
|
||||
'click .x-episode-activity': 'showActivity',
|
||||
'click .x-episode-search' : 'showSearch'
|
||||
},
|
||||
'click .x-episode-summary' : 'showSummary',
|
||||
'click .x-episode-activity': 'showActivity',
|
||||
'click .x-episode-search' : 'showSearch'
|
||||
},
|
||||
|
||||
|
||||
onShow: function () {
|
||||
this.showSummary();
|
||||
this._releaseSearchActivated = false;
|
||||
},
|
||||
onShow: function () {
|
||||
this.showSummary();
|
||||
this._releaseSearchActivated = false;
|
||||
},
|
||||
|
||||
|
||||
showSummary: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
this.ui.summary.tab('show');
|
||||
this.summary.show(new NzbDrone.Episode.Summary.View({model: this.model}));
|
||||
|
||||
},
|
||||
|
||||
showActivity: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
this.ui.activity.tab('show');
|
||||
},
|
||||
|
||||
showSearch: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
if (this._releaseSearchActivated) {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
this.ui.search.tab('show');
|
||||
this.search.show(new NzbDrone.Shared.SpinnerView());
|
||||
|
||||
var releases = new NzbDrone.Release.Collection();
|
||||
var promise = releases.fetchEpisodeReleases(this.model.id);
|
||||
|
||||
promise.done(function () {
|
||||
if (!self.isClosed) {
|
||||
self.search.show(new NzbDrone.Episode.Search.Layout({collection: releases}));
|
||||
showSummary: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.ui.summary.tab('show');
|
||||
this.summary.show(new SummaryView({model: this.model}));
|
||||
|
||||
},
|
||||
|
||||
showActivity: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
this.ui.activity.tab('show');
|
||||
},
|
||||
|
||||
showSearch: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
if (this._releaseSearchActivated) {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
this.ui.search.tab('show');
|
||||
this.search.show(new SpinnerView());
|
||||
|
||||
var releases = new ReleaseCollection();
|
||||
var promise = releases.fetchEpisodeReleases(this.model.id);
|
||||
|
||||
promise.done(function () {
|
||||
if (!self.isClosed) {
|
||||
self.search.show(new SearchLayout({collection: releases}));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -1,68 +1,70 @@
|
||||
'use strict';
|
||||
define([
|
||||
'app',
|
||||
'Cells/FileSizeCell',
|
||||
'Cells/QualityCell',
|
||||
'Release/ApprovalStatusCell',
|
||||
'Release/DownloadReportCell'
|
||||
], function () {
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'Cells/FileSizeCell',
|
||||
'Cells/QualityCell',
|
||||
'Release/ApprovalStatusCell',
|
||||
'Release/DownloadReportCell'
|
||||
], function (Marionette, Backgrid, FileSizeCell, QualityCell, ApprovalStatusCell, DownloadReportCell) {
|
||||
|
||||
NzbDrone.Episode.Search.Layout = Backbone.Marionette.Layout.extend({
|
||||
template: 'Episode/Search/LayoutTemplate',
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Episode/Search/LayoutTemplate',
|
||||
|
||||
regions: {
|
||||
grid: '#episode-release-grid'
|
||||
},
|
||||
|
||||
columns: [
|
||||
{
|
||||
name : 'age',
|
||||
label : 'Age',
|
||||
sortable: true,
|
||||
cell : Backgrid.IntegerCell
|
||||
},
|
||||
{
|
||||
name : 'title',
|
||||
label : 'Title',
|
||||
sortable: true,
|
||||
cell : Backgrid.StringCell
|
||||
},
|
||||
{
|
||||
name : 'size',
|
||||
label : 'Size',
|
||||
sortable: true,
|
||||
cell : NzbDrone.Cells.FileSizeCell
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label : 'Quality',
|
||||
sortable: true,
|
||||
cell : NzbDrone.Cells.QualityCell
|
||||
regions: {
|
||||
grid: '#episode-release-grid'
|
||||
},
|
||||
|
||||
{
|
||||
name : 'rejections',
|
||||
label: 'decision',
|
||||
cell : NzbDrone.Release.ApprovalStatusCell
|
||||
},
|
||||
{
|
||||
name : 'download',
|
||||
label: '',
|
||||
cell : NzbDrone.Release.DownloadReportCell
|
||||
}
|
||||
],
|
||||
|
||||
onShow: function () {
|
||||
if (!this.isClosed) {
|
||||
this.grid.show(new Backgrid.Grid(
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name : 'age',
|
||||
label : 'Age',
|
||||
sortable: true,
|
||||
cell : Backgrid.IntegerCell
|
||||
},
|
||||
{
|
||||
name : 'title',
|
||||
label : 'Title',
|
||||
sortable: true,
|
||||
cell : Backgrid.StringCell
|
||||
},
|
||||
{
|
||||
name : 'size',
|
||||
label : 'Size',
|
||||
sortable: true,
|
||||
cell : FileSizeCell
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label : 'Quality',
|
||||
sortable: true,
|
||||
cell : QualityCell
|
||||
},
|
||||
|
||||
{
|
||||
name : 'rejections',
|
||||
label: 'decision',
|
||||
cell : ApprovalStatusCell
|
||||
},
|
||||
{
|
||||
name : 'download',
|
||||
label: '',
|
||||
cell : DownloadReportCell
|
||||
}
|
||||
],
|
||||
|
||||
onShow: function () {
|
||||
if (!this.isClosed) {
|
||||
this.grid.show(new Backgrid.Grid({
|
||||
row : Backgrid.Row,
|
||||
columns : this.columns,
|
||||
collection: this.collection,
|
||||
className : 'table table-hover'
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
@ -1,8 +1,11 @@
|
||||
'use strict';
|
||||
define(['app'], function () {
|
||||
define(
|
||||
[
|
||||
'marionette'
|
||||
], function (Marionette) {
|
||||
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'Episode/Summary/ViewTemplate'
|
||||
});
|
||||
|
||||
NzbDrone.Episode.Summary.View = Backbone.Marionette.ItemView.extend({
|
||||
template: 'Episode/Summary/ViewTemplate'
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -1,31 +1,50 @@
|
||||
'use strict';
|
||||
define(['app', 'handlebars'], function (App,Handlebars) {
|
||||
Handlebars.registerHelper('formBuilder', function () {
|
||||
var ret = '';
|
||||
_.each(this.fields, function (field) {
|
||||
ret += NzbDrone.Form.FieldBuilder(field);
|
||||
define(
|
||||
[
|
||||
'handlebars'
|
||||
], function (Handlebars) {
|
||||
|
||||
var formBuilder = function (field) {
|
||||
if (!field.type) {
|
||||
return Handlebars.helpers.partial.apply(field,
|
||||
[
|
||||
'Form/TextboxTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
if (field.type === 'password') {
|
||||
return Handlebars.helpers.partial.apply(field,
|
||||
[
|
||||
'Form/PasswordTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
if (field.type === 'checkbox') {
|
||||
return Handlebars.helpers.partial.apply(field,
|
||||
[
|
||||
'Form/CheckboxTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
if (field.type === 'select') {
|
||||
return Handlebars.helpers.partial.apply(field,
|
||||
[
|
||||
'Form/SelectTemplate'
|
||||
]);
|
||||
}
|
||||
|
||||
return Handlebars.helpers.partial.apply(field,
|
||||
[
|
||||
'Form/TextboxTemplate'
|
||||
]);
|
||||
};
|
||||
|
||||
Handlebars.registerHelper('formBuilder', function () {
|
||||
var ret = '';
|
||||
_.each(this.fields, function (field) {
|
||||
ret += this.FieldBuilder(field);
|
||||
});
|
||||
|
||||
return new Handlebars.SafeString(ret);
|
||||
});
|
||||
|
||||
return new Handlebars.SafeString(ret);
|
||||
});
|
||||
|
||||
NzbDrone.Form.FieldBuilder = function (field) {
|
||||
if (!field.type) {
|
||||
return Handlebars.helpers.partial.apply(field, ['Form/TextboxTemplate']);
|
||||
}
|
||||
|
||||
if (field.type === 'password') {
|
||||
return Handlebars.helpers.partial.apply(field, ['Form/PasswordTemplate']);
|
||||
}
|
||||
|
||||
if (field.type === 'checkbox') {
|
||||
return Handlebars.helpers.partial.apply(field, ['Form/CheckboxTemplate']);
|
||||
}
|
||||
|
||||
if (field.type === 'select') {
|
||||
return Handlebars.helpers.partial.apply(field, ['Form/SelectTemplate']);
|
||||
}
|
||||
|
||||
return Handlebars.helpers.partial.apply(field, ['Form/TextboxTemplate']);
|
||||
};
|
||||
});
|
||||
|
@ -1,30 +1,33 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define(['templates'], function (Templates) {
|
||||
return function () {
|
||||
this.get = function (templateId) {
|
||||
define(
|
||||
[
|
||||
'templates'
|
||||
], function (Templates) {
|
||||
return function () {
|
||||
this.get = function (templateId) {
|
||||
|
||||
var templateKey = templateId.toLowerCase();
|
||||
var templateKey = templateId.toLowerCase();
|
||||
|
||||
var templateFunction = Templates[templateKey];
|
||||
var templateFunction = Templates[templateKey];
|
||||
|
||||
if (!templateFunction) {
|
||||
throw 'couldn\'t find pre-compiled template ' + templateKey;
|
||||
}
|
||||
|
||||
return function (data) {
|
||||
|
||||
try {
|
||||
return templateFunction(data);
|
||||
}
|
||||
catch (error) {
|
||||
console.error('template render failed for ' + templateKey + ' ' + error);
|
||||
console.error(data);
|
||||
throw error;
|
||||
if (!templateFunction) {
|
||||
throw 'couldn\'t find pre-compiled template ' + templateKey;
|
||||
}
|
||||
|
||||
return function (data) {
|
||||
|
||||
try {
|
||||
return templateFunction(data);
|
||||
}
|
||||
catch (error) {
|
||||
console.error('template render failed for ' + templateKey + ' ' + error);
|
||||
console.error(data);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
@ -1,37 +1,41 @@
|
||||
'use strict';
|
||||
define(['app', 'History/Model', 'backbone.pageable'], function (App, HistoryModel, PageableCollection) {
|
||||
return PageableCollection.extend({
|
||||
url : NzbDrone.Constants.ApiRoot + '/history',
|
||||
model : NzbDrone.History.Model,
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'History/Model',
|
||||
'backbone.pageable'
|
||||
], function ( HistoryModel, PageableCollection) {
|
||||
return PageableCollection.extend({
|
||||
url : window.ApiRoot + '/history',
|
||||
model: HistoryModel,
|
||||
|
||||
state: {
|
||||
pageSize: 15,
|
||||
sortKey: 'date',
|
||||
order: 1
|
||||
},
|
||||
state: {
|
||||
pageSize: 15,
|
||||
sortKey : 'date',
|
||||
order : 1
|
||||
},
|
||||
|
||||
queryParams: {
|
||||
totalPages: null,
|
||||
totalRecords: null,
|
||||
pageSize: 'pageSize',
|
||||
sortKey: 'sortKey',
|
||||
order: 'sortDir',
|
||||
directions: {
|
||||
'-1': 'asc',
|
||||
'1': 'desc'
|
||||
queryParams: {
|
||||
totalPages : null,
|
||||
totalRecords: null,
|
||||
pageSize : 'pageSize',
|
||||
sortKey : 'sortKey',
|
||||
order : 'sortDir',
|
||||
directions : {
|
||||
'-1': 'asc',
|
||||
'1' : 'desc'
|
||||
}
|
||||
},
|
||||
|
||||
parseState: function (resp) {
|
||||
return {totalRecords: resp.totalRecords};
|
||||
},
|
||||
|
||||
parseRecords: function (resp) {
|
||||
if (resp) {
|
||||
return resp.records;
|
||||
}
|
||||
|
||||
return resp;
|
||||
}
|
||||
},
|
||||
|
||||
parseState: function (resp, queryParams, state) {
|
||||
return {totalRecords: resp.totalRecords};
|
||||
},
|
||||
|
||||
parseRecords: function (resp) {
|
||||
if (resp) {
|
||||
return resp.records;
|
||||
}
|
||||
|
||||
return resp;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,41 +1,44 @@
|
||||
'use strict';
|
||||
|
||||
define(['app', 'Cells/NzbDroneCell' ], function () {
|
||||
return NzbDrone.Cells.NzbDroneCell.extend({
|
||||
define(
|
||||
[
|
||||
'Cells/NzbDroneCell'
|
||||
], function (NzbDroneCell) {
|
||||
return NzbDroneCell.extend({
|
||||
|
||||
className: 'history-event-type-cell',
|
||||
className: 'history-event-type-cell',
|
||||
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
|
||||
if (this.cellValue) {
|
||||
if (this.cellValue) {
|
||||
|
||||
var icon;
|
||||
var toolTip;
|
||||
var icon;
|
||||
var toolTip;
|
||||
|
||||
switch (this.cellValue) {
|
||||
case 'grabbed':
|
||||
icon = 'icon-cloud-download';
|
||||
toolTip = 'Episode grabbed from indexer and sent to download client';
|
||||
break;
|
||||
case 'seriesFolderImported':
|
||||
icon = 'icon-hdd';
|
||||
toolTip = 'Existing episode file added to library';
|
||||
break;
|
||||
case 'downloadFolderImported':
|
||||
icon = 'icon-download-alt';
|
||||
toolTip = 'Episode downloaded successfully and picked up from download client';
|
||||
break;
|
||||
default :
|
||||
icon = 'icon-question';
|
||||
toolTip = 'unknown event';
|
||||
switch (this.cellValue) {
|
||||
case 'grabbed':
|
||||
icon = 'icon-cloud-download';
|
||||
toolTip = 'Episode grabbed from indexer and sent to download client';
|
||||
break;
|
||||
case 'seriesFolderImported':
|
||||
icon = 'icon-hdd';
|
||||
toolTip = 'Existing episode file added to library';
|
||||
break;
|
||||
case 'downloadFolderImported':
|
||||
icon = 'icon-download-alt';
|
||||
toolTip = 'Episode downloaded successfully and picked up from download client';
|
||||
break;
|
||||
default :
|
||||
icon = 'icon-question';
|
||||
toolTip = 'unknown event';
|
||||
|
||||
}
|
||||
|
||||
this.$el.html('<i class="{0}" title="{1}"/>'.format(icon, toolTip));
|
||||
}
|
||||
|
||||
this.$el.html('<i class="{0}" title="{1}"/>'.format(icon, toolTip));
|
||||
return this;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,33 +1,19 @@
|
||||
'use strict';
|
||||
define([
|
||||
'app',
|
||||
'History/Collection',
|
||||
'History/EventTypeCell',
|
||||
'Cells/RelativeDateCell',
|
||||
'Cells/TemplatedCell',
|
||||
'Cells/SeriesTitleCell',
|
||||
'Cells/EpisodeNumberCell',
|
||||
'Cells/EpisodeTitleCell',
|
||||
'Cells/QualityCell',
|
||||
'Shared/Toolbar/ToolbarLayout',
|
||||
'Shared/Grid/Pager',
|
||||
'Shared/Grid/HeaderCell',
|
||||
'Shared/LoadingView'
|
||||
],
|
||||
function (App,
|
||||
HistoryCollection,
|
||||
EventTypeCell,
|
||||
RelativeDateCell,
|
||||
TemplatedCell,
|
||||
SeriesTitleCell,
|
||||
EpisodeNumberCell,
|
||||
EpisodeTitleCell,
|
||||
QualityCell,
|
||||
ToolbarLayout,
|
||||
Pager,
|
||||
HeaderCell,
|
||||
LoadingView) {
|
||||
return Backbone.Marionette.Layout.extend({
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'History/Collection',
|
||||
'History/EventTypeCell',
|
||||
'Cells/SeriesTitleCell',
|
||||
'Cells/EpisodeNumberCell',
|
||||
'Cells/EpisodeTitleCell',
|
||||
'Cells/QualityCell',
|
||||
'Cells/RelativeDateCell',
|
||||
'Shared/Grid/Pager',
|
||||
'Shared/LoadingView'
|
||||
], function (Marionette, Backgrid, HistoryCollection, EventTypeCell, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, QualityCell, RelativeDateCell, GridPager, LoadingView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'History/HistoryLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
@ -36,54 +22,53 @@ define([
|
||||
pager : '#x-pager'
|
||||
},
|
||||
|
||||
columns: [
|
||||
{
|
||||
name: 'eventType',
|
||||
label:'',
|
||||
cell : EventTypeCell
|
||||
},
|
||||
{
|
||||
name : 'series',
|
||||
label : 'Series',
|
||||
cell : SeriesTitleCell
|
||||
},
|
||||
{
|
||||
name : 'episode',
|
||||
label : 'Episode',
|
||||
sortable: false,
|
||||
cell : EpisodeNumberCell
|
||||
},
|
||||
{
|
||||
name : 'episode',
|
||||
label : 'Episode Title',
|
||||
sortable: false,
|
||||
cell : EpisodeTitleCell
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label : 'Quality',
|
||||
cell : QualityCell
|
||||
},
|
||||
{
|
||||
name : 'date',
|
||||
label: 'Date',
|
||||
cell : RelativeDateCell
|
||||
}
|
||||
],
|
||||
|
||||
_showTable: function () {
|
||||
|
||||
this.history.show(new Backgrid.Grid(
|
||||
columns:
|
||||
[
|
||||
{
|
||||
row : NzbDrone.History.Row,
|
||||
columns : this.columns,
|
||||
collection: this.historyCollection,
|
||||
className : 'table table-hover'
|
||||
}));
|
||||
name : 'eventType',
|
||||
label: '',
|
||||
cell : EventTypeCell
|
||||
},
|
||||
{
|
||||
name : 'series',
|
||||
label: 'Series',
|
||||
cell : SeriesTitleCell
|
||||
},
|
||||
{
|
||||
name : 'episode',
|
||||
label : 'Episode',
|
||||
sortable: false,
|
||||
cell : EpisodeNumberCell
|
||||
},
|
||||
{
|
||||
name : 'episode',
|
||||
label : 'Episode Title',
|
||||
sortable: false,
|
||||
cell : EpisodeTitleCell
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label: 'Quality',
|
||||
cell : QualityCell
|
||||
},
|
||||
{
|
||||
name : 'date',
|
||||
label: 'Date',
|
||||
cell : RelativeDateCell
|
||||
}
|
||||
],
|
||||
|
||||
this.pager.show(new Pager({
|
||||
_showTable: function (collection) {
|
||||
|
||||
this.history.show(new Backgrid.Grid({
|
||||
columns : this.columns,
|
||||
collection: this.historyCollection
|
||||
collection: collection,
|
||||
className : 'table table-hover'
|
||||
}));
|
||||
|
||||
this.pager.show(new GridPager({
|
||||
columns : this.columns,
|
||||
collection: collection
|
||||
}));
|
||||
},
|
||||
|
||||
@ -92,16 +77,11 @@ define([
|
||||
|
||||
this.history.show(new LoadingView());
|
||||
|
||||
this.historyCollection = new HistoryCollection();
|
||||
this.historyCollection.fetch()
|
||||
.done(function () {
|
||||
self._showTable();
|
||||
});
|
||||
|
||||
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
|
||||
var collection = new HistoryCollection();
|
||||
collection.fetch().done(function () {
|
||||
self._showTable(collection);
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
})
|
||||
;
|
||||
});
|
||||
});
|
||||
|
@ -1,22 +1,25 @@
|
||||
'use strict';
|
||||
define(['app','Series/SeriesModel', 'Series/EpisodeModel'], function () {
|
||||
NzbDrone.History.Model = Backbone.Model.extend({
|
||||
mutators: {
|
||||
seasonNumber: function () {
|
||||
return this.get('episode').seasonNumber;
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Series/SeriesModel',
|
||||
'Series/EpisodeModel'
|
||||
], function (Backbone, SeriesModel, EpisodeModel) {
|
||||
return Backbone.Model.extend({
|
||||
mutators: {
|
||||
seasonNumber: function () {
|
||||
return this.get('episode').seasonNumber;
|
||||
},
|
||||
|
||||
paddedEpisodeNumber: function () {
|
||||
return this.get('episode').episodeNumber.pad(2);
|
||||
}
|
||||
},
|
||||
|
||||
paddedEpisodeNumber: function () {
|
||||
return this.get('episode').episodeNumber.pad(2);
|
||||
parse: function (model) {
|
||||
model.series = new SeriesModel(model.series);
|
||||
model.episode = new EpisodeModel(model.episode);
|
||||
return model;
|
||||
}
|
||||
},
|
||||
|
||||
parse: function (model) {
|
||||
model.series = new NzbDrone.Series.SeriesModel(model.series);
|
||||
model.episode = new NzbDrone.Series.EpisodeModel(model.episode);
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,28 +1,28 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>NzbDrone</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<link href="/content/font.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/content/bootstrap.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/content/bootstrap.slider.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Content/Font.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Content/Bootstrap.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Content/bootstrap.slider.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Content/Messenger/messenger.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Content/Messenger/messenger.future.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/content/theme.css" rel='stylesheet' type='text/css'>
|
||||
<link href="/Cells/cells.css" rel='stylesheet' type='text/css'>
|
||||
<link href="/content/fullcalendar.css" rel='stylesheet' type='text/css'>
|
||||
<link href="/content/backbone.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/content/backbone.backgrid.filter.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/content/bootstrap.toggle-switch.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/AddSeries/addseries.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/content/menu.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/content/form.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/series/series.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/series/details.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/content/base.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/settings/notifications/notifications.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/settings/indexers/indexers.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/calendar/calendar.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Content/Theme.css" rel='stylesheet' type='text/css'>
|
||||
<link href="/Cells/Cells.css" rel='stylesheet' type='text/css'>
|
||||
<link href="/Content/fullcalendar.css" rel='stylesheet' type='text/css'>
|
||||
<link href="/Content/Backbone.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Content/backbone.backgrid.filter.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Content/bootstrap.toggle-switch.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/AddSeries/Addseries.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Content/menu.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Content/form.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Series/Series.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Series/Details.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Content/Base.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Settings/Notifications/notifications.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Settings/Indexers/indexers.css" rel='stylesheet' type='text/css'/>
|
||||
<link href="/Calendar/Calendar.css" rel='stylesheet' type='text/css'/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="in-sub-nav">
|
||||
|
@ -1,14 +1,6 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
(function () {
|
||||
|
||||
/* var model = new NzbDrone.Shared.NotificationModel();
|
||||
model.set('title','test notification');
|
||||
model.set('message','test message');
|
||||
model.set('level', 'error');
|
||||
this.push(model);
|
||||
*/
|
||||
|
||||
|
||||
if (!window.console) {
|
||||
window.console = {};
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
'use strict';
|
||||
define(['app', 'Logs/Model', 'backbone.pageable'], function (app, SeriesModel, PagableCollection) {
|
||||
NzbDrone.Logs.Collection = PagableCollection.extend({
|
||||
url : NzbDrone.Constants.ApiRoot + '/log',
|
||||
model: NzbDrone.Logs.Model,
|
||||
'use strict';
|
||||
define(['backbone.pageable', 'Logs/Model', ], function (PagableCollection, LogsModel) {
|
||||
return PagableCollection.extend({
|
||||
url : window.ApiRoot + '/log',
|
||||
model: LogsModel,
|
||||
|
||||
state: {
|
||||
pageSize: 50,
|
||||
|
@ -1,12 +1,12 @@
|
||||
'use strict';
|
||||
define([
|
||||
'app',
|
||||
'Logs/Collection',
|
||||
'Shared/Toolbar/ToolbarLayout',
|
||||
'Shared/Grid/Pager'
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'Shared/Grid/Pager',
|
||||
'Logs/Collection'
|
||||
],
|
||||
function () {
|
||||
NzbDrone.Logs.Layout = Backbone.Marionette.Layout.extend({
|
||||
function (Marionette,Backgrid, GridPager, LogCollection) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Logs/LayoutTemplate',
|
||||
|
||||
regions: {
|
||||
@ -51,20 +51,19 @@ define([
|
||||
className : 'table table-hover'
|
||||
}));
|
||||
|
||||
this.pager.show(new NzbDrone.Shared.Grid.Pager({
|
||||
this.pager.show(new GridPager({
|
||||
columns : this.columns,
|
||||
collection: this.collection
|
||||
}));
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
this.collection = new NzbDrone.Logs.Collection();
|
||||
this.collection = new LogCollection();
|
||||
this.collection.fetch();
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
this.showTable();
|
||||
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -1,14 +1,8 @@
|
||||
'use strict';
|
||||
define(['app'], function (app) {
|
||||
NzbDrone.Logs.Model = Backbone.Model.extend({
|
||||
/* mutators: {
|
||||
seasonNumber: function () {
|
||||
return this.get('episode').seasonNumber;
|
||||
},
|
||||
|
||||
paddedEpisodeNumber: function () {
|
||||
return this.get('episode').episodeNumber.pad(2);
|
||||
}
|
||||
}*/
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone'
|
||||
], function (Backbone) {
|
||||
return Backbone.Model.extend({
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
define(['app'], function () {
|
||||
var MainMenuView = Backbone.Marionette.ItemView.extend({
|
||||
'use strict';
|
||||
define(['marionette'], function (Marionette) {
|
||||
var MainMenuView = Marionette.ItemView.extend({
|
||||
events: {
|
||||
'click a': 'onClick'
|
||||
},
|
||||
|
@ -1,37 +1,41 @@
|
||||
'use strict';
|
||||
define(['app', 'Series/EpisodeModel', 'backbone.pageable'], function (app, EpisodeModel, PagableCollection) {
|
||||
return PagableCollection.extend({
|
||||
url : NzbDrone.Constants.ApiRoot + '/missing',
|
||||
model: NzbDrone.Series.EpisodeModel,
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Series/EpisodeModel',
|
||||
'backbone.pageable'
|
||||
], function (EpisodeModel, PagableCollection) {
|
||||
return PagableCollection.extend({
|
||||
url : window.ApiRoot + '/missing',
|
||||
model: EpisodeModel,
|
||||
|
||||
state: {
|
||||
pageSize: 15,
|
||||
sortKey : 'airDate',
|
||||
order : 1
|
||||
},
|
||||
state: {
|
||||
pageSize: 15,
|
||||
sortKey : 'airDate',
|
||||
order : 1
|
||||
},
|
||||
|
||||
queryParams: {
|
||||
totalPages : null,
|
||||
totalRecords: null,
|
||||
pageSize : 'pageSize',
|
||||
sortKey : 'sortKey',
|
||||
order : 'sortDir',
|
||||
directions : {
|
||||
'-1': 'asc',
|
||||
'1' : 'desc'
|
||||
queryParams: {
|
||||
totalPages : null,
|
||||
totalRecords: null,
|
||||
pageSize : 'pageSize',
|
||||
sortKey : 'sortKey',
|
||||
order : 'sortDir',
|
||||
directions : {
|
||||
'-1': 'asc',
|
||||
'1' : 'desc'
|
||||
}
|
||||
},
|
||||
|
||||
parseState: function (resp) {
|
||||
return {totalRecords: resp.totalRecords};
|
||||
},
|
||||
|
||||
parseRecords: function (resp) {
|
||||
if (resp) {
|
||||
return resp.records;
|
||||
}
|
||||
|
||||
return resp;
|
||||
}
|
||||
},
|
||||
|
||||
parseState: function (resp, queryParams, state) {
|
||||
return {totalRecords: resp.totalRecords};
|
||||
},
|
||||
|
||||
parseRecords: function (resp) {
|
||||
if (resp) {
|
||||
return resp.records;
|
||||
}
|
||||
|
||||
return resp;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,29 +1,17 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'Missing/Row',
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'Missing/Collection',
|
||||
'Cells/AirDateCell',
|
||||
'Series/Index/Table/SeriesStatusCell',
|
||||
'Shared/Toolbar/ToolbarLayout',
|
||||
'Cells/SeriesTitleCell',
|
||||
'Cells/EpisodeNumberCell',
|
||||
'Cells/EpisodeTitleCell',
|
||||
'Cells/AirDateCell',
|
||||
'Shared/Grid/Pager',
|
||||
'Shared/LoadingView'
|
||||
], function (App,
|
||||
MissingRow,
|
||||
MissingCollection,
|
||||
AirDateCell,
|
||||
SeriesStatusCell,
|
||||
ToolbarLayout,
|
||||
SeriesTitleCell,
|
||||
EpisodeNumberCell,
|
||||
EpisodeTitleCell,
|
||||
Pager,
|
||||
LoadingView) {
|
||||
return Backbone.Marionette.Layout.extend({
|
||||
], function (Marionette, Backgrid, MissingCollection, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, AirDateCell, GridPager, LoadingView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Missing/MissingLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
@ -53,21 +41,20 @@ define(
|
||||
cell : EpisodeTitleCell
|
||||
},
|
||||
{
|
||||
name : 'airDate',
|
||||
label : 'Air Date',
|
||||
cell : AirDateCell
|
||||
name : 'airDate',
|
||||
label: 'Air Date',
|
||||
cell : AirDateCell
|
||||
}
|
||||
],
|
||||
|
||||
_showTable: function () {
|
||||
this.missing.show(new Backgrid.Grid({
|
||||
row : MissingRow,
|
||||
columns : this.columns,
|
||||
collection: this.missingCollection,
|
||||
className : 'table table-hover'
|
||||
}));
|
||||
columns : this.columns,
|
||||
collection: this.missingCollection,
|
||||
className : 'table table-hover'
|
||||
}));
|
||||
|
||||
this.pager.show(new NzbDrone.Shared.Grid.Pager({
|
||||
this.pager.show(new GridPager({
|
||||
columns : this.columns,
|
||||
collection: this.missingCollection
|
||||
}));
|
||||
@ -80,8 +67,8 @@ define(
|
||||
|
||||
this.missingCollection = new MissingCollection();
|
||||
this.missingCollection.fetch().done(function () {
|
||||
self._showTable();
|
||||
});
|
||||
self._showTable();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1,12 +1,12 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define(['app'], function () {
|
||||
define(function () {
|
||||
|
||||
$.fn.autoComplete = function (resource) {
|
||||
$(this).typeahead({
|
||||
source : function (filter, callback) {
|
||||
$.ajax({
|
||||
url : NzbDrone.Constants.ApiRoot + resource,
|
||||
url : window.ApiRoot + resource,
|
||||
dataType: 'json',
|
||||
type : 'GET',
|
||||
data : { query: filter },
|
||||
@ -16,7 +16,7 @@ define(['app'], function () {
|
||||
});
|
||||
},
|
||||
minLength: 3,
|
||||
items :20
|
||||
items : 20
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -1,49 +1,55 @@
|
||||
'use strict';
|
||||
define(['app', 'signalR'], function () {
|
||||
define(
|
||||
[
|
||||
'signalR'
|
||||
], function () {
|
||||
|
||||
_.extend(Backbone.Collection.prototype, {BindSignalR: function (options) {
|
||||
_.extend(Backbone.Collection.prototype, {BindSignalR: function (options) {
|
||||
|
||||
if (!options || !options.url) {
|
||||
console.assert(this.url, 'url must be provided or collection must have url');
|
||||
options = {
|
||||
url: this.url.replace('api', 'signalr')
|
||||
};
|
||||
}
|
||||
|
||||
var self = this;
|
||||
|
||||
var _getStatus = function (status) {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return 'connecting';
|
||||
case 1:
|
||||
return 'connected';
|
||||
case 2:
|
||||
return 'reconnecting';
|
||||
case 4:
|
||||
return 'disconnected';
|
||||
default:
|
||||
throw 'invalid status ' + status;
|
||||
if (!options || !options.url) {
|
||||
console.assert(this.url, 'url must be provided or collection must have url');
|
||||
options = {
|
||||
url: this.url.replace('api', 'signalr')
|
||||
};
|
||||
}
|
||||
|
||||
};
|
||||
var self = this;
|
||||
|
||||
var _getStatus = function (status) {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return 'connecting';
|
||||
case 1:
|
||||
return 'connected';
|
||||
case 2:
|
||||
return 'reconnecting';
|
||||
case 4:
|
||||
return 'disconnected';
|
||||
default:
|
||||
throw 'invalid status ' + status;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
var connection = $.connection(options.url);
|
||||
var connection = $.connection(options.url);
|
||||
|
||||
connection.stateChanged(function (change) {
|
||||
console.debug('{0} [{1}]'.format(options.url, _getStatus(change.newState)));
|
||||
});
|
||||
connection.stateChanged(function (change) {
|
||||
console.debug('{0} [{1}]'.format(options.url, _getStatus(change.newState)));
|
||||
});
|
||||
|
||||
connection.received(function (model) {
|
||||
console.debug(model);
|
||||
self.fetch();
|
||||
});
|
||||
connection.received(function (model) {
|
||||
console.debug(model);
|
||||
self.fetch();
|
||||
});
|
||||
|
||||
connection.start({ transport: ['longPolling'] });
|
||||
connection.start({ transport:
|
||||
[
|
||||
'longPolling'
|
||||
] });
|
||||
|
||||
return this;
|
||||
}});
|
||||
});
|
||||
return this;
|
||||
}});
|
||||
});
|
||||
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
define(['app', 'Quality/QualitySizeModel'], function () {
|
||||
NzbDrone.Quality.QualitySizeCollection = Backbone.Collection.extend({
|
||||
model: NzbDrone.Quality.QualitySizeModel,
|
||||
url : NzbDrone.Constants.ApiRoot + '/qualitysize'
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Quality/QualitySizeModel'
|
||||
], function (QualitySizeModel) {
|
||||
return Backbone.Collection.extend({
|
||||
model: QualitySizeModel,
|
||||
url : window.ApiRoot + '/qualitysize'
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Quality.QualitySizeCollection;
|
||||
});
|
||||
|
@ -1,18 +1,17 @@
|
||||
'use strict';
|
||||
define(['app'], function () {
|
||||
NzbDrone.Quality.QualitySizeModel = Backbone.Model.extend({
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone'
|
||||
], function (Backbone) {
|
||||
return Backbone.Model.extend({
|
||||
|
||||
initialize: function () {
|
||||
this.validators = {};
|
||||
},
|
||||
|
||||
mutators: {
|
||||
thirtyMinuteSize: function () {
|
||||
return this.get('maxSize') * 30;
|
||||
},
|
||||
sixtyMinuteSize : function () {
|
||||
return this.get('maxSize') * 60;
|
||||
mutators: {
|
||||
thirtyMinuteSize: function () {
|
||||
return this.get('maxSize') * 30;
|
||||
},
|
||||
sixtyMinuteSize : function () {
|
||||
return this.get('maxSize') * 60;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,14 +1,18 @@
|
||||
'use strict';
|
||||
define(['app', 'Quality/QualityProfileModel'], function () {
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Quality/QualityProfileModel'
|
||||
], function (Backbone, QualityProfileModel) {
|
||||
|
||||
var qualityProfileCollection = Backbone.Collection.extend({
|
||||
model: NzbDrone.Quality.QualityProfileModel,
|
||||
url : NzbDrone.Constants.ApiRoot + '/qualityprofiles'
|
||||
var QualityProfileCollection = Backbone.Collection.extend({
|
||||
model: QualityProfileModel,
|
||||
url : window.ApiRoot + '/qualityprofiles'
|
||||
});
|
||||
|
||||
var profiles = new QualityProfileCollection();
|
||||
|
||||
profiles.fetch();
|
||||
|
||||
return profiles;
|
||||
});
|
||||
|
||||
var profiles = new qualityProfileCollection();
|
||||
|
||||
profiles.fetch();
|
||||
|
||||
return profiles;
|
||||
});
|
||||
|
@ -1,12 +1,14 @@
|
||||
'use strict';
|
||||
define(['app', 'backbone.deepmodel'], function (App, DeepModel) {
|
||||
NzbDrone.Quality.QualityProfileModel = DeepModel.DeepModel.extend({
|
||||
|
||||
defaults: {
|
||||
id : null,
|
||||
name : '',
|
||||
cutoff: null
|
||||
}
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone.deepmodel'
|
||||
], function (DeepModel) {
|
||||
return DeepModel.DeepModel.extend({
|
||||
defaults: {
|
||||
id : null,
|
||||
name : '',
|
||||
cutoff: null
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -1,22 +1,26 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backgrid'
|
||||
], function (Backgrid) {
|
||||
|
||||
require(['app', 'backgrid'], function () {
|
||||
NzbDrone.Release.ApprovalStatusCell = Backgrid.Cell.extend({
|
||||
|
||||
className: 'approval-status-cell',
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
render: function () {
|
||||
var rejections = this.model.get(this.column.get('name'));
|
||||
className: 'approval-status-cell',
|
||||
|
||||
var result = '';
|
||||
render: function () {
|
||||
var rejections = this.model.get(this.column.get('name'));
|
||||
|
||||
_.each(rejections, function (reason) {
|
||||
result += reason + ' ';
|
||||
});
|
||||
var result = '';
|
||||
|
||||
this.$el.html(result);
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
_.each(rejections, function (reason) {
|
||||
result += reason + ' ';
|
||||
});
|
||||
|
||||
this.$el.html(result);
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,17 +1,21 @@
|
||||
'use strict';
|
||||
define(['app', 'Release/Model', 'backbone.pageable'], function (app, SeriesModel, PagableCollection) {
|
||||
NzbDrone.Release.Collection = PagableCollection.extend({
|
||||
url : NzbDrone.Constants.ApiRoot + '/release',
|
||||
model: NzbDrone.Release.Model,
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Release/Model',
|
||||
'backbone.pageable'
|
||||
], function (ReleaseModel, PagableCollection) {
|
||||
return PagableCollection.extend({
|
||||
url : window.ApiRoot + '/release',
|
||||
model: ReleaseModel,
|
||||
|
||||
mode: 'client',
|
||||
mode: 'client',
|
||||
|
||||
state: {
|
||||
pageSize: 2000
|
||||
},
|
||||
state: {
|
||||
pageSize: 2000
|
||||
},
|
||||
|
||||
fetchEpisodeReleases: function (episodeId) {
|
||||
return this.fetch({ data: { episodeId: episodeId }});
|
||||
}
|
||||
fetchEpisodeReleases: function (episodeId) {
|
||||
return this.fetch({ data: { episodeId: episodeId }});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,33 +1,32 @@
|
||||
'use strict';
|
||||
|
||||
define(['app','backgrid'], function () {
|
||||
NzbDrone.Release.DownloadReportCell = Backgrid.Cell.extend({
|
||||
define(
|
||||
[
|
||||
'backgrid'
|
||||
], function (Backgrid) {
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
className: 'download-report-cell',
|
||||
className: 'download-report-cell',
|
||||
|
||||
events: {
|
||||
'click': '_onClick'
|
||||
},
|
||||
events: {
|
||||
'click': '_onClick'
|
||||
},
|
||||
|
||||
_onClick: function () {
|
||||
_onClick: function () {
|
||||
|
||||
var self = this;
|
||||
var self = this;
|
||||
|
||||
this.$el.html('<i class =\'icon-spinner icon-spin\' />');
|
||||
this.model.save()
|
||||
.always(function () {
|
||||
self.$el.html('<i class =\'icon-download-alt\' />');
|
||||
});
|
||||
},
|
||||
this.$el.html('<i class =\'icon-spinner icon-spin\' />');
|
||||
this.model.save().always(function () {
|
||||
self.$el.html('<i class =\'icon-download-alt\' />');
|
||||
});
|
||||
},
|
||||
|
||||
render: function () {
|
||||
render: function () {
|
||||
|
||||
this.$el.html('<i class =\'icon-download-alt\' />');
|
||||
return this;
|
||||
this.$el.html('<i class =\'icon-download-alt\' />');
|
||||
return this;
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
return NzbDrone.Release.DownloadReportCell;
|
||||
});
|
||||
|
@ -1,17 +1,17 @@
|
||||
'use strict';
|
||||
define([
|
||||
'app',
|
||||
'Release/Collection',
|
||||
'Release/ApprovalStatusCell',
|
||||
'Shared/SpinnerView',
|
||||
'Shared/Toolbar/ToolbarLayout',
|
||||
'Cells/EpisodeNumberCell',
|
||||
'Cells/FileSizeCell',
|
||||
'Cells/IndexerCell',
|
||||
'Cells/QualityCell'
|
||||
],
|
||||
function () {
|
||||
NzbDrone.Release.Layout = Backbone.Marionette.Layout.extend({
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'Release/Collection',
|
||||
'Cells/IndexerCell',
|
||||
'Cells/EpisodeNumberCell',
|
||||
'Cells/FileSizeCell',
|
||||
'Cells/QualityCell',
|
||||
'Release/ApprovalStatusCell',
|
||||
'Shared/SpinnerView'
|
||||
], function (Marionette, Backgrid, ReleaseCollection, IndexerCell, EpisodeNumberCell, FileSizeCell, QualityCell, ApprovalStatusCell, SpinnerView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Release/LayoutTemplate',
|
||||
|
||||
regions: {
|
||||
@ -19,60 +19,60 @@ define([
|
||||
toolbar: '#x-toolbar'
|
||||
},
|
||||
|
||||
columns: [
|
||||
{
|
||||
name : 'indexer',
|
||||
label : 'Indexer',
|
||||
sortable: true,
|
||||
cell : NzbDrone.Cells.IndexerCell
|
||||
},
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name : 'indexer',
|
||||
label : 'Indexer',
|
||||
sortable: true,
|
||||
cell : IndexerCell
|
||||
},
|
||||
|
||||
{
|
||||
name : 'title',
|
||||
label : 'Title',
|
||||
sortable: true,
|
||||
cell : Backgrid.StringCell
|
||||
},
|
||||
{
|
||||
name : 'episodeNumbers',
|
||||
episodes: 'episodeNumbers',
|
||||
label : 'season',
|
||||
cell : NzbDrone.Cells.EpisodeNumberCell
|
||||
},
|
||||
{
|
||||
name : 'size',
|
||||
label : 'Size',
|
||||
sortable: true,
|
||||
cell : NzbDrone.Cells.FileSizeCell
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label : 'Quality',
|
||||
sortable: true,
|
||||
cell : NzbDrone.Cells.QualityCell
|
||||
},
|
||||
{
|
||||
name : 'title',
|
||||
label : 'Title',
|
||||
sortable: true,
|
||||
cell : Backgrid.StringCell
|
||||
},
|
||||
{
|
||||
name : 'episodeNumbers',
|
||||
episodes: 'episodeNumbers',
|
||||
label : 'season',
|
||||
cell : EpisodeNumberCell
|
||||
},
|
||||
{
|
||||
name : 'size',
|
||||
label : 'Size',
|
||||
sortable: true,
|
||||
cell : FileSizeCell
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label : 'Quality',
|
||||
sortable: true,
|
||||
cell : QualityCell
|
||||
},
|
||||
|
||||
{
|
||||
name : 'rejections',
|
||||
label: 'decision',
|
||||
cell : NzbDrone.Release.ApprovalStatusCell
|
||||
}
|
||||
],
|
||||
{
|
||||
name : 'rejections',
|
||||
label: 'decision',
|
||||
cell : ApprovalStatusCell
|
||||
}
|
||||
],
|
||||
|
||||
showTable: function () {
|
||||
if (!this.isClosed) {
|
||||
this.grid.show(new Backgrid.Grid(
|
||||
{
|
||||
row : Backgrid.Row,
|
||||
columns : this.columns,
|
||||
collection: this.collection,
|
||||
className : 'table table-hover'
|
||||
}));
|
||||
this.grid.show(new Backgrid.Grid({
|
||||
row : Backgrid.Row,
|
||||
columns : this.columns,
|
||||
collection: this.collection,
|
||||
className : 'table table-hover'
|
||||
}));
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
this.collection = new NzbDrone.Release.Collection();
|
||||
this.collection = new ReleaseCollection();
|
||||
this.fetchPromise = this.collection.fetch();
|
||||
},
|
||||
|
||||
@ -80,12 +80,11 @@ define([
|
||||
|
||||
var self = this;
|
||||
|
||||
this.grid.show(new NzbDrone.Shared.SpinnerView());
|
||||
this.grid.show(new SpinnerView());
|
||||
|
||||
this.fetchPromise.done(function () {
|
||||
self.showTable();
|
||||
});
|
||||
//this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({right: [ viewButtons], context: this}));
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
define(['app'], function () {
|
||||
NzbDrone.Release.Model = Backbone.Model.extend({
|
||||
'use strict';
|
||||
define(['backbone'], function (Backbone) {
|
||||
return Backbone.Model.extend({
|
||||
/* mutators: {
|
||||
seasonNumber: function () {
|
||||
return this.get('episode').seasonNumber;
|
||||
|
15
UI/Router.js
15
UI/Router.js
@ -1,4 +1,4 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
require(
|
||||
[
|
||||
'app',
|
||||
@ -7,9 +7,9 @@ require(
|
||||
'jQuery/RouteBinder'
|
||||
], function (App, Marionette, Controller, RouterBinder) {
|
||||
|
||||
NzbDrone.Router = Marionette.AppRouter.extend({
|
||||
var Router = Marionette.AppRouter.extend({
|
||||
|
||||
controller: Controller,
|
||||
controller: new Controller(),
|
||||
appRoutes : {
|
||||
'' : 'series',
|
||||
'series' : 'series',
|
||||
@ -28,17 +28,16 @@ require(
|
||||
}
|
||||
});
|
||||
|
||||
NzbDrone.addInitializer(function () {
|
||||
App.addInitializer(function () {
|
||||
|
||||
NzbDrone.Router = new NzbDrone.Router();
|
||||
App.Router = new Router();
|
||||
Backbone.history.start({ pushState: true });
|
||||
|
||||
RouterBinder.bind(NzbDrone.Router);
|
||||
// NzbDrone.footerRegion.show(new FooterView());
|
||||
RouterBinder.bind(App.Router);
|
||||
});
|
||||
|
||||
|
||||
return NzbDrone.Router;
|
||||
return App.Router;
|
||||
|
||||
});
|
||||
|
||||
|
@ -2,10 +2,10 @@
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'Series/SeriesModel'
|
||||
], function () {
|
||||
'marionette'
|
||||
], function (App, Marionette) {
|
||||
|
||||
NzbDrone.Series.Delete.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'Series/Delete/DeleteSeriesTemplate',
|
||||
|
||||
events: {
|
||||
@ -24,11 +24,8 @@ define(
|
||||
data: { 'deleteFiles': deleteFiles },
|
||||
wait: true
|
||||
}).done(function () {
|
||||
NzbDrone.modalRegion.close();
|
||||
App.modalRegion.close();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return NzbDrone.Series.Delete.DeleteSeriesView;
|
||||
|
||||
});
|
||||
|
@ -1,28 +1,28 @@
|
||||
'use strict';
|
||||
define(['app',
|
||||
'Series/Details/SeasonLayout',
|
||||
'Series/SeasonCollection',
|
||||
'Series/EpisodeCollection'],
|
||||
function (App, SeasonLayout, SeasonCollection, EpisodeCollection) {
|
||||
NzbDrone.Series.Details.SeasonCollectionView = Backbone.Marionette.CollectionView.extend({
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Series/Details/SeasonLayout'
|
||||
], function (Marionette, SeasonLayout) {
|
||||
return Marionette.CollectionView.extend({
|
||||
|
||||
itemView : SeasonLayout,
|
||||
itemView: SeasonLayout,
|
||||
|
||||
initialize: function (options) {
|
||||
initialize: function (options) {
|
||||
|
||||
if (!options.episodeCollection) {
|
||||
throw 'episodeCollection is needed';
|
||||
if (!options.episodeCollection) {
|
||||
throw 'episodeCollection is needed';
|
||||
}
|
||||
|
||||
this.episodeCollection = options.episodeCollection;
|
||||
|
||||
},
|
||||
|
||||
itemViewOptions: function () {
|
||||
return {
|
||||
episodeCollection: this.episodeCollection
|
||||
};
|
||||
}
|
||||
|
||||
this.episodeCollection = options.episodeCollection;
|
||||
|
||||
},
|
||||
|
||||
itemViewOptions: function () {
|
||||
return {
|
||||
episodeCollection: this.episodeCollection
|
||||
};
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,13 +1,17 @@
|
||||
'use strict';
|
||||
define([
|
||||
'app',
|
||||
'Cells/EpisodeStatusCell',
|
||||
'Cells/EpisodeTitleCell',
|
||||
'Cells/AirDateCell',
|
||||
'Cells/ToggleCell',
|
||||
'Shared/Messenger'],
|
||||
function (App, EpisodeStatusCell, EpisodeTitleCell, AirDateCell, ToggleCell, Messenger) {
|
||||
return Backbone.Marionette.Layout.extend({
|
||||
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'Cells/ToggleCell',
|
||||
'Cells/EpisodeTitleCell',
|
||||
'Cells/AirDateCell',
|
||||
'Cells/EpisodeStatusCell',
|
||||
'Commands/CommandController',
|
||||
'Shared/Messenger'
|
||||
], function ( Marionette, Backgrid, ToggleCell, EpisodeTitleCell, AirDateCell, EpisodeStatusCell, CommandController, Messenger) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Series/Details/SeasonLayoutTemplate',
|
||||
|
||||
ui: {
|
||||
@ -22,39 +26,38 @@ define([
|
||||
episodeGrid: '#x-episode-grid'
|
||||
},
|
||||
|
||||
columns: [
|
||||
|
||||
{
|
||||
name : 'ignored',
|
||||
label : '',
|
||||
cell : ToggleCell,
|
||||
trueClass : 'icon-bookmark-empty',
|
||||
falseClass: 'icon-bookmark'
|
||||
},
|
||||
{
|
||||
name : 'episodeNumber',
|
||||
label: '#',
|
||||
cell : Backgrid.IntegerCell.extend({
|
||||
className: 'episode-number-cell'
|
||||
})
|
||||
},
|
||||
|
||||
{
|
||||
name : 'this',
|
||||
label: 'Title',
|
||||
cell : EpisodeTitleCell
|
||||
},
|
||||
{
|
||||
name : 'airDate',
|
||||
label: 'Air Date',
|
||||
cell : AirDateCell
|
||||
} ,
|
||||
{
|
||||
name : 'status',
|
||||
label: 'Status',
|
||||
cell : EpisodeStatusCell
|
||||
}
|
||||
],
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name : 'ignored',
|
||||
label : '',
|
||||
cell : ToggleCell,
|
||||
trueClass : 'icon-bookmark-empty',
|
||||
falseClass: 'icon-bookmark'
|
||||
},
|
||||
{
|
||||
name : 'episodeNumber',
|
||||
label: '#',
|
||||
cell : Backgrid.IntegerCell.extend({
|
||||
className: 'episode-number-cell'
|
||||
})
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label: 'Title',
|
||||
cell : EpisodeTitleCell
|
||||
},
|
||||
{
|
||||
name : 'airDate',
|
||||
label: 'Air Date',
|
||||
cell : AirDateCell
|
||||
} ,
|
||||
{
|
||||
name : 'status',
|
||||
label: 'Status',
|
||||
cell : EpisodeStatusCell
|
||||
}
|
||||
],
|
||||
|
||||
initialize: function (options) {
|
||||
|
||||
@ -66,12 +69,11 @@ define([
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
this.episodeGrid.show(new Backgrid.Grid(
|
||||
{
|
||||
columns : this.columns,
|
||||
collection: this.episodeCollection,
|
||||
className : 'table table-hover season-grid'
|
||||
}));
|
||||
this.episodeGrid.show(new Backgrid.Grid({
|
||||
columns : this.columns,
|
||||
collection: this.episodeCollection,
|
||||
className : 'table table-hover season-grid'
|
||||
}));
|
||||
},
|
||||
|
||||
_seasonSearch: function () {
|
||||
@ -82,12 +84,12 @@ define([
|
||||
this.ui.seasonSearch.addClass('icon-spinner icon-spin');
|
||||
|
||||
var properties = {
|
||||
seriesId: this.model.get('seriesId'),
|
||||
seriesId : this.model.get('seriesId'),
|
||||
seasonNumber: this.model.get('seasonNumber')
|
||||
};
|
||||
|
||||
var self = this;
|
||||
var commandPromise = App.Commands.Execute(command, properties);
|
||||
var commandPromise = CommandController.Execute(command, properties);
|
||||
|
||||
commandPromise.fail(function (options) {
|
||||
if (options.readyState === 0 || options.status === 0) {
|
||||
|
@ -1,6 +1,14 @@
|
||||
'use strict';
|
||||
define(['app', 'Series/Details/SeasonCollectionView', 'Shared/LoadingView','backstrech'], function () {
|
||||
NzbDrone.Series.Details.SeriesDetailsLayout = Backbone.Marionette.Layout.extend({
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Series/EpisodeCollection',
|
||||
'Series/SeasonCollection',
|
||||
'Series/Details/SeasonCollectionView',
|
||||
'Shared/LoadingView',
|
||||
'backstrech'
|
||||
], function (Marionette, EpisodeCollection, SeasonCollection, SeasonCollectionView, LoadingView) {
|
||||
return Marionette.Layout.extend({
|
||||
|
||||
itemViewContainer: '.x-series-seasons',
|
||||
template : 'Series/Details/SeriesDetailsTemplate',
|
||||
@ -27,19 +35,17 @@ define(['app', 'Series/Details/SeasonCollectionView', 'Shared/LoadingView','back
|
||||
$('body').removeClass('backdrop');
|
||||
}
|
||||
|
||||
this.seasons.show(new NzbDrone.Shared.LoadingView());
|
||||
this.seasons.show(new LoadingView());
|
||||
|
||||
this.seasonCollection = new NzbDrone.Series.SeasonCollection();
|
||||
this.episodeCollection = new NzbDrone.Series.EpisodeCollection();
|
||||
this.seasonCollection = new SeasonCollection();
|
||||
this.episodeCollection = new EpisodeCollection();
|
||||
|
||||
$.when(this.episodeCollection.fetch({data: { seriesId: this.model.id }}), this.seasonCollection.fetch({data: { seriesId: this.model.id }}))
|
||||
.done(function () {
|
||||
self.seasons.show(new NzbDrone.Series.Details.SeasonCollectionView({
|
||||
collection : self.seasonCollection,
|
||||
episodeCollection: self.episodeCollection
|
||||
}));
|
||||
}
|
||||
);
|
||||
$.when(this.episodeCollection.fetch({data: { seriesId: this.model.id }}), this.seasonCollection.fetch({data: { seriesId: this.model.id }})).done(function () {
|
||||
self.seasons.show(new SeasonCollectionView({
|
||||
collection : self.seasonCollection,
|
||||
episodeCollection: self.episodeCollection
|
||||
}));
|
||||
});
|
||||
},
|
||||
|
||||
onClose: function () {
|
||||
@ -47,5 +53,4 @@ define(['app', 'Series/Details/SeasonCollectionView', 'Shared/LoadingView','back
|
||||
$('body').removeClass('backdrop');
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@ -1,45 +1,50 @@
|
||||
'use strict';
|
||||
define(['app', 'Series/SeriesModel', 'Series/Delete/DeleteSeriesView', 'Quality/QualityProfileCollection'], function (app, seriesModel, deleteSeriesView, qualityProfiles) {
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'App',
|
||||
'marionette',
|
||||
'Series/Delete/DeleteSeriesView',
|
||||
'Quality/QualityProfileCollection',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (App, Marionette, DeleteSeriesView, QualityProfiles, AsModelBoundView) {
|
||||
|
||||
NzbDrone.Series.Edit.EditSeriesView = Backbone.Marionette.ItemView.extend({
|
||||
template : 'Series/Edit/EditSeriesTemplate',
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Series/Edit/EditSeriesTemplate',
|
||||
|
||||
ui: {
|
||||
progressbar : '.progress .bar',
|
||||
qualityProfile : '.x-quality-profile',
|
||||
backlogSettings: '.x-backlog-setting'
|
||||
},
|
||||
ui: {
|
||||
progressbar : '.progress .bar',
|
||||
qualityProfile : '.x-quality-profile',
|
||||
backlogSettings: '.x-backlog-setting'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-save' : 'saveSeries',
|
||||
'click .x-remove': 'removeSeries'
|
||||
},
|
||||
events: {
|
||||
'click .x-save' : 'saveSeries',
|
||||
'click .x-remove': 'removeSeries'
|
||||
},
|
||||
|
||||
|
||||
initialize : function(){
|
||||
|
||||
this.model.set('qualityProfiles',qualityProfiles);
|
||||
|
||||
},
|
||||
initialize: function () {
|
||||
this.model.set('qualityProfiles', QualityProfiles);
|
||||
},
|
||||
|
||||
|
||||
saveSeries: function () {
|
||||
//Todo: Get qualityProfile + backlog setting from UI
|
||||
var qualityProfile = this.ui.qualityProfile.val();
|
||||
var qualityProfileText = this.ui.qualityProfile.children('option:selected').text();
|
||||
var backlogSetting = this.ui.backlogSettings.val();
|
||||
saveSeries: function () {
|
||||
//Todo: Get qualityProfile + backlog setting from UI
|
||||
var qualityProfile = this.ui.qualityProfile.val();
|
||||
var qualityProfileText = this.ui.qualityProfile.children('option:selected').text();
|
||||
var backlogSetting = this.ui.backlogSettings.val();
|
||||
|
||||
this.model.set({ qualityProfileId: qualityProfile, backlogSetting: backlogSetting, qualityProfileName: qualityProfileText });
|
||||
this.model.set({ qualityProfileId: qualityProfile, backlogSetting: backlogSetting, qualityProfileName: qualityProfileText });
|
||||
|
||||
this.model.save();
|
||||
this.trigger('saved');
|
||||
NzbDrone.modalRegion.closeModal();
|
||||
},
|
||||
this.model.save();
|
||||
this.trigger('saved');
|
||||
App.modalRegion.closeModal();
|
||||
},
|
||||
|
||||
removeSeries: function () {
|
||||
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
|
||||
NzbDrone.modalRegion.show(view);
|
||||
}
|
||||
removeSeries: function () {
|
||||
var view = new DeleteSeriesView({ model: this.model });
|
||||
App.modalRegion.show(view);
|
||||
}
|
||||
});
|
||||
return AsModelBoundView.apply(view);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -1,18 +1,21 @@
|
||||
'use strict';
|
||||
define(['app', 'Series/EpisodeModel'], function () {
|
||||
NzbDrone.Series.EpisodeCollection = Backbone.Collection.extend({
|
||||
url : NzbDrone.Constants.ApiRoot + '/episodes',
|
||||
model: NzbDrone.Series.EpisodeModel,
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Series/EpisodeModel'
|
||||
], function (Backbone, EpisodeModel) {
|
||||
return Backbone.Collection.extend({
|
||||
url : window.ApiRoot + '/episodes',
|
||||
model: EpisodeModel,
|
||||
|
||||
bySeason: function (season) {
|
||||
var filtered = this.filter(function (episode) {
|
||||
return episode.get('seasonNumber') === season;
|
||||
});
|
||||
bySeason: function (season) {
|
||||
var filtered = this.filter(function (episode) {
|
||||
return episode.get('seasonNumber') === season;
|
||||
});
|
||||
|
||||
return new NzbDrone.Series.EpisodeCollection(filtered);
|
||||
}
|
||||
var EpisodeCollection = require('Series/EpisodeCollection');
|
||||
|
||||
return new EpisodeCollection(filtered);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
return NzbDrone.Series.EpisodeCollection;
|
||||
});
|
||||
|
@ -1,92 +1,95 @@
|
||||
'use strict';
|
||||
define(['app', 'Series/SeriesModel'], function () {
|
||||
NzbDrone.Series.EpisodeModel = Backbone.Model.extend({
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Series/SeriesModel'
|
||||
], function (Backbone, SeriesModel) {
|
||||
return Backbone.Model.extend({
|
||||
|
||||
mutators: {
|
||||
paddedEpisodeNumber: function () {
|
||||
var test = this.get('episodeNumber');
|
||||
return this.get('episodeNumber').pad(2);
|
||||
},
|
||||
day : function () {
|
||||
return Date.create(this.get('airDate')).format('{dd}');
|
||||
},
|
||||
month : function () {
|
||||
return Date.create(this.get('airDate')).format('{MON}');
|
||||
},
|
||||
startTime : function () {
|
||||
var start = Date.create(this.get('airDate'));
|
||||
mutators: {
|
||||
paddedEpisodeNumber: function () {
|
||||
return this.get('episodeNumber').pad(2);
|
||||
},
|
||||
day : function () {
|
||||
return Date.create(this.get('airDate')).format('{dd}');
|
||||
},
|
||||
month : function () {
|
||||
return Date.create(this.get('airDate')).format('{MON}');
|
||||
},
|
||||
startTime : function () {
|
||||
var start = Date.create(this.get('airDate'));
|
||||
|
||||
if (start.format('{mm}') === '00') {
|
||||
return start.format('{h}{tt}');
|
||||
if (start.format('{mm}') === '00') {
|
||||
return start.format('{h}{tt}');
|
||||
}
|
||||
|
||||
return start.format('{h}.{mm}{tt}');
|
||||
},
|
||||
end : function () {
|
||||
|
||||
if (this.has('series')) {
|
||||
var start = Date.create(this.get('airDate'));
|
||||
var runtime = this.get('series').runtime;
|
||||
|
||||
return start.addMinutes(runtime);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
statusLevel : function () {
|
||||
var episodeFileId = this.get('episodeFileId');
|
||||
var currentTime = Date.create();
|
||||
var start = Date.create(this.get('airDate'));
|
||||
var end = Date.create(this.get('end'));
|
||||
|
||||
if (currentTime.isBetween(start, end)) {
|
||||
return 'warning';
|
||||
}
|
||||
|
||||
if (start.isBefore(currentTime) && episodeFileId === 0) {
|
||||
return 'danger';
|
||||
}
|
||||
|
||||
if (status === 'Ready') {
|
||||
return 'success';
|
||||
}
|
||||
|
||||
return 'primary';
|
||||
},
|
||||
hasAired : function () {
|
||||
return Date.create(this.get('airDate')).isBefore(Date.create());
|
||||
}
|
||||
|
||||
return start.format('{h}.{mm}{tt}');
|
||||
},
|
||||
end : function () {
|
||||
|
||||
|
||||
parse: function (model) {
|
||||
model.series = new SeriesModel(model.series);
|
||||
|
||||
return model;
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
var json = _.clone(this.attributes);
|
||||
|
||||
_.each(this.mutators, _.bind(function (mutator, name) {
|
||||
// check if we have some getter mutations
|
||||
if (_.isObject(this.mutators[name]) === true && _.isFunction(this.mutators[name].get)) {
|
||||
json[name] = _.bind(this.mutators[name].get, this)();
|
||||
}
|
||||
else {
|
||||
json[name] = _.bind(this.mutators[name], this)();
|
||||
}
|
||||
}, this));
|
||||
|
||||
if (this.has('series')) {
|
||||
var start = Date.create(this.get('airDate'));
|
||||
var runtime = this.get('series').runtime;
|
||||
|
||||
return start.addMinutes(runtime);
|
||||
json.series = this.get('series').toJSON();
|
||||
}
|
||||
return json;
|
||||
},
|
||||
statusLevel : function () {
|
||||
var episodeFileId = this.get('episodeFileId');
|
||||
var currentTime = Date.create();
|
||||
var start = Date.create(this.get('airDate'));
|
||||
var end = Date.create(this.get('end'));
|
||||
|
||||
if (currentTime.isBetween(start, end)) {
|
||||
return 'warning';
|
||||
}
|
||||
|
||||
if (start.isBefore(currentTime) && episodeFileId === 0) {
|
||||
return 'danger';
|
||||
}
|
||||
|
||||
if (status === 'Ready') {
|
||||
return 'success';
|
||||
}
|
||||
|
||||
return 'primary';
|
||||
},
|
||||
hasAired : function () {
|
||||
return Date.create(this.get('airDate')).isBefore(Date.create());
|
||||
defaults: {
|
||||
seasonNumber: 0,
|
||||
status : 0
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
parse: function (model) {
|
||||
model.series = new NzbDrone.Series.SeriesModel(model.series);
|
||||
|
||||
return model;
|
||||
},
|
||||
|
||||
toJSON: function () {
|
||||
var json = _.clone(this.attributes);
|
||||
|
||||
_.each(this.mutators, _.bind(function (mutator, name) {
|
||||
// check if we have some getter mutations
|
||||
if (_.isObject(this.mutators[name]) === true && _.isFunction(this.mutators[name].get)) {
|
||||
json[name] = _.bind(this.mutators[name].get, this)();
|
||||
} else {
|
||||
json[name] = _.bind(this.mutators[name], this)();
|
||||
}
|
||||
}, this));
|
||||
|
||||
if (this.has('series'))
|
||||
{
|
||||
json.series = this.get('series').toJSON();
|
||||
}
|
||||
return json;
|
||||
},
|
||||
|
||||
defaults: {
|
||||
seasonNumber: 0,
|
||||
status : 0
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.EpisodeModel;
|
||||
});
|
||||
|
@ -1,8 +1,9 @@
|
||||
'use strict';
|
||||
define(['app'], function () {
|
||||
NzbDrone.Series.Index.EmptySeriesCollectionView = Backbone.Marionette.CompositeView.extend({
|
||||
template: 'Series/Index/EmptySeriesIndexTemplate'
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette'
|
||||
], function (Marionette) {
|
||||
return Marionette.CompositeView.extend({
|
||||
template: 'Series/Index/EmptySeriesIndexTemplate'
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.Index.EmptySeriesCollectionView;
|
||||
});
|
||||
|
@ -1,10 +1,11 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define(['app'], function () {
|
||||
define(
|
||||
[
|
||||
'marionette'
|
||||
], function (Marionette) {
|
||||
|
||||
NzbDrone.Series.Index.EmptyView = Backbone.Marionette.CompositeView.extend({
|
||||
template: 'Series/Index/EmptyTemplate'
|
||||
return Marionette.CompositeView.extend({
|
||||
template: 'Series/Index/EmptyTemplate'
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.Index.EmptyView;
|
||||
});
|
||||
|
@ -1,12 +1,14 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define(['app', 'Series/Index/List/ItemView', 'Config'], function () {
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Series/Index/List/ItemView'
|
||||
], function (Marionette, ListItemView) {
|
||||
|
||||
NzbDrone.Series.Index.List.CollectionView = Backbone.Marionette.CompositeView.extend({
|
||||
itemView : NzbDrone.Series.Index.List.ItemView,
|
||||
itemViewContainer : '#x-series-list',
|
||||
template : 'Series/Index/List/CollectionTemplate'
|
||||
return Marionette.CompositeView.extend({
|
||||
itemView : ListItemView,
|
||||
itemViewContainer: '#x-series-list',
|
||||
template : 'Series/Index/List/CollectionTemplate'
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.Index.List.CollectionView;
|
||||
});
|
||||
|
@ -1,36 +1,33 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'app',
|
||||
'Quality/QualityProfileCollection',
|
||||
'Series/SeriesCollection',
|
||||
'Series/Edit/EditSeriesView',
|
||||
'Series/Delete/DeleteSeriesView',
|
||||
'Shared/FormatHelpers'
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'marionette',
|
||||
'Series/Edit/EditSeriesView',
|
||||
'Series/Delete/DeleteSeriesView'
|
||||
|
||||
], function () {
|
||||
NzbDrone.Series.Index.List.ItemView = Backbone.Marionette.ItemView.extend({
|
||||
template: 'Series/Index/List/ItemTemplate',
|
||||
], function (App, Marionette, EditSeriesView, DeleteSeriesView) {
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'Series/Index/List/ItemTemplate',
|
||||
|
||||
ui: {
|
||||
'progressbar': '.progress .bar'
|
||||
},
|
||||
ui: {
|
||||
'progressbar': '.progress .bar'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-edit' : 'editSeries',
|
||||
'click .x-remove': 'removeSeries'
|
||||
},
|
||||
events: {
|
||||
'click .x-edit' : 'editSeries',
|
||||
'click .x-remove': 'removeSeries'
|
||||
},
|
||||
|
||||
editSeries: function () {
|
||||
var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model});
|
||||
NzbDrone.modalRegion.show(view);
|
||||
},
|
||||
editSeries: function () {
|
||||
var view = new EditSeriesView({ model: this.model});
|
||||
App.modalRegion.show(view);
|
||||
},
|
||||
|
||||
removeSeries: function () {
|
||||
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
|
||||
NzbDrone.modalRegion.show(view);
|
||||
}
|
||||
removeSeries: function () {
|
||||
var view = new DeleteSeriesView({ model: this.model });
|
||||
App.modalRegion.show(view);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.Index.List.ItemView;
|
||||
});
|
||||
|
@ -1,12 +1,14 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define(['app', 'Series/Index/Posters/ItemView', 'Config'], function () {
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Series/Index/Posters/ItemView'
|
||||
], function (Marionette, PosterItemView) {
|
||||
|
||||
NzbDrone.Series.Index.Posters.CollectionView = Backbone.Marionette.CompositeView.extend({
|
||||
itemView : NzbDrone.Series.Index.Posters.ItemView,
|
||||
itemViewContainer : '#x-series-posters',
|
||||
template : 'Series/Index/Posters/CollectionTemplate'
|
||||
return Marionette.CompositeView.extend({
|
||||
itemView : PosterItemView,
|
||||
itemViewContainer: '#x-series-posters',
|
||||
template : 'Series/Index/Posters/CollectionTemplate'
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.Index.Posters.CollectionView;
|
||||
});
|
||||
|
@ -1,45 +1,44 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'app',
|
||||
'Series/SeriesCollection',
|
||||
'Series/Edit/EditSeriesView',
|
||||
'Series/Delete/DeleteSeriesView'
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'marionette',
|
||||
'Series/Edit/EditSeriesView',
|
||||
'Series/Delete/DeleteSeriesView'
|
||||
|
||||
], function () {
|
||||
], function (App, Marionette, EditSeriesView, DeleteSeriesView) {
|
||||
|
||||
NzbDrone.Series.Index.Posters.ItemView = Backbone.Marionette.ItemView.extend({
|
||||
tagName : 'li',
|
||||
template: 'Series/Index/Posters/ItemTemplate',
|
||||
return Marionette.ItemView.extend({
|
||||
tagName : 'li',
|
||||
template: 'Series/Index/Posters/ItemTemplate',
|
||||
|
||||
|
||||
ui: {
|
||||
'progressbar': '.progress .bar',
|
||||
'controls': '.series-controls'
|
||||
},
|
||||
ui: {
|
||||
'progressbar': '.progress .bar',
|
||||
'controls' : '.series-controls'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-edit' : 'editSeries',
|
||||
'click .x-remove': 'removeSeries',
|
||||
'mouseenter .x-series-poster': 'posterHoverAction',
|
||||
'mouseleave .x-series-poster': 'posterHoverAction'
|
||||
},
|
||||
events: {
|
||||
'click .x-edit' : 'editSeries',
|
||||
'click .x-remove' : 'removeSeries',
|
||||
'mouseenter .x-series-poster': 'posterHoverAction',
|
||||
'mouseleave .x-series-poster': 'posterHoverAction'
|
||||
},
|
||||
|
||||
|
||||
editSeries: function () {
|
||||
var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model});
|
||||
NzbDrone.modalRegion.show(view);
|
||||
},
|
||||
editSeries: function () {
|
||||
var view = new EditSeriesView({ model: this.model});
|
||||
App.modalRegion.show(view);
|
||||
},
|
||||
|
||||
removeSeries: function () {
|
||||
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
|
||||
NzbDrone.modalRegion.show(view);
|
||||
},
|
||||
removeSeries: function () {
|
||||
var view = new DeleteSeriesView({ model: this.model });
|
||||
App.modalRegion.show(view);
|
||||
},
|
||||
|
||||
posterHoverAction: function () {
|
||||
this.ui.controls.slideToggle();
|
||||
}
|
||||
posterHoverAction: function () {
|
||||
this.ui.controls.slideToggle();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.Index.Posters.ItemView;
|
||||
});
|
||||
|
@ -1,33 +1,22 @@
|
||||
'use strict';
|
||||
define([
|
||||
'app',
|
||||
'Series/Index/List/CollectionView',
|
||||
'Series/Index/Posters/CollectionView',
|
||||
'Series/Index/EmptyView',
|
||||
'Series/SeriesCollection',
|
||||
'Cells/AirDateCell',
|
||||
'Cells/SeriesTitleCell',
|
||||
'Cells/SeriesStatusCell',
|
||||
'Cells/TemplatedCell',
|
||||
'Shared/Toolbar/ToolbarLayout',
|
||||
'Config',
|
||||
'Shared/LoadingView'
|
||||
],
|
||||
function (
|
||||
App,
|
||||
ListCollectionView,
|
||||
PosterCollectionView,
|
||||
EmptyView,
|
||||
SeriesCollection,
|
||||
AirDateCell,
|
||||
SeriesTitleCell,
|
||||
SeriesStatusCell,
|
||||
TemplatedCell,
|
||||
ToolbarLayout,
|
||||
Config,
|
||||
LoadingView)
|
||||
{
|
||||
NzbDrone.Series.Index.SeriesIndexLayout = Backbone.Marionette.Layout.extend({
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Series/Index/Posters/CollectionView',
|
||||
'Series/Index/List/CollectionView',
|
||||
'Series/Index/EmptyView',
|
||||
'Series/SeriesCollection',
|
||||
'Cells/AirDateCell',
|
||||
'Cells/SeriesTitleCell',
|
||||
'Cells/TemplatedCell',
|
||||
'Series/Index/Table/SeriesStatusCell',
|
||||
'Series/Index/Table/Row',
|
||||
'Shared/Toolbar/ToolbarLayout',
|
||||
'Config',
|
||||
'Shared/LoadingView'
|
||||
], function (Marionette, PosterCollectionView, ListCollectionView, EmptyView, SeriesCollection, AirDateCell, SeriesTitleCell, TemplatedCell, SeriesStatusCell, SeriesIndexRow,
|
||||
ToolbarLayout, Config, LoadingView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Series/Index/SeriesIndexLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
@ -35,87 +24,88 @@ define([
|
||||
toolbar: '#x-toolbar'
|
||||
},
|
||||
|
||||
columns: [
|
||||
{
|
||||
name : 'status',
|
||||
label: '',
|
||||
cell : SeriesStatusCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label: 'Title',
|
||||
cell : SeriesTitleCell
|
||||
},
|
||||
{
|
||||
name : 'seasonCount',
|
||||
label: 'Seasons',
|
||||
cell : 'integer'
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label: 'Quality',
|
||||
cell : 'integer'
|
||||
},
|
||||
{
|
||||
name : 'network',
|
||||
label: 'Network',
|
||||
cell : 'string'
|
||||
},
|
||||
{
|
||||
name : 'nextAiring',
|
||||
label: 'Next Airing',
|
||||
cell : AirDateCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label : 'Episodes',
|
||||
sortable: false,
|
||||
template: 'Series/EpisodeProgressTemplate',
|
||||
cell : TemplatedCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label : '',
|
||||
sortable: false,
|
||||
template: 'Series/Index/Table/ControlsColumnTemplate',
|
||||
cell : TemplatedCell
|
||||
}
|
||||
],
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name : 'status',
|
||||
label: '',
|
||||
cell : SeriesStatusCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label: 'Title',
|
||||
cell : SeriesTitleCell
|
||||
},
|
||||
{
|
||||
name : 'seasonCount',
|
||||
label: 'Seasons',
|
||||
cell : 'integer'
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label: 'Quality',
|
||||
cell : 'integer'
|
||||
},
|
||||
{
|
||||
name : 'network',
|
||||
label: 'Network',
|
||||
cell : 'string'
|
||||
},
|
||||
{
|
||||
name : 'nextAiring',
|
||||
label: 'Next Airing',
|
||||
cell : AirDateCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label : 'Episodes',
|
||||
sortable: false,
|
||||
template: 'Series/EpisodeProgressTemplate',
|
||||
cell : TemplatedCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label : '',
|
||||
sortable: false,
|
||||
template: 'Series/Index/Table/ControlsColumnTemplate',
|
||||
cell : TemplatedCell
|
||||
}
|
||||
],
|
||||
|
||||
leftSideButtons: {
|
||||
type : 'default',
|
||||
storeState: false,
|
||||
items : [
|
||||
{
|
||||
title: 'Add Series',
|
||||
icon : 'icon-plus',
|
||||
route: 'series/add'
|
||||
},
|
||||
{
|
||||
title : 'RSS Sync',
|
||||
icon : 'icon-rss',
|
||||
command : 'rsssync',
|
||||
successMessage: 'RSS Sync Completed',
|
||||
errorMessage : 'RSS Sync Failed!'
|
||||
},
|
||||
{
|
||||
title : 'Update Library',
|
||||
icon : 'icon-refresh',
|
||||
command : 'refreshseries',
|
||||
successMessage: 'Library was updated!',
|
||||
errorMessage : 'Library update failed!'
|
||||
}
|
||||
]
|
||||
items :
|
||||
[
|
||||
{
|
||||
title: 'Add Series',
|
||||
icon : 'icon-plus',
|
||||
route: 'series/add'
|
||||
},
|
||||
{
|
||||
title : 'RSS Sync',
|
||||
icon : 'icon-rss',
|
||||
command : 'rsssync',
|
||||
successMessage: 'RSS Sync Completed',
|
||||
errorMessage : 'RSS Sync Failed!'
|
||||
},
|
||||
{
|
||||
title : 'Update Library',
|
||||
icon : 'icon-refresh',
|
||||
command : 'refreshseries',
|
||||
successMessage: 'Library was updated!',
|
||||
errorMessage : 'Library update failed!'
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
_showTable: function () {
|
||||
var view = new Backgrid.Grid(
|
||||
{
|
||||
row : NzbDrone.Series.Index.Table.Row,
|
||||
columns : this.columns,
|
||||
collection: this.seriesCollection,
|
||||
className : 'table table-hover'
|
||||
});
|
||||
var view = new Backgrid.Grid({
|
||||
row : SeriesIndexRow,
|
||||
columns : this.columns,
|
||||
collection: this.seriesCollection,
|
||||
className : 'table table-hover'
|
||||
});
|
||||
|
||||
this._fetchCollection(view);
|
||||
},
|
||||
@ -140,16 +130,15 @@ define([
|
||||
if (this.seriesCollection.models.length === 0) {
|
||||
this.series.show(new LoadingView());
|
||||
|
||||
this.seriesCollection.fetch()
|
||||
.done(function () {
|
||||
if (self.seriesCollection.models.length === 0) {
|
||||
self._showEmpty();
|
||||
}
|
||||
else {
|
||||
view.collection = self.seriesCollection;
|
||||
self.series.show(view);
|
||||
}
|
||||
});
|
||||
this.seriesCollection.fetch().done(function () {
|
||||
if (self.seriesCollection.models.length === 0) {
|
||||
self._showEmpty();
|
||||
}
|
||||
else {
|
||||
view.collection = self.seriesCollection;
|
||||
self.series.show(view);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
else {
|
||||
@ -170,35 +159,40 @@ define([
|
||||
storeState : true,
|
||||
menuKey : 'seriesViewMode',
|
||||
defaultAction: 'listView',
|
||||
items : [
|
||||
{
|
||||
key : 'tableView',
|
||||
title : '',
|
||||
icon : 'icon-table',
|
||||
callback: this._showTable
|
||||
},
|
||||
{
|
||||
key : 'listView',
|
||||
title : '',
|
||||
icon : 'icon-list',
|
||||
callback: this._showList
|
||||
},
|
||||
{
|
||||
key : 'posterView',
|
||||
title : '',
|
||||
icon : 'icon-picture',
|
||||
callback: this._showPosters
|
||||
}
|
||||
]
|
||||
items :
|
||||
[
|
||||
{
|
||||
key : 'tableView',
|
||||
title : '',
|
||||
icon : 'icon-table',
|
||||
callback: this._showTable
|
||||
},
|
||||
{
|
||||
key : 'listView',
|
||||
title : '',
|
||||
icon : 'icon-list',
|
||||
callback: this._showList
|
||||
},
|
||||
{
|
||||
key : 'posterView',
|
||||
title : '',
|
||||
icon : 'icon-picture',
|
||||
callback: this._showPosters
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
this.toolbar.show(new ToolbarLayout({
|
||||
right : [ viewButtons],
|
||||
left : [ this.leftSideButtons],
|
||||
right :
|
||||
[
|
||||
viewButtons
|
||||
],
|
||||
left :
|
||||
[
|
||||
this.leftSideButtons
|
||||
],
|
||||
context: this
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
return NzbDrone.Series.Index.SeriesIndexLayou;
|
||||
});
|
||||
|
@ -1,22 +1,26 @@
|
||||
'use strict';
|
||||
define(['app','backgrid'], function () {
|
||||
NzbDrone.Series.Index.Table.Row = Backgrid.Row.extend({
|
||||
events: {
|
||||
'click .x-edit' : 'editSeries',
|
||||
'click .x-remove': 'removeSeries'
|
||||
},
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'backgrid',
|
||||
'Series/Edit/EditSeriesView',
|
||||
'Series/Delete/DeleteSeriesView'
|
||||
], function (App, Backgrid, EditSeriesView, DeleteSeriesView) {
|
||||
return Backgrid.Row.extend({
|
||||
events: {
|
||||
'click .x-edit' : 'editSeries',
|
||||
'click .x-remove': 'removeSeries'
|
||||
},
|
||||
|
||||
editSeries: function () {
|
||||
var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model});
|
||||
NzbDrone.modalRegion.show(view);
|
||||
},
|
||||
editSeries: function () {
|
||||
var view = new EditSeriesView({ model: this.model});
|
||||
App.modalRegion.show(view);
|
||||
},
|
||||
|
||||
removeSeries: function () {
|
||||
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
|
||||
NzbDrone.modalRegion.show(view);
|
||||
}
|
||||
removeSeries: function () {
|
||||
var view = new DeleteSeriesView({ model: this.model });
|
||||
App.modalRegion.show(view);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.Table.Row;
|
||||
});
|
||||
|
||||
|
28
UI/Series/Index/Table/SeriesStatusCell.js
Normal file
28
UI/Series/Index/Table/SeriesStatusCell.js
Normal file
@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backgrid'
|
||||
], function (Backgrid) {
|
||||
return 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 === 'continuing') {
|
||||
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;
|
||||
}
|
||||
});
|
||||
});
|
@ -1,23 +1,24 @@
|
||||
'use strict';
|
||||
define(['app', 'Series/SeasonModel', 'backbone.pageable'], function (App, SeasonModel, PageAbleCollection) {
|
||||
NzbDrone.Series.SeasonCollection = PageAbleCollection.extend({
|
||||
url : NzbDrone.Constants.ApiRoot + '/season',
|
||||
model: NzbDrone.Series.SeasonModel,
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Series/SeasonModel',
|
||||
'backbone.pageable'
|
||||
], function (SeasonModel, PageAbleCollection) {
|
||||
return PageAbleCollection.extend({
|
||||
url : window.ApiRoot + '/season',
|
||||
model: SeasonModel,
|
||||
|
||||
mode: 'client',
|
||||
mode: 'client',
|
||||
|
||||
state: {
|
||||
sortKey : 'seasonNumber',
|
||||
order : 1,
|
||||
pageSize: 1000000
|
||||
},
|
||||
state: {
|
||||
sortKey : 'seasonNumber',
|
||||
order : 1,
|
||||
pageSize: 1000000
|
||||
},
|
||||
|
||||
queryParams: {
|
||||
sortKey: null,
|
||||
order : null
|
||||
}
|
||||
queryParams: {
|
||||
sortKey: null,
|
||||
order : null
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
return NzbDrone.Series.SeasonCollection;
|
||||
});
|
||||
|
@ -1,24 +1,25 @@
|
||||
'use strict';
|
||||
define(['app'], function () {
|
||||
NzbDrone.Series.SeasonModel = Backbone.Model.extend({
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone'
|
||||
], function (Backbone) {
|
||||
return Backbone.Model.extend({
|
||||
|
||||
mutators: {
|
||||
seasonTitle: function () {
|
||||
var seasonNumber = this.get('seasonNumber');
|
||||
mutators: {
|
||||
seasonTitle: function () {
|
||||
var seasonNumber = this.get('seasonNumber');
|
||||
|
||||
if (seasonNumber === 0) {
|
||||
return 'Specials';
|
||||
if (seasonNumber === 0) {
|
||||
return 'Specials';
|
||||
}
|
||||
|
||||
return 'Season ' + seasonNumber;
|
||||
}
|
||||
},
|
||||
|
||||
return 'Season ' + seasonNumber;
|
||||
defaults: {
|
||||
seasonNumber: 0
|
||||
}
|
||||
},
|
||||
|
||||
defaults: {
|
||||
seasonNumber: 0
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.SeasonModel;
|
||||
});
|
||||
|
||||
|
@ -1,18 +1,20 @@
|
||||
'use strict';
|
||||
define(['app', 'Series/SeriesModel'], function () {
|
||||
NzbDrone.Series.SeriesCollection = Backbone.Collection.extend({
|
||||
url : NzbDrone.Constants.ApiRoot + '/series',
|
||||
model: NzbDrone.Series.SeriesModel,
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Series/SeriesModel'
|
||||
], function (Backbone, SeriesModel) {
|
||||
return Backbone.Collection.extend({
|
||||
url : window.ApiRoot + '/series',
|
||||
model: SeriesModel,
|
||||
|
||||
comparator: function(model) {
|
||||
return model.get('title');
|
||||
},
|
||||
comparator: function (model) {
|
||||
return model.get('title');
|
||||
},
|
||||
|
||||
state: {
|
||||
sortKey: 'title',
|
||||
order: -1
|
||||
}
|
||||
state: {
|
||||
sortKey: 'title',
|
||||
order : -1
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.SeriesCollection;
|
||||
});
|
||||
|
@ -1,87 +1,88 @@
|
||||
'use strict';
|
||||
define(['app', 'Quality/QualityProfileCollection'], function (app, qualityProfiles) {
|
||||
NzbDrone.Series.SeriesModel = Backbone.Model.extend({
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Quality/QualityProfileCollection',
|
||||
], function (Backbone, QualityProfileCollection) {
|
||||
return Backbone.Model.extend({
|
||||
|
||||
urlRoot: NzbDrone.Constants.ApiRoot + '/series',
|
||||
urlRoot: Constants.ApiRoot + '/series',
|
||||
|
||||
mutators: {
|
||||
percentOfEpisodes: function () {
|
||||
var episodeCount = this.get('episodeCount');
|
||||
var episodeFileCount = this.get('episodeFileCount');
|
||||
mutators: {
|
||||
percentOfEpisodes: function () {
|
||||
var episodeCount = this.get('episodeCount');
|
||||
var episodeFileCount = this.get('episodeFileCount');
|
||||
|
||||
var percent = 100;
|
||||
var percent = 100;
|
||||
|
||||
if (episodeCount > 0) {
|
||||
percent = episodeFileCount / episodeCount * 100;
|
||||
if (episodeCount > 0) {
|
||||
percent = episodeFileCount / episodeCount * 100;
|
||||
}
|
||||
|
||||
return percent;
|
||||
},
|
||||
poster : function () {
|
||||
var poster = _.find(this.get('images'), function (image) {
|
||||
return image.coverType === 'poster';
|
||||
});
|
||||
|
||||
if (poster) {
|
||||
return poster.url;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
fanArt : function () {
|
||||
var poster = _.find(this.get('images'), function (image) {
|
||||
return image.coverType === 'fanart';
|
||||
});
|
||||
|
||||
if (poster) {
|
||||
return poster.url;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
traktUrl : function () {
|
||||
return 'http://trakt.tv/show/' + this.get('titleSlug');
|
||||
},
|
||||
imdbUrl : function () {
|
||||
return 'http://imdb.com/title/' + this.get('imdbId');
|
||||
},
|
||||
isContinuing : function () {
|
||||
return this.get('status') === 'continuing';
|
||||
},
|
||||
shortDate : function () {
|
||||
var date = this.get('nextAiring');
|
||||
|
||||
if (!date) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return Date.create(date).short();
|
||||
},
|
||||
route : function () {
|
||||
return '/series/details/' + this.get('titleSlug');
|
||||
//return '/series/details/' + this.get('id');
|
||||
},
|
||||
|
||||
qualityProfile: function () {
|
||||
|
||||
var profile = QualityProfileCollection.get(this.get('qualityProfileId'));
|
||||
|
||||
if (profile) {
|
||||
return profile.toJSON();
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return percent;
|
||||
},
|
||||
poster : function () {
|
||||
var poster = _.find(this.get('images'), function (image) {
|
||||
return image.coverType === 'poster';
|
||||
});
|
||||
|
||||
if (poster) {
|
||||
return poster.url;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
fanArt : function () {
|
||||
var poster = _.find(this.get('images'), function (image) {
|
||||
return image.coverType === 'fanart';
|
||||
});
|
||||
|
||||
if (poster) {
|
||||
return poster.url;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
},
|
||||
traktUrl : function () {
|
||||
return 'http://trakt.tv/show/' + this.get('titleSlug');
|
||||
},
|
||||
imdbUrl : function () {
|
||||
return 'http://imdb.com/title/' + this.get('imdbId');
|
||||
},
|
||||
isContinuing : function () {
|
||||
return this.get('status') === 'continuing';
|
||||
},
|
||||
shortDate : function () {
|
||||
var date = this.get('nextAiring');
|
||||
|
||||
if (!date) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return Date.create(date).short();
|
||||
},
|
||||
route : function () {
|
||||
return '/series/details/' + this.get('titleSlug');
|
||||
//return '/series/details/' + this.get('id');
|
||||
},
|
||||
|
||||
qualityProfile: function () {
|
||||
|
||||
var profile = qualityProfiles.get(this.get('qualityProfileId'));
|
||||
|
||||
if (profile) {
|
||||
return profile.toJSON();
|
||||
}
|
||||
|
||||
return undefined;
|
||||
defaults: {
|
||||
episodeFileCount: 0,
|
||||
episodeCount : 0,
|
||||
isExisting : false,
|
||||
status : 0
|
||||
}
|
||||
},
|
||||
|
||||
defaults: {
|
||||
episodeFileCount: 0,
|
||||
episodeCount : 0,
|
||||
isExisting : false,
|
||||
status : 0
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return NzbDrone.Series.SeriesModel;
|
||||
|
||||
});
|
||||
|
@ -1,6 +1,8 @@
|
||||
window.ApiRoot = '/api';
|
||||
|
||||
var statusText = $.ajax({
|
||||
type : 'GET',
|
||||
url : '/api/system/status',
|
||||
url : window.ApiRoot + '/system/status',
|
||||
async: false
|
||||
}).responseText;
|
||||
|
||||
|
@ -1,79 +1,81 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'app', 'marionette', 'Mixins/AsModelBoundView', 'bootstrap'
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView',
|
||||
'bootstrap'
|
||||
], function (Marionette, AsModelBoundView) {
|
||||
|
||||
], function (App, Marionette, AsModelBoundView) {
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Settings/DownloadClient/DownloadClientTemplate',
|
||||
className: 'form-horizontal',
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Settings/DownloadClient/DownloadClientTemplate',
|
||||
className: 'form-horizontal',
|
||||
ui: {
|
||||
bsSwitch : '.switch',
|
||||
tooltip : '.help-inline i',
|
||||
pathInput : '.x-path',
|
||||
sabConfig : '.x-sab-config',
|
||||
blackholeConfig : '.x-blackhole-config',
|
||||
pneumaticConfig : '.x-pneumatic-config',
|
||||
nzbGetConfig : '.x-nzbget-config',
|
||||
downloadClientSelect: '.x-download-client'
|
||||
},
|
||||
|
||||
ui: {
|
||||
bsSwitch : '.switch',
|
||||
tooltip : '.help-inline i',
|
||||
pathInput : '.x-path',
|
||||
sabConfig : '.x-sab-config',
|
||||
blackholeConfig : '.x-blackhole-config',
|
||||
pneumaticConfig : '.x-pneumatic-config',
|
||||
nzbGetConfig : '.x-nzbget-config',
|
||||
downloadClientSelect: '.x-download-client'
|
||||
},
|
||||
events: {
|
||||
'change .x-download-client': 'downloadClientChanged'
|
||||
},
|
||||
|
||||
events: {
|
||||
'change .x-download-client': 'downloadClientChanged'
|
||||
},
|
||||
onRender: function () {
|
||||
this.ui.pathInput.autoComplete('/directories');
|
||||
this.refreshUIVisibility(this.model.get('downloadClient'));
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
this.ui.pathInput.autoComplete('/directories');
|
||||
this.refreshUIVisibility(this.model.get('downloadClient'));
|
||||
},
|
||||
downloadClientChanged: function () {
|
||||
var clientId = this.ui.downloadClientSelect.val();
|
||||
this.refreshUIVisibility(clientId);
|
||||
},
|
||||
|
||||
downloadClientChanged: function () {
|
||||
var clientId = this.ui.downloadClientSelect.val();
|
||||
this.refreshUIVisibility(clientId);
|
||||
},
|
||||
refreshUIVisibility: function (clientId) {
|
||||
|
||||
refreshUIVisibility: function (clientId) {
|
||||
if (!clientId) {
|
||||
clientId = 'sabnzbd';
|
||||
}
|
||||
|
||||
if (!clientId) {
|
||||
clientId = 'sabnzbd';
|
||||
switch (clientId.toString()) {
|
||||
case 'sabnzbd':
|
||||
this.ui.sabConfig.show();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'blackhole':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.show();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'pneumatic':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.show();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'nzbget':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.show();
|
||||
break;
|
||||
|
||||
default :
|
||||
throw 'unknown download client id' + clientId;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
switch (clientId.toString()) {
|
||||
case 'sabnzbd':
|
||||
this.ui.sabConfig.show();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'blackhole':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.show();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'pneumatic':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.show();
|
||||
this.ui.nzbGetConfig.hide();
|
||||
break;
|
||||
|
||||
case 'nzbget':
|
||||
this.ui.sabConfig.hide();
|
||||
this.ui.blackholeConfig.hide();
|
||||
this.ui.pneumaticConfig.hide();
|
||||
this.ui.nzbGetConfig.show();
|
||||
break;
|
||||
|
||||
default :
|
||||
throw 'unknown download client id' + clientId;
|
||||
}
|
||||
}
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
@ -1,19 +1,23 @@
|
||||
'use strict';
|
||||
define(['app', 'backbone', 'Mixins/AsChangeTrackingModel'], function (App, Backbone, AsChangeTrackingModel) {
|
||||
var model = Backbone.Model.extend({
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Mixins/AsChangeTrackingModel'
|
||||
], function (Backbone, AsChangeTrackingModel) {
|
||||
var model = Backbone.Model.extend({
|
||||
|
||||
url: App.Constants.ApiRoot + '/settings/host',
|
||||
url: window.ApiRoot + '/settings/host',
|
||||
|
||||
initialize: function () {
|
||||
this.on('change', function () {
|
||||
this.isSaved = false;
|
||||
}, this);
|
||||
initialize: function () {
|
||||
this.on('change', function () {
|
||||
this.isSaved = false;
|
||||
}, this);
|
||||
|
||||
this.on('sync', function () {
|
||||
this.isSaved = true;
|
||||
}, this);
|
||||
}
|
||||
this.on('sync', function () {
|
||||
this.isSaved = true;
|
||||
}, this);
|
||||
}
|
||||
});
|
||||
|
||||
return AsChangeTrackingModel.call(model);
|
||||
});
|
||||
|
||||
return AsChangeTrackingModel.call(model);
|
||||
});
|
||||
|
@ -1,7 +1,10 @@
|
||||
'use strict';
|
||||
define(['app', 'Settings/Indexers/Model'], function (App, IndexerModel) {
|
||||
return Backbone.Collection.extend({
|
||||
url : App.Constants.ApiRoot + '/indexer',
|
||||
model: IndexerModel
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Settings/Indexers/Model'
|
||||
], function (IndexerModel) {
|
||||
return Backbone.Collection.extend({
|
||||
url : window.ApiRoot + '/indexer',
|
||||
model: IndexerModel
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,26 +1,26 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'app',
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (App, Marionette, AsModelBoundView) {
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (Marionette, AsModelBoundView) {
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/Indexers/EditTemplate',
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/Indexers/EditTemplate',
|
||||
|
||||
events: {
|
||||
'click .x-save': 'save'
|
||||
},
|
||||
events: {
|
||||
'click .x-save': 'save'
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
this.indexerCollection = options.indexerCollection;
|
||||
},
|
||||
initialize: function (options) {
|
||||
this.indexerCollection = options.indexerCollection;
|
||||
},
|
||||
|
||||
save: function () {
|
||||
this.model.saveSettings();
|
||||
}
|
||||
save: function () {
|
||||
this.model.saveSettings();
|
||||
}
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
@ -1,10 +1,12 @@
|
||||
'use strict';
|
||||
define(['app',
|
||||
'Settings/SettingsModelBase'], function (App, ModelBase) {
|
||||
return ModelBase.extend({
|
||||
url : App.Constants.ApiRoot + '/config/naming',
|
||||
successMessage: 'Naming settings saved',
|
||||
errorMessage : 'Couldn\'t save naming settings'
|
||||
});
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Settings/SettingsModelBase'
|
||||
], function (ModelBase) {
|
||||
return ModelBase.extend({
|
||||
url : window.ApiRoot + '/config/naming',
|
||||
successMessage: 'Naming settings saved',
|
||||
errorMessage : 'Couldn\'t save naming settings'
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
@ -1,18 +1,20 @@
|
||||
'use strict';
|
||||
define(['app',
|
||||
'marionette',
|
||||
'Settings/Naming/NamingModel',
|
||||
'Mixins/AsModelBoundView'], function (App, Marionette, NamingModel, AsModelBoundView) {
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Settings/Naming/NamingModel',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (Marionette, NamingModel, AsModelBoundView) {
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/Naming/NamingTemplate',
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/Naming/NamingTemplate',
|
||||
|
||||
initialize: function () {
|
||||
this.model = new NamingModel();
|
||||
this.model.fetch();
|
||||
}
|
||||
initialize: function () {
|
||||
this.model = new NamingModel();
|
||||
this.model.fetch();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
@ -1,7 +1,10 @@
|
||||
'use strict';
|
||||
define(['app', 'Settings/Notifications/Model'], function (App, NotificationModel) {
|
||||
return Backbone.Collection.extend({
|
||||
url : App.Constants.ApiRoot + '/notification',
|
||||
model: NotificationModel
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Settings/Notifications/Model'
|
||||
], function (NotificationModel) {
|
||||
return Backbone.Collection.extend({
|
||||
url : window.ApiRoot + '/notification',
|
||||
model: NotificationModel
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -1,5 +1,8 @@
|
||||
'use strict';
|
||||
define(['app', 'backbone.deepmodel'], function (App, DeepModel) {
|
||||
return DeepModel.DeepModel.extend({
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone.deepmodel'
|
||||
], function (DeepModel) {
|
||||
return DeepModel.DeepModel.extend({
|
||||
});
|
||||
});
|
||||
});
|
||||
|
11
UI/Settings/Quality/Profile/DeleteTemplate.html
Normal file
11
UI/Settings/Quality/Profile/DeleteTemplate.html
Normal file
@ -0,0 +1,11 @@
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>Delete: {{name}}</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Are you sure you want to delete '{{name}}'?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal">cancel</button>
|
||||
<button class="btn btn-danger x-confirm-delete">delete</button>
|
||||
</div>
|
24
UI/Settings/Quality/Profile/DeleteView.js
Normal file
24
UI/Settings/Quality/Profile/DeleteView.js
Normal file
@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'marionette'
|
||||
], function (App, Marionette) {
|
||||
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'Quality/Profile/DeleteTemplate',
|
||||
|
||||
events: {
|
||||
'click .x-confirm-delete': '_removeProfile'
|
||||
},
|
||||
|
||||
_removeProfile: function () {
|
||||
|
||||
this.model.destroy({
|
||||
wait: true
|
||||
}).done(function () {
|
||||
App.modalRegion.close();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
@ -1,35 +1,40 @@
|
||||
'use strict';
|
||||
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'app',
|
||||
'marionette',
|
||||
'Settings/Quality/Profile/EditQualityProfileView',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (App, Marionette, EditProfileView, AsModelBoundView) {
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'marionette',
|
||||
'Settings/Quality/Profile/EditQualityProfileView',
|
||||
'Settings/Quality/Profile/DeleteView',
|
||||
'Mixins/AsModelBoundView'
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/Quality/Profile/QualityProfileTemplate',
|
||||
tagName : 'tr',
|
||||
], function (App, Marionette, EditProfileView, DeleteProfileView, AsModelBoundView) {
|
||||
|
||||
ui: {
|
||||
'progressbar': '.progress .bar'
|
||||
},
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/Quality/Profile/QualityProfileTemplate',
|
||||
tagName : 'tr',
|
||||
|
||||
events: {
|
||||
'click .x-edit' : 'edit',
|
||||
'click .x-remove': 'removeQuality'
|
||||
},
|
||||
ui: {
|
||||
'progressbar': '.progress .bar'
|
||||
},
|
||||
|
||||
edit: function () {
|
||||
var view = new EditProfileView({ model: this.model});
|
||||
App.modalRegion.show(view);
|
||||
},
|
||||
events: {
|
||||
'click .x-edit' : 'edit',
|
||||
'click .x-remove': 'removeQuality'
|
||||
},
|
||||
|
||||
removeQuality: function () {
|
||||
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
|
||||
NzbDrone.modalRegion.show(view);
|
||||
}
|
||||
edit: function () {
|
||||
var view = new EditProfileView({ model: this.model});
|
||||
App.modalRegion.show(view);
|
||||
},
|
||||
|
||||
removeQuality: function () {
|
||||
var view = new DeleteProfileView({ model: this.model });
|
||||
App.modalRegion.show(view);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
||||
|
@ -1,13 +1,12 @@
|
||||
'use strict';
|
||||
define([
|
||||
'app',
|
||||
'marionette',
|
||||
'Quality/QualityProfileCollection',
|
||||
'Settings/Quality/Profile/QualityProfileCollectionView',
|
||||
'Quality/QualitySizeCollection',
|
||||
'Settings/Quality/Size/QualitySizeCollectionView'
|
||||
],
|
||||
function (App, Marionette, QualityProfileCollection, QualityProfileCollectionView, QualitySizeCollection, QualitySizeCollectionView) {
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Quality/QualityProfileCollection',
|
||||
'Settings/Quality/Profile/QualityProfileCollectionView',
|
||||
'Quality/QualitySizeCollection',
|
||||
'Settings/Quality/Size/QualitySizeCollectionView'
|
||||
], function (Marionette, QualityProfileCollection, QualityProfileCollectionView, QualitySizeCollection, QualitySizeCollectionView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Settings/Quality/QualityLayoutTemplate',
|
||||
|
||||
|
@ -1,21 +1,22 @@
|
||||
'use strict';
|
||||
define([
|
||||
'app',
|
||||
'marionette',
|
||||
'Settings/SettingsModel',
|
||||
'Settings/General/GeneralSettingsModel',
|
||||
'Settings/Naming/NamingView',
|
||||
'Settings/Naming/NamingModel',
|
||||
'Settings/Quality/QualityLayout',
|
||||
'Settings/Indexers/CollectionView',
|
||||
'Settings/Indexers/Collection',
|
||||
'Settings/DownloadClient/DownloadClientView',
|
||||
'Settings/Notifications/CollectionView',
|
||||
'Settings/Notifications/Collection',
|
||||
'Settings/General/GeneralView',
|
||||
'Settings/Misc/MiscView'
|
||||
],
|
||||
function (App, Marionette, SettingsModel, GeneralSettingsModel, NamingView, NamingModel, QualityLayout, IndexerCollectionView, IndexerCollection, DownloadClientView, NotificationCollectionView, NotificationCollection, GeneralView, MiscView) {
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'marionette',
|
||||
'Settings/SettingsModel',
|
||||
'Settings/General/GeneralSettingsModel',
|
||||
'Settings/Naming/NamingModel',
|
||||
'Settings/Naming/NamingView',
|
||||
'Settings/Quality/QualityLayout',
|
||||
'Settings/Indexers/CollectionView',
|
||||
'Settings/Indexers/Collection',
|
||||
'Settings/DownloadClient/DownloadClientView',
|
||||
'Settings/Notifications/CollectionView',
|
||||
'Settings/Notifications/Collection',
|
||||
'Settings/General/GeneralView',
|
||||
'Settings/Misc/MiscView'
|
||||
], function (App, Marionette, SettingsModel, GeneralSettingsModel,NamingModel, NamingView, QualityLayout, IndexerCollectionView, IndexerCollection, DownloadClientView,
|
||||
NotificationCollectionView, NotificationCollection, GeneralView, MiscView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Settings/SettingsLayoutTemplate',
|
||||
|
||||
@ -56,7 +57,7 @@ define([
|
||||
}
|
||||
|
||||
this.ui.namingTab.tab('show');
|
||||
App.Router.navigate('settings/naming');
|
||||
this._navigate('settings/naming');
|
||||
},
|
||||
|
||||
showQuality: function (e) {
|
||||
@ -65,7 +66,7 @@ define([
|
||||
}
|
||||
|
||||
this.ui.qualityTab.tab('show');
|
||||
App.Router.navigate('settings/quality');
|
||||
this._navigate('settings/quality');
|
||||
},
|
||||
|
||||
showIndexers: function (e) {
|
||||
@ -74,7 +75,7 @@ define([
|
||||
}
|
||||
|
||||
this.ui.indexersTab.tab('show');
|
||||
App.Router.navigate('settings/indexers');
|
||||
this._navigate('settings/indexers');
|
||||
},
|
||||
|
||||
showDownloadClient: function (e) {
|
||||
@ -83,7 +84,7 @@ define([
|
||||
}
|
||||
|
||||
this.ui.downloadClientTab.tab('show');
|
||||
App.Router.navigate('settings/downloadclient');
|
||||
this._navigate('settings/downloadclient');
|
||||
},
|
||||
|
||||
showNotifications: function (e) {
|
||||
@ -92,7 +93,7 @@ define([
|
||||
}
|
||||
|
||||
this.ui.notificationsTab.tab('show');
|
||||
App.Router.navigate('settings/notifications');
|
||||
this._navigate('settings/notifications');
|
||||
},
|
||||
|
||||
showGeneral: function (e) {
|
||||
@ -101,7 +102,7 @@ define([
|
||||
}
|
||||
|
||||
this.ui.generalTab.tab('show');
|
||||
App.Router.navigate('settings/general');
|
||||
this._navigate('settings/general');
|
||||
},
|
||||
|
||||
showMisc: function (e) {
|
||||
@ -110,7 +111,13 @@ define([
|
||||
}
|
||||
|
||||
this.ui.miscTab.tab('show');
|
||||
App.Router.navigate('settings/misc');
|
||||
this._navigate('settings/misc');
|
||||
},
|
||||
|
||||
_navigate:function(route){
|
||||
require(['Router'], function(){
|
||||
App.Router.navigate(route);
|
||||
});
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
define(['app',
|
||||
'Settings/SettingsModelBase'], function (App, SettingsModelBase) {
|
||||
return SettingsModelBase.extend({
|
||||
url : App.Constants.ApiRoot + '/settings',
|
||||
url : window.ApiRoot + '/settings',
|
||||
successMessage: 'Settings saved',
|
||||
errorMessage : 'Failed to save settings'
|
||||
});
|
||||
|
@ -1,37 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
define(['app'], function () {
|
||||
NzbDrone.Shared.FormatHelpers.FileSizeHelper = function (sourceSize) {
|
||||
var size = Number(sourceSize);
|
||||
return size.bytes(1);
|
||||
};
|
||||
define(
|
||||
[
|
||||
'sugar'
|
||||
], {
|
||||
FileSizeHelper: function (sourceSize) {
|
||||
var size = Number(sourceSize);
|
||||
return size.bytes(1);
|
||||
},
|
||||
|
||||
NzbDrone.Shared.FormatHelpers.DateHelper = function (sourceDate) {
|
||||
if (!sourceDate) {
|
||||
return '';
|
||||
}
|
||||
DateHelper: function (sourceDate) {
|
||||
if (!sourceDate) {
|
||||
return '';
|
||||
}
|
||||
|
||||
var date = Date.create(sourceDate);
|
||||
var date = Date.create(sourceDate);
|
||||
|
||||
if (date.isYesterday()) {
|
||||
return 'Yesterday';
|
||||
}
|
||||
if (date.isToday()) {
|
||||
return 'Today';
|
||||
}
|
||||
if (date.isTomorrow()) {
|
||||
return 'Tomorrow';
|
||||
}
|
||||
if (date.isAfter(Date.create('tomorrow')) && date.isBefore(Date.create().addDays(7))) {
|
||||
return date.format('{Weekday}');
|
||||
}
|
||||
if (date.isYesterday()) {
|
||||
return 'Yesterday';
|
||||
}
|
||||
if (date.isToday()) {
|
||||
return 'Today';
|
||||
}
|
||||
if (date.isTomorrow()) {
|
||||
return 'Tomorrow';
|
||||
}
|
||||
if (date.isAfter(Date.create('tomorrow')) && date.isBefore(Date.create().addDays(7))) {
|
||||
return date.format('{Weekday}');
|
||||
}
|
||||
|
||||
if (date.isAfter(Date.create().addDays(6))) {
|
||||
return date.relative().replace(' from now', '');
|
||||
if (date.isAfter(Date.create().addDays(6))) {
|
||||
return date.relative().replace(' from now', '');
|
||||
}
|
||||
|
||||
return date.format('{MM}/{dd}/{yyyy}');
|
||||
}
|
||||
|
||||
return date.format('{MM}/{dd}/{yyyy}');
|
||||
};
|
||||
|
||||
return NzbDrone.Shared.FormatHelpers;
|
||||
});
|
||||
});
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user