From 2eedfca78ab51df2bacb1a63c3db324e3e88e653 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Mon, 2 Jan 2017 21:02:54 +0100 Subject: [PATCH] Movie history now fully implemented. --- .../Activity/History/Details/HistoryDetailsLayout.js | 2 +- src/UI/Activity/History/HistoryCollection.js | 2 +- src/UI/Activity/History/HistoryLayout.js | 12 ++++++------ src/UI/Cells/MovieTitleCell.js | 11 +++++++++++ 4 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 src/UI/Cells/MovieTitleCell.js diff --git a/src/UI/Activity/History/Details/HistoryDetailsLayout.js b/src/UI/Activity/History/Details/HistoryDetailsLayout.js index 5654a3e72..42f583ddb 100644 --- a/src/UI/Activity/History/Details/HistoryDetailsLayout.js +++ b/src/UI/Activity/History/Details/HistoryDetailsLayout.js @@ -32,4 +32,4 @@ module.exports = Marionette.Layout.extend({ vent.trigger(vent.Commands.CloseModalCommand); } -}); \ No newline at end of file +}); diff --git a/src/UI/Activity/History/HistoryCollection.js b/src/UI/Activity/History/HistoryCollection.js index 8adb6e96b..5eb4dc4f7 100644 --- a/src/UI/Activity/History/HistoryCollection.js +++ b/src/UI/Activity/History/HistoryCollection.js @@ -50,7 +50,7 @@ var Collection = PageableCollection.extend({ }, sortMappings : { - 'series' : { sortKey : 'series.sortTitle' } + 'movie' : { sortKey : 'movie.sortTitle' } }, initialize : function(options) { diff --git a/src/UI/Activity/History/HistoryLayout.js b/src/UI/Activity/History/HistoryLayout.js index ae7e4c93e..28e919365 100644 --- a/src/UI/Activity/History/HistoryLayout.js +++ b/src/UI/Activity/History/HistoryLayout.js @@ -2,7 +2,7 @@ var Marionette = require('marionette'); var Backgrid = require('backgrid'); var HistoryCollection = require('./HistoryCollection'); var EventTypeCell = require('../../Cells/EventTypeCell'); -var SeriesTitleCell = require('../../Cells/SeriesTitleCell'); +var MovieTitleCell = require('../../Cells/MovieTitleCell'); var EpisodeNumberCell = require('../../Cells/EpisodeNumberCell'); var EpisodeTitleCell = require('../../Cells/EpisodeTitleCell'); var HistoryQualityCell = require('./HistoryQualityCell'); @@ -29,11 +29,11 @@ module.exports = Marionette.Layout.extend({ cellValue : 'this' }, { - name : 'series', - label : 'Series', - cell : SeriesTitleCell + name : 'movies', + label : 'Movie Title', + cell : MovieTitleCell }, - { + /*{ name : 'episode', label : 'Episode', cell : EpisodeNumberCell, @@ -44,7 +44,7 @@ module.exports = Marionette.Layout.extend({ label : 'Episode Title', cell : EpisodeTitleCell, sortable : false - }, + },*/ { name : 'this', label : 'Quality', diff --git a/src/UI/Cells/MovieTitleCell.js b/src/UI/Cells/MovieTitleCell.js new file mode 100644 index 000000000..4ae8fe20c --- /dev/null +++ b/src/UI/Cells/MovieTitleCell.js @@ -0,0 +1,11 @@ +var TemplatedCell = require('./TemplatedCell'); + +module.exports = TemplatedCell.extend({ + className : 'series-title-cell', + template : 'Cells/SeriesTitleTemplate', + + render : function() { + this.$el.html(this.model.get("movie").get("title")); //Hack, but somehow handlebar helper does not work. + return this; + } +});