From 4015984900df4ce9ce81c3e36d796445c4e553a3 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Thu, 6 Jun 2013 20:52:46 -0700 Subject: [PATCH] added placeholder image for missing posters. --- Gruntfile.js | 8 ++++++++ UI/AddSeries/SearchResultTemplate.html | 2 +- UI/Series/Details/SeriesDetailsTemplate.html | 2 +- UI/Series/Index/List/ItemTemplate.html | 2 +- UI/Series/Index/Posters/ItemTemplate.html | 2 +- UI/Shared/TemplateHelpers.js | 12 ++++++++---- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index a39a3b0f2..0179b5a00 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -105,6 +105,10 @@ module.exports = function (grunt) { src : 'UI/**/*.png', dest: '_output/' }, + jpg : { + src : 'UI/**/*.jpg', + dest: '_output/' + }, fonts : { src : 'UI/**/FontAwesome/*.*', dest: '_output/' @@ -140,6 +144,10 @@ module.exports = function (grunt) { files: '<%= copy.images.src %>', tasks: ['copy:images'] }, + copyImages : { + files: '<%= copy.jpg.src %>', + tasks: ['copy:jpg'] + }, copyFonts : { files: '<%= copy.fonts.src %>', tasks: ['copy:fonts'] diff --git a/UI/AddSeries/SearchResultTemplate.html b/UI/AddSeries/SearchResultTemplate.html index 9feb77956..c3180cb0d 100644 --- a/UI/AddSeries/SearchResultTemplate.html +++ b/UI/AddSeries/SearchResultTemplate.html @@ -2,7 +2,7 @@
diff --git a/UI/Series/Details/SeriesDetailsTemplate.html b/UI/Series/Details/SeriesDetailsTemplate.html index a2cbe214c..b51d5e7a1 100644 --- a/UI/Series/Details/SeriesDetailsTemplate.html +++ b/UI/Series/Details/SeriesDetailsTemplate.html @@ -1,7 +1,7 @@ 
diff --git a/UI/Series/Index/List/ItemTemplate.html b/UI/Series/Index/List/ItemTemplate.html index d77c32b21..c3c109bc5 100644 --- a/UI/Series/Index/List/ItemTemplate.html +++ b/UI/Series/Index/List/ItemTemplate.html @@ -2,7 +2,7 @@
diff --git a/UI/Series/Index/Posters/ItemTemplate.html b/UI/Series/Index/Posters/ItemTemplate.html index 8ad833990..f95e41074 100644 --- a/UI/Series/Index/Posters/ItemTemplate.html +++ b/UI/Series/Index/Posters/ItemTemplate.html @@ -11,7 +11,7 @@
Ended
{{/unless}} - +
diff --git a/UI/Shared/TemplateHelpers.js b/UI/Shared/TemplateHelpers.js index d43135cce..90e4cf98f 100644 --- a/UI/Shared/TemplateHelpers.js +++ b/UI/Shared/TemplateHelpers.js @@ -8,7 +8,7 @@ define(['app'], function () { return new Handlebars.SafeString(templateFunction(this)); }); - Handlebars.registerHelper("debug", function(optionalValue) { + Handlebars.registerHelper("debug", function (optionalValue) { console.log("Current Context"); console.log("===================="); console.log(this); @@ -20,11 +20,11 @@ define(['app'], function () { } }); - Handlebars.registerHelper("fileSize", function(size) { + Handlebars.registerHelper("fileSize", function (size) { return NzbDrone.Shared.FormatHelpers.FileSizeHelper(size); }); - Handlebars.registerHelper("date", function(date) { + Handlebars.registerHelper("date", function (date) { //TODO: show actual date in tooltip if (!date) { return ''; @@ -36,4 +36,8 @@ define(['app'], function () { return new Handlebars.SafeString(result); }); -}); \ No newline at end of file + + Handlebars.registerHelper('defaultImg', function () { + return new Handlebars.SafeString(' onerror="this.src=\'/content/images/poster-dark.jpg\';"'); + }); +});