From 3e13d5ae1f187d3178edb49b168d4ad0f27d9680 Mon Sep 17 00:00:00 2001 From: Michael Price Date: Mon, 12 Mar 2018 15:47:07 -0400 Subject: [PATCH] Move the invalid document markup to a separate HTML template. Signed-off-by: Michael Price --- .../static/appearance/js/mayan_image.js | 11 +++------- .../appearance/templates/appearance/root.html | 20 +++++++++++++++++++ .../templates/documents/invalid_document.html | 6 ------ 3 files changed, 23 insertions(+), 14 deletions(-) delete mode 100644 mayan/apps/documents/templates/documents/invalid_document.html diff --git a/mayan/apps/appearance/static/appearance/js/mayan_image.js b/mayan/apps/appearance/static/appearance/js/mayan_image.js index f146b4b279..a3d7c47108 100644 --- a/mayan/apps/appearance/static/appearance/js/mayan_image.js +++ b/mayan/apps/appearance/static/appearance/js/mayan_image.js @@ -49,15 +49,10 @@ MayanImage.intialize = function () { }); } +MayanImage.templateInvalidDocument = $('#template-invalid-document').html(); + MayanImage.prototype.onImageError = function () { - this.element.parent().parent().html('\ -
\ - \ - \ - \ - \ -
\ - ') + this.element.parent().parent().html(MayanImage.templateInvalidDocument); // Remove border to indicate non interactive image this.element.removeClass('thin_border'); diff --git a/mayan/apps/appearance/templates/appearance/root.html b/mayan/apps/appearance/templates/appearance/root.html index d9034b6193..0ac8e7c730 100644 --- a/mayan/apps/appearance/templates/appearance/root.html +++ b/mayan/apps/appearance/templates/appearance/root.html @@ -117,6 +117,26 @@ + + + +