1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-30 23:42:33 +01:00

series structure cleanup.

This commit is contained in:
kay.one 2013-03-03 14:42:26 -08:00
parent 62f15d4d96
commit 4a4e440ec0
18 changed files with 35 additions and 34 deletions

View File

@ -1,8 +1,8 @@
define(['app', 'Shared/ModalRegion', 'AddSeries/AddSeriesLayout',
'Series/SeriesCollectionView', 'Upcoming/UpcomingCollectionView',
'Series/Index/SeriesIndexCollectionView', 'Upcoming/UpcomingCollectionView',
'Calendar/CalendarCollectionView', 'Shared/NotificationView',
'Shared/NotFoundView', 'MainMenuView', 'HeaderView',
'Series/Details/SeriesDetailsView', 'Series/Details/EpisodeCollection'],
'Series/Details/SeriesDetailsView', 'Series/EpisodeCollection'],
function (app, modalRegion) {
var controller = Backbone.Marionette.Controller.extend({
@ -14,7 +14,7 @@
series: function (action, query) {
this.setTitle('NzbDrone');
NzbDrone.mainRegion.show(new NzbDrone.Series.SeriesCollectionView());
NzbDrone.mainRegion.show(new NzbDrone.Series.Index.SeriesIndexCollectionView());
},
upcoming: function (action, query) {

View File

@ -137,7 +137,7 @@
<Content Include="Series\EmptySeriesCollectionTemplate.html" />
<Content Include="Series\SeriesCollection.js" />
<Content Include="Series\SeriesCollectionTemplate.html" />
<Content Include="Series\SeriesCollectionView.js" />
<Content Include="Series\SeriesIndexCollectionView.js" />
<Content Include="Series\SeriesItemTemplate.html" />
<Content Include="Series\SeriesItemView.js" />
<Content Include="Series\SeriesModel.js" />

View File

@ -2,7 +2,7 @@
define(['app', 'Series/SeriesModel'], function () {
NzbDrone.Series.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
NzbDrone.Series.Delete.DeleteSeriesView = Backbone.Marionette.ItemView.extend({
template:'Series/Delete/DeleteSeriesTemplate',
tagName:'div',
className:"modal",

View File

@ -1,6 +0,0 @@
define(['app', 'Series/Details/EpisodeModel'], function () {
NzbDrone.Series.Details.EpisodeCollection = Backbone.Collection.extend({
url: NzbDrone.Constants.ApiRoot + '/episode',
model: NzbDrone.Series.Details.EpisodeModel
});
});

View File

@ -1,5 +1,5 @@
'use strict';
define(['app', 'Series/Details/SeasonModel'], function () {
define(['app', 'Series/SeasonModel'], function () {
NzbDrone.Series.Details.EpisodeItemView = Backbone.Marionette.ItemView.extend({
template: 'Series/Details/EpisodeItemTemplate',

View File

@ -1,6 +0,0 @@
define(['app','Series/Details/SeasonModel'], function () {
NzbDrone.Series.Details.SeasonCollection = Backbone.Collection.extend({
url: NzbDrone.Constants.ApiRoot + '/season',
model: NzbDrone.Series.Details.SeasonModel
});
});

View File

@ -1,4 +1,4 @@
define(['app', 'Quality/QualityProfileCollection', 'Series/Details/SeasonCompositeView', 'Series/Details/SeasonCollection'], function () {
define(['app', 'Quality/QualityProfileCollection', 'Series/Details/SeasonCompositeView', 'Series/SeasonCollection'], function () {
NzbDrone.Series.Details.SeriesDetailsView = Backbone.Marionette.CompositeView.extend({
itemView: NzbDrone.Series.Details.SeasonCompositeView,
@ -6,7 +6,7 @@ define(['app', 'Quality/QualityProfileCollection', 'Series/Details/SeasonComposi
template: 'Series/Details/SeriesDetailsTemplate',
initialize: function () {
this.collection = new NzbDrone.Series.Details.SeasonCollection();
this.collection = new NzbDrone.Series.SeasonCollection();
this.collection.fetch({data: { seriesId: this.model.get('id') }});
}
});

View File

@ -1,7 +1,7 @@
'use strict';
define(['app', 'Series/SeriesModel', 'Series/Delete/DeleteSeriesView', 'Quality/QualityProfileCollection'], function () {
NzbDrone.Series.EditSeriesView = Backbone.Marionette.ItemView.extend({
NzbDrone.Series.Edit.EditSeriesView = Backbone.Marionette.ItemView.extend({
template: 'Series/Edit/EditSeriesTemplate',
tagName: 'div',
className: "modal",
@ -36,7 +36,7 @@ define(['app', 'Series/SeriesModel', 'Series/Delete/DeleteSeriesView', 'Quality/
},
removeSeries: function () {
var view = new NzbDrone.Series.DeleteSeriesView({ model: this.model });
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
NzbDrone.modalRegion.show(view);
}
});

View File

@ -0,0 +1,6 @@
define(['app', 'Series/EpisodeModel'], function () {
NzbDrone.Series.EpisodeCollection = Backbone.Collection.extend({
url: NzbDrone.Constants.ApiRoot + '/episode',
model: NzbDrone.Series.EpisodeModel
});
});

View File

@ -1,5 +1,5 @@
define(['app'], function (app) {
NzbDrone.Series.Details.EpisodeModel = Backbone.Model.extend({
define(['app'], function () {
NzbDrone.Series.EpisodeModel = Backbone.Model.extend({
mutators: {

View File

@ -1,10 +1,10 @@
'use strict';
define(['app', 'Quality/QualityProfileCollection', 'Series/SeriesItemView'], function (app, qualityProfileCollection) {
NzbDrone.Series.SeriesCollectionView = Backbone.Marionette.CompositeView.extend({
itemView: NzbDrone.Series.SeriesItemView,
define(['app', 'Quality/QualityProfileCollection', 'Series/Index/SeriesItemView'], function (app, qualityProfileCollection) {
NzbDrone.Series.Index.SeriesIndexCollectionView = Backbone.Marionette.CompositeView.extend({
itemView: NzbDrone.Series.Index.SeriesItemView,
itemViewContainer: 'tbody',
template: 'Series/SeriesCollectionTemplate',
template: 'Series/Index/SeriesIndexTemplate',
qualityProfileCollection: qualityProfileCollection,
//emptyView: NzbDrone.Series.EmptySeriesCollectionView,
@ -88,7 +88,7 @@ define(['app', 'Quality/QualityProfileCollection', 'Series/SeriesItemView'], fun
});
});
NzbDrone.Series.EmptySeriesCollectionView = Backbone.Marionette.CompositeView.extend({
template: 'Series/EmptySeriesCollectionTemplate',
NzbDrone.Series.Index.EmptySeriesCollectionView = Backbone.Marionette.CompositeView.extend({
template: 'Series/Index/EmptySeriesCollectionTemplate',
tagName: 'tr'
});

View File

@ -9,8 +9,8 @@ define([
], function () {
NzbDrone.Series.SeriesItemView = Backbone.Marionette.ItemView.extend({
template: 'Series/SeriesItemTemplate',
NzbDrone.Series.Index.SeriesItemView = Backbone.Marionette.ItemView.extend({
template: 'Series/Index/SeriesItemTemplate',
tagName: 'tr',
ui: {
@ -40,7 +40,7 @@ define([
},
removeSeries: function () {
var view = new NzbDrone.Series.DeleteSeriesView({ model: this.model });
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
NzbDrone.vent.trigger(NzbDrone.Events.OpenModalDialog, {
view: view
});

View File

@ -0,0 +1,6 @@
define(['app','Series/SeasonModel'], function () {
NzbDrone.Series.SeasonCollection = Backbone.Collection.extend({
url: NzbDrone.Constants.ApiRoot + '/season',
model: NzbDrone.Series.SeasonModel
});
});

View File

@ -1,5 +1,5 @@
define(['app'], function () {
NzbDrone.Series.Details.SeasonModel = Backbone.Model.extend({
NzbDrone.Series.SeasonModel = Backbone.Model.extend({
mutators: {
seasonTitle: function () {

View File

@ -30,6 +30,7 @@ define('app', function () {
window.NzbDrone = new Backbone.Marionette.Application();
window.NzbDrone.Series = {};
window.NzbDrone.Series.Index = {};
window.NzbDrone.Series.Edit = {};
window.NzbDrone.Series.Delete = {};
window.NzbDrone.Series.Details = {};