From 38886b28f716d21e99fd0f6374b48ca8809ad5af Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 6 Sep 2013 23:05:41 +0200 Subject: [PATCH] Hide soon and late blocks on dashboard if their empty. fix #1778 --- couchpotato/core/media/movie/_base/static/list.js | 6 +++--- couchpotato/static/scripts/page/home.js | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/couchpotato/core/media/movie/_base/static/list.js b/couchpotato/core/media/movie/_base/static/list.js index 5c883b1d..341d2348 100644 --- a/couchpotato/core/media/movie/_base/static/list.js +++ b/couchpotato/core/media/movie/_base/static/list.js @@ -285,11 +285,11 @@ var MovieList = new Class({ }, self.filter), 'onSuccess': function(json){ available_chars = json.chars - + json.chars.split('').each(function(c){ self.letters[c.capitalize()].addClass('available') }) - + } }); }); @@ -568,7 +568,7 @@ var MovieList = new Class({ } self.store(json.movies); - self.addMovies(json.movies, json.total); + self.addMovies(json.movies, json.total || json.movies.length); if(self.scrollspy) { self.load_more.set('text', 'load more movies'); self.scrollspy.start(); diff --git a/couchpotato/static/scripts/page/home.js b/couchpotato/static/scripts/page/home.js index 75601df2..b93db5bd 100644 --- a/couchpotato/static/scripts/page/home.js +++ b/couchpotato/static/scripts/page/home.js @@ -74,10 +74,6 @@ Page.Home = new Class({ 'limit': 12, 'title': 'Available soon', 'description': 'These are being searched for and should be available soon as they will be released on DVD in the next few weeks.', - 'on_empty_element': new Element('div').adopt( - new Element('h2', {'text': 'Available soon'}), - new Element('span', {'text': 'There are no movies available soon. Add some movies, so you have something to watch later.'}) - ), 'filter': { 'random': true },