From cf3e16e6a1fb9edacaad6a6ef3efd0d3fe7cc4b5 Mon Sep 17 00:00:00 2001 From: Zoltan Szabo Date: Wed, 7 Nov 2012 15:58:28 +0200 Subject: [PATCH 1/2] Refs #9562; Display image on view when javascript is disabled --- docs/HISTORY.txt | 2 ++ eea/app/visualization/browser/css/view.css | 9 +++++++++ eea/app/visualization/browser/js/view.js | 2 ++ eea/app/visualization/views/view.py | 4 +++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt index 4b1611e..29242e1 100644 --- a/docs/HISTORY.txt +++ b/docs/HISTORY.txt @@ -3,6 +3,8 @@ Changelog 6.1-dev - (unreleased) ---------------------- +* Feature: Display image when javascript is disabled + [szabozo0 refs #9562] * Upgrade step: Within "Plone > Site setup > Add-ons" click on upgrade button available for eea.app.visualization * Feature: Added utilities to get and convert external URL to diff --git a/eea/app/visualization/browser/css/view.css b/eea/app/visualization/browser/css/view.css index e586a92..931ce0f 100644 --- a/eea/app/visualization/browser/css/view.css +++ b/eea/app/visualization/browser/css/view.css @@ -81,3 +81,12 @@ ul.chart-tabs li:first-of-type a:hover { clear: both; visibility: hidden; } + +/* noscript */ +.daviz-tab-view-noscript { + display:none; +} + +.daviz-tab-view-noscript:target { + display:block +} diff --git a/eea/app/visualization/browser/js/view.js b/eea/app/visualization/browser/js/view.js index 006178c..51f4c1a 100644 --- a/eea/app/visualization/browser/js/view.js +++ b/eea/app/visualization/browser/js/view.js @@ -44,4 +44,6 @@ jQuery(document).ready(function(){ return false; }); + jQuery(".daviz-tab-view-noscript").removeClass("daviz-tab-view-noscript"); + }); diff --git a/eea/app/visualization/views/view.py b/eea/app/visualization/views/view.py index 279ae04..df8611e 100644 --- a/eea/app/visualization/views/view.py +++ b/eea/app/visualization/views/view.py @@ -32,7 +32,9 @@ def tabs(self): {'name': self.__name__, 'title': self.label, 'css': tabname, - 'tabname': tabname + 'tabname': tabname, + 'fallback-image': self.context.absolute_url() + \ + "/++resource++" + self.__name__ + ".preview.png" }, ] From 52768148287760c589df533459dd790e0ec1997b Mon Sep 17 00:00:00 2001 From: Zoltan Szabo Date: Thu, 8 Nov 2012 15:46:24 +0200 Subject: [PATCH 2/2] Refs #9562; Added warning message when default image is displayed on view --- eea/app/visualization/browser/css/view.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eea/app/visualization/browser/css/view.css b/eea/app/visualization/browser/css/view.css index 931ce0f..9f5fe02 100644 --- a/eea/app/visualization/browser/css/view.css +++ b/eea/app/visualization/browser/css/view.css @@ -88,5 +88,11 @@ ul.chart-tabs li:first-of-type a:hover { } .daviz-tab-view-noscript:target { - display:block + display:block; +} + +.daviz-tab-norealchart { + border:1px solid red; + color:red; + float:left; }