diff --git a/src/UI/Movies/Details/MoviesDetailsLayout.js b/src/UI/Movies/Details/MoviesDetailsLayout.js index fc251a049..a38793aa4 100644 --- a/src/UI/Movies/Details/MoviesDetailsLayout.js +++ b/src/UI/Movies/Details/MoviesDetailsLayout.js @@ -42,7 +42,7 @@ module.exports = Marionette.Layout.extend({ events : { 'click .x-episode-file-editor' : '_openEpisodeFileEditor', 'click .x-monitored' : '_toggleMonitored', - 'click .x-edit' : '_editMovies', + 'click .x-edit' : '_editMovie', 'click .x-refresh' : '_refreshMovies', 'click .x-rename' : '_renameMovies', 'click .x-search' : '_moviesSearch', @@ -167,8 +167,8 @@ module.exports = Marionette.Layout.extend({ } }, - _editMovies : function() { - vent.trigger(vent.Commands.EditMoviesCommand, { movie : this.model }); + _editMovie : function() { + vent.trigger(vent.Commands.EditMovieCommand, { movie : this.model }); }, _refreshMovies : function() { diff --git a/src/UI/Movies/Edit/EditMovieTemplate.hbs b/src/UI/Movies/Edit/EditMovieTemplate.hbs new file mode 100644 index 000000000..c59520c7c --- /dev/null +++ b/src/UI/Movies/Edit/EditMovieTemplate.hbs @@ -0,0 +1,97 @@ +
diff --git a/src/UI/Movies/Edit/EditMovieView.js b/src/UI/Movies/Edit/EditMovieView.js new file mode 100644 index 000000000..db5a626a7 --- /dev/null +++ b/src/UI/Movies/Edit/EditMovieView.js @@ -0,0 +1,54 @@ +var vent = require('vent'); +var Marionette = require('marionette'); +var Profiles = require('../../Profile/ProfileCollection'); +var AsModelBoundView = require('../../Mixins/AsModelBoundView'); +var AsValidatedView = require('../../Mixins/AsValidatedView'); +var AsEditModalView = require('../../Mixins/AsEditModalView'); +require('../../Mixins/TagInput'); +require('../../Mixins/FileBrowser'); + +var view = Marionette.ItemView.extend({ + template : 'Movies/Edit/EditMovieTemplate', + + ui : { + profile : '.x-profile', + path : '.x-path', + tags : '.x-tags' + }, + + events : { + 'click .x-remove' : '_removeSeries' + }, + + initialize : function() { + this.model.set('profiles', Profiles); + }, + + onRender : function() { + this.ui.path.fileBrowser(); + this.ui.tags.tagInput({ + model : this.model, + property : 'tags' + }); + }, + + _onBeforeSave : function() { + var profileId = this.ui.profile.val(); + this.model.set({ profileId : profileId }); + }, + + _onAfterSave : function() { + this.trigger('saved'); + vent.trigger(vent.Commands.CloseModalCommand); + }, + + _removeSeries : function() { + vent.trigger(vent.Commands.DeleteSeriesCommand, { series : this.model }); + } +}); + +AsModelBoundView.call(view); +AsValidatedView.call(view); +AsEditModalView.call(view); + +module.exports = view; diff --git a/src/UI/Movies/Index/MoviesIndexItemView.js b/src/UI/Movies/Index/MoviesIndexItemView.js index e7b38fae7..999b8367a 100644 --- a/src/UI/Movies/Index/MoviesIndexItemView.js +++ b/src/UI/Movies/Index/MoviesIndexItemView.js @@ -23,7 +23,7 @@ module.exports = Marionette.ItemView.extend({ }, _editSeries : function() { - vent.trigger(vent.Commands.EditSeriesCommand, { series : this.model }); + vent.trigger(vent.Commands.EditMovieCommand, { movie : this.model }); }, _refreshSeries : function() { diff --git a/src/UI/Movies/Index/Overview/SeriesOverviewItemViewTemplate.hbs b/src/UI/Movies/Index/Overview/SeriesOverviewItemViewTemplate.hbs index e16191edb..c222b56cb 100644 --- a/src/UI/Movies/Index/Overview/SeriesOverviewItemViewTemplate.hbs +++ b/src/UI/Movies/Index/Overview/SeriesOverviewItemViewTemplate.hbs @@ -14,8 +14,8 @@