[ckan-changes] [okfn/ckan] 345e44: [2285] Removed border from iframe

GitHub noreply at github.com
Wed Apr 25 16:36:14 UTC 2012


  Branch: refs/heads/master
  Home:   https://github.com/okfn/ckan
  Commit: 345e44a352e73c0776a47d8d71ed0e9e623de5a0
      https://github.com/okfn/ckan/commit/345e44a352e73c0776a47d8d71ed0e9e623de5a0
  Author: Ian Murray <ian.murray at okfn.org>
  Date:   2012-04-25 (Wed, 25 Apr 2012)

  Changed paths:
    M ckan/public/scripts/application.js

  Log Message:
  -----------
  [2285] Removed border from iframe


diff --git a/ckan/public/scripts/application.js b/ckan/public/scripts/application.js
index 46456c2..51f9dbe 100644
--- a/ckan/public/scripts/application.js
+++ b/ckan/public/scripts/application.js
@@ -1396,7 +1396,7 @@ CKAN.DataPreview = function ($, my) {
 
         // Escape '"' characters in {{link}} in order not to prematurely close
         // the src attribute value.
-        embedIframeText.val($.mustache('<iframe width="{{width}}" height="{{height}}" src="{{link}}"></iframe>',
+        embedIframeText.val($.mustache('<iframe frameBorder="0" width="{{width}}" height="{{height}}" src="{{link}}"></iframe>',
                                        {
                                          link: link.replace(/"/g, '"'),
                                          width: width,


================================================================
  Commit: 5e5d81423a16fc077d8a02f9e2f038538c8c61f9
      https://github.com/okfn/ckan/commit/5e5d81423a16fc077d8a02f9e2f038538c8c61f9
  Author: Ian Murray <ian.murray at okfn.org>
  Date:   2012-04-25 (Wed, 25 Apr 2012)

  Changed paths:
    M ckan/templates/_snippet/data-viewer-embed-branded-link.html
    M ckan/templates/package/resource_embedded_dataviewer.html

  Log Message:
  -----------
  [2285] Reduced logo size on the embedded data viewer page


diff --git a/ckan/templates/_snippet/data-viewer-embed-branded-link.html b/ckan/templates/_snippet/data-viewer-embed-branded-link.html
index 87eceb6..4bd0e45 100644
--- a/ckan/templates/_snippet/data-viewer-embed-branded-link.html
+++ b/ckan/templates/_snippet/data-viewer-embed-branded-link.html
@@ -10,7 +10,7 @@
   <p>Powered by <a href="${h.url_for(controller='package', action='resource_read', id=c.package.id, resource_id=c.resource.id)}">
   
   ${g.site_title}
-  <img width="64" src="${h.url_for_static(g.site_logo)}" alt="${g.site_title} Logo" title="${g.site_title} Logo" id="logo" />
+  <img width="28" src="${h.url_for_static(g.site_logo)}" alt="${g.site_title} Logo" title="${g.site_title} Logo" id="logo" />
   </a>
   </p>
 </div>
diff --git a/ckan/templates/package/resource_embedded_dataviewer.html b/ckan/templates/package/resource_embedded_dataviewer.html
index c03f4b9..1238e48 100644
--- a/ckan/templates/package/resource_embedded_dataviewer.html
+++ b/ckan/templates/package/resource_embedded_dataviewer.html
@@ -43,23 +43,23 @@
 
       #ckanext-datapreview {
         width: ${c.width-2}px;
-        height: ${c.height-115}px;
+        height: ${c.height-81}px;
       }
 
       .recline-grid-container {
-        height: ${c.height-115}px;
+        height: ${c.height-81}px;
       }
 
       .recline-graph .graph {
-        height: ${c.height-115}px;
+        height: ${c.height-81}px;
       }
 
       .recline-map .map {
-        height: ${c.height-115}px;
+        height: ${c.height-81}px;
       }
 
       .branded-link {
-        height: 70px;
+        height: 34px;
       }
 
       .alert-messages {


================================================================
  Commit: 888d9fa26a58dc28e636bde9bece77885583c20a
      https://github.com/okfn/ckan/commit/888d9fa26a58dc28e636bde9bece77885583c20a
  Author: Ian Murray <ian.murray at okfn.org>
  Date:   2012-04-25 (Wed, 25 Apr 2012)

  Changed paths:
    M ckan/controllers/package.py
    M ckan/public/scripts/application.js

  Log Message:
  -----------
  [2285] Split out the state into separate query parameters


diff --git a/ckan/controllers/package.py b/ckan/controllers/package.py
index 79db466..644e809 100644
--- a/ckan/controllers/package.py
+++ b/ckan/controllers/package.py
@@ -757,8 +757,7 @@ def resource_embedded_dataviewer(self, id, resource_id):
 
         # Construct the recline state
         state_version = int(request.params.get('state_version', '1'))
-        raw_state = request.params.get('state', '')
-        recline_state = self._parse_recline_state(state_version, raw_state)
+        recline_state = self._parse_recline_state(request.params)
         if recline_state is None:
             abort(400, ('"state" parameter must be a valid recline state (version %d)' % state_version))
 
@@ -770,23 +769,28 @@ def resource_embedded_dataviewer(self, id, resource_id):
 
         return render('package/resource_embedded_dataviewer.html')
 
-    def _parse_recline_state(self, state_version, raw_state):
-        if state_version != 1:  # Only support one version at the moment
+    def _parse_recline_state(self, params):
+        state_version = int(request.params.get('state_version', '1'))
+        if state_version != 1:
             return None
 
-        try:
-            state = json.loads(raw_state)
-        except ValueError:
-            return None
+        recline_state = {}
+        for k,v in request.params.items():
+            try:
+                v = json.loads(v)
+            except ValueError:
+                pass
+            recline_state[k] = v
 
-        # Ensure the state is readOnly
-        state['readOnly'] = True
+        recline_state.pop('width', None)
+        recline_state.pop('height', None)
+        recline_state['readOnly'] = True
 
         # Ensure only the currentView is available
-        if not state.get('currentView', None):
-            state['currentView'] = 'grid'   # default to grid view if none specified
-        for k in state.keys():
-            if k.startswith('view-') and not k.endswith(state['currentView']):
-                state.pop(k)
+        if not recline_state.get('currentView', None):
+            recline_state['currentView'] = 'grid'   # default to grid view if none specified
+        for k in recline_state.keys():
+            if k.startswith('view-') and not k.endswith(recline_state['currentView']):
+                recline_state.pop(k)
+        return recline_state
 
-        return state
diff --git a/ckan/public/scripts/application.js b/ckan/public/scripts/application.js
index 51f9dbe..fab2e7b 100644
--- a/ckan/public/scripts/application.js
+++ b/ckan/public/scripts/application.js
@@ -1318,10 +1318,8 @@ CKAN.DataPreview = function ($, my) {
   my.makeEmbedLink = function(explorerState) {
     var state = explorerState.toJSON();
     state.dataset.url = escape(state.dataset.url);
-    var qs = recline.View.composeQueryString({
-      state:         explorerState.toJSON(),
-      state_version: 1
-    });
+    state.state_version = 1;
+    var qs = recline.View.composeQueryString(state);
     return embedPath + qs;
   };
 


================================================================
  Commit: 20638abca316be56b7e1a198f80668e73d82a384
      https://github.com/okfn/ckan/commit/20638abca316be56b7e1a198f80668e73d82a384
  Author: Ian Murray <ian.murray at okfn.org>
  Date:   2012-04-25 (Wed, 25 Apr 2012)

  Changed paths:
    R ckan/templates/_snippet/data-viewer-embed-branded-link.html
    R ckan/templates/_snippet/data-viewer-embed-dialog.html
    M ckan/templates/package/resource_embedded_dataviewer.html
    M ckan/templates/package/resource_read.html
    A ckan/templates/snippets/data-viewer-embed-branded-link.html
    A ckan/templates/snippets/data-viewer-embed-dialog.html

  Log Message:
  -----------
  [2285] Moved snippets from _snippet/ to snippets/


diff --git a/ckan/templates/_snippet/data-viewer-embed-branded-link.html b/ckan/templates/_snippet/data-viewer-embed-branded-link.html
deleted file mode 100644
index 4bd0e45..0000000
--- a/ckan/templates/_snippet/data-viewer-embed-branded-link.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<html
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:i18n="http://genshi.edgewall.org/i18n"
-  xmlns:py="http://genshi.edgewall.org/"
-  xmlns:xi="http://www.w3.org/2001/XInclude"
-  py:strip=""
-  >
-
-<div class="branded-link">
-  <p>Powered by <a href="${h.url_for(controller='package', action='resource_read', id=c.package.id, resource_id=c.resource.id)}">
-  
-  ${g.site_title}
-  <img width="28" src="${h.url_for_static(g.site_logo)}" alt="${g.site_title} Logo" title="${g.site_title} Logo" id="logo" />
-  </a>
-  </p>
-</div>
-
-</html>
-
diff --git a/ckan/templates/_snippet/data-viewer-embed-dialog.html b/ckan/templates/_snippet/data-viewer-embed-dialog.html
deleted file mode 100644
index b0b382d..0000000
--- a/ckan/templates/_snippet/data-viewer-embed-dialog.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<html
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:i18n="http://genshi.edgewall.org/i18n"
-  xmlns:py="http://genshi.edgewall.org/"
-  xmlns:xi="http://www.w3.org/2001/XInclude"
-  py:strip=""
-  >
-
-<div class="modal-data-viewer-embed-dialog modal fade in" style="display: none;"
-  py:def="data_viewer_embed_dialog()">
-  <div class="modal-header">
-    <a class="close" data-dismiss="modal">×</a>
-    <h3>
-      Embed Data Viewer
-    </h3>
-  </div>
-  <div class="modal-body">
-    <div>
-      <p><strong>Embed this view</strong> by copying this into your webpage:</p>
-      <textarea class="embedIframeText" style="width: 100%; height: 200px;"></textarea>
-      <p>Choose width and height in pixels:</p>
-      <label for="iframe-width">Width:</label>
-      <input class="iframe-width" name="iframe-width" value="800"/>
-      <label for="iframe-height">Height:</label>
-      <input class="iframe-height" name="iframe-height" value="500"/>
-    </div>
-    <a class="embedLink" href="">Preview</a>
-  </div>
-</div>
-
-</html>
diff --git a/ckan/templates/package/resource_embedded_dataviewer.html b/ckan/templates/package/resource_embedded_dataviewer.html
index 1238e48..5022a4d 100644
--- a/ckan/templates/package/resource_embedded_dataviewer.html
+++ b/ckan/templates/package/resource_embedded_dataviewer.html
@@ -82,7 +82,7 @@
     <div class="resource-preview">
       <div id="ckanext-datapreview"></div>
     </div>
-    <xi:include href="../_snippet/data-viewer-embed-branded-link.html" />
+    <xi:include href="../snippets/data-viewer-embed-branded-link.html" />
   </div>
 
   <py:def function="optional_footer">
diff --git a/ckan/templates/package/resource_read.html b/ckan/templates/package/resource_read.html
index c99805a..619c636 100644
--- a/ckan/templates/package/resource_read.html
+++ b/ckan/templates/package/resource_read.html
@@ -12,7 +12,7 @@
   py:strip="">
 
   <xi:include href="../_snippet/data-api-help.html" />
-  <xi:include href="../_snippet/data-viewer-embed-dialog.html" />
+  <xi:include href="../snippets/data-viewer-embed-dialog.html" />
 
   <py:def function="optional_head">
     <!-- data preview -->
diff --git a/ckan/templates/snippets/data-viewer-embed-branded-link.html b/ckan/templates/snippets/data-viewer-embed-branded-link.html
new file mode 100644
index 0000000..4bd0e45
--- /dev/null
+++ b/ckan/templates/snippets/data-viewer-embed-branded-link.html
@@ -0,0 +1,19 @@
+<html
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:i18n="http://genshi.edgewall.org/i18n"
+  xmlns:py="http://genshi.edgewall.org/"
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  py:strip=""
+  >
+
+<div class="branded-link">
+  <p>Powered by <a href="${h.url_for(controller='package', action='resource_read', id=c.package.id, resource_id=c.resource.id)}">
+  
+  ${g.site_title}
+  <img width="28" src="${h.url_for_static(g.site_logo)}" alt="${g.site_title} Logo" title="${g.site_title} Logo" id="logo" />
+  </a>
+  </p>
+</div>
+
+</html>
+
diff --git a/ckan/templates/snippets/data-viewer-embed-dialog.html b/ckan/templates/snippets/data-viewer-embed-dialog.html
new file mode 100644
index 0000000..b0b382d
--- /dev/null
+++ b/ckan/templates/snippets/data-viewer-embed-dialog.html
@@ -0,0 +1,31 @@
+<html
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:i18n="http://genshi.edgewall.org/i18n"
+  xmlns:py="http://genshi.edgewall.org/"
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  py:strip=""
+  >
+
+<div class="modal-data-viewer-embed-dialog modal fade in" style="display: none;"
+  py:def="data_viewer_embed_dialog()">
+  <div class="modal-header">
+    <a class="close" data-dismiss="modal">×</a>
+    <h3>
+      Embed Data Viewer
+    </h3>
+  </div>
+  <div class="modal-body">
+    <div>
+      <p><strong>Embed this view</strong> by copying this into your webpage:</p>
+      <textarea class="embedIframeText" style="width: 100%; height: 200px;"></textarea>
+      <p>Choose width and height in pixels:</p>
+      <label for="iframe-width">Width:</label>
+      <input class="iframe-width" name="iframe-width" value="800"/>
+      <label for="iframe-height">Height:</label>
+      <input class="iframe-height" name="iframe-height" value="500"/>
+    </div>
+    <a class="embedLink" href="">Preview</a>
+  </div>
+</div>
+
+</html>


================================================================
  Commit: af7e68135a92e6dc6af9b0571a2c41b86b5f46e3
      https://github.com/okfn/ckan/commit/af7e68135a92e6dc6af9b0571a2c41b86b5f46e3
  Author: Ian Murray <ian.murray at okfn.org>
  Date:   2012-04-25 (Wed, 25 Apr 2012)

  Changed paths:
    M ckan/public/scripts/vendor/recline/recline.js

  Log Message:
  -----------
  [2285] Pulled latest changes from recline


diff --git a/ckan/public/scripts/vendor/recline/recline.js b/ckan/public/scripts/vendor/recline/recline.js
index c1f9185..a4c01ca 100644
--- a/ckan/public/scripts/vendor/recline/recline.js
+++ b/ckan/public/scripts/vendor/recline/recline.js
@@ -1199,6 +1199,8 @@ my.Grid = Backbone.View.extend({
     var hiddenFields = this.state.get('hiddenFields');
     hiddenFields.push(this.tempState.currentColumn);
     this.state.set({hiddenFields: hiddenFields});
+    // change event not being triggered (because it is an array?) so trigger manually
+    this.state.trigger('change');
     this.render();
   },
   
@@ -2476,7 +2478,9 @@ my.DataExplorer = Backbone.View.extend({
         pageView.view.state.bind('change', function() {
           var update = {};
           update['view-' + pageView.id] = pageView.view.state.toJSON();
-          self.state.set(update);
+          // had problems where change not being triggered for e.g. grid view so let's do it explicitly
+          self.state.set(update, {silent: true});
+          self.state.trigger('change');
         });
       }
     });


================================================================
  Commit: c83a84e981d8654bf38fb41d61c4cc463399079b
      https://github.com/okfn/ckan/commit/c83a84e981d8654bf38fb41d61c4cc463399079b
  Author: Ian Murray <ian.murray at okfn.org>
  Date:   2012-04-25 (Wed, 25 Apr 2012)

  Changed paths:
    M ckan/public/scripts/application.js

  Log Message:
  -----------
  [2285] Properly escape all items in the query string


diff --git a/ckan/public/scripts/application.js b/ckan/public/scripts/application.js
index fab2e7b..26bfc44 100644
--- a/ckan/public/scripts/application.js
+++ b/ckan/public/scripts/application.js
@@ -1317,10 +1317,18 @@ CKAN.DataPreview = function ($, my) {
   // url to the embeddable view of the current dataexplorer state.
   my.makeEmbedLink = function(explorerState) {
     var state = explorerState.toJSON();
-    state.dataset.url = escape(state.dataset.url);
     state.state_version = 1;
-    var qs = recline.View.composeQueryString(state);
-    return embedPath + qs;
+
+    var queryString = '?';
+    var items = [];
+    $.each(state, function(key, value) {
+      if (typeof(value) === 'object') {
+        value = JSON.stringify(value);
+      }
+      items.push(key + '=' + escape(value));
+    });
+    queryString += items.join('&');
+    return embedPath + queryString;
   };
 
   // **Public: Loads a data preview**


================================================================
  Commit: b5ca629ae9cab143e16fd5527fea7e3d3a52fe3d
      https://github.com/okfn/ckan/commit/b5ca629ae9cab143e16fd5527fea7e3d3a52fe3d
  Author: Ian Murray <ian.murray at okfn.org>
  Date:   2012-04-25 (Wed, 25 Apr 2012)

  Changed paths:
    M ckan/controllers/package.py
    M ckan/public/scripts/application.js
    M ckan/public/scripts/vendor/recline/recline.js
    R ckan/templates/_snippet/data-viewer-embed-branded-link.html
    R ckan/templates/_snippet/data-viewer-embed-dialog.html
    M ckan/templates/package/resource_embedded_dataviewer.html
    M ckan/templates/package/resource_read.html
    A ckan/templates/snippets/data-viewer-embed-branded-link.html
    A ckan/templates/snippets/data-viewer-embed-dialog.html

  Log Message:
  -----------
  Merge branch 'feature-2285-embeddable-data-viewer'


diff --git a/ckan/controllers/package.py b/ckan/controllers/package.py
index 08656ae..ba12b86 100644
--- a/ckan/controllers/package.py
+++ b/ckan/controllers/package.py
@@ -774,8 +774,7 @@ def resource_embedded_dataviewer(self, id, resource_id):
 
         # Construct the recline state
         state_version = int(request.params.get('state_version', '1'))
-        raw_state = request.params.get('state', '')
-        recline_state = self._parse_recline_state(state_version, raw_state)
+        recline_state = self._parse_recline_state(request.params)
         if recline_state is None:
             abort(400, ('"state" parameter must be a valid recline state (version %d)' % state_version))
 
@@ -787,23 +786,28 @@ def resource_embedded_dataviewer(self, id, resource_id):
 
         return render('package/resource_embedded_dataviewer.html')
 
-    def _parse_recline_state(self, state_version, raw_state):
-        if state_version != 1:  # Only support one version at the moment
+    def _parse_recline_state(self, params):
+        state_version = int(request.params.get('state_version', '1'))
+        if state_version != 1:
             return None
 
-        try:
-            state = json.loads(raw_state)
-        except ValueError:
-            return None
+        recline_state = {}
+        for k,v in request.params.items():
+            try:
+                v = json.loads(v)
+            except ValueError:
+                pass
+            recline_state[k] = v
 
-        # Ensure the state is readOnly
-        state['readOnly'] = True
+        recline_state.pop('width', None)
+        recline_state.pop('height', None)
+        recline_state['readOnly'] = True
 
         # Ensure only the currentView is available
-        if not state.get('currentView', None):
-            state['currentView'] = 'grid'   # default to grid view if none specified
-        for k in state.keys():
-            if k.startswith('view-') and not k.endswith(state['currentView']):
-                state.pop(k)
+        if not recline_state.get('currentView', None):
+            recline_state['currentView'] = 'grid'   # default to grid view if none specified
+        for k in recline_state.keys():
+            if k.startswith('view-') and not k.endswith(recline_state['currentView']):
+                recline_state.pop(k)
+        return recline_state
 
-        return state
diff --git a/ckan/public/scripts/application.js b/ckan/public/scripts/application.js
index 9cd02ce..0d3628e 100644
--- a/ckan/public/scripts/application.js
+++ b/ckan/public/scripts/application.js
@@ -1411,12 +1411,18 @@ CKAN.DataPreview = function ($, my) {
   // url to the embeddable view of the current dataexplorer state.
   my.makeEmbedLink = function(explorerState) {
     var state = explorerState.toJSON();
-    state.dataset.url = escape(state.dataset.url);
-    var qs = recline.View.composeQueryString({
-      state:         explorerState.toJSON(),
-      state_version: 1
+    state.state_version = 1;
+
+    var queryString = '?';
+    var items = [];
+    $.each(state, function(key, value) {
+      if (typeof(value) === 'object') {
+        value = JSON.stringify(value);
+      }
+      items.push(key + '=' + escape(value));
     });
-    return embedPath + qs;
+    queryString += items.join('&');
+    return embedPath + queryString;
   };
 
   // **Public: Loads a data preview**
@@ -1490,7 +1496,7 @@ CKAN.DataPreview = function ($, my) {
 
         // Escape '"' characters in {{link}} in order not to prematurely close
         // the src attribute value.
-        embedIframeText.val($.mustache('<iframe width="{{width}}" height="{{height}}" src="{{link}}"></iframe>',
+        embedIframeText.val($.mustache('<iframe frameBorder="0" width="{{width}}" height="{{height}}" src="{{link}}"></iframe>',
                                        {
                                          link: link.replace(/"/g, '"'),
                                          width: width,
diff --git a/ckan/public/scripts/vendor/recline/recline.js b/ckan/public/scripts/vendor/recline/recline.js
index c1f9185..a4c01ca 100644
--- a/ckan/public/scripts/vendor/recline/recline.js
+++ b/ckan/public/scripts/vendor/recline/recline.js
@@ -1199,6 +1199,8 @@ my.Grid = Backbone.View.extend({
     var hiddenFields = this.state.get('hiddenFields');
     hiddenFields.push(this.tempState.currentColumn);
     this.state.set({hiddenFields: hiddenFields});
+    // change event not being triggered (because it is an array?) so trigger manually
+    this.state.trigger('change');
     this.render();
   },
   
@@ -2476,7 +2478,9 @@ my.DataExplorer = Backbone.View.extend({
         pageView.view.state.bind('change', function() {
           var update = {};
           update['view-' + pageView.id] = pageView.view.state.toJSON();
-          self.state.set(update);
+          // had problems where change not being triggered for e.g. grid view so let's do it explicitly
+          self.state.set(update, {silent: true});
+          self.state.trigger('change');
         });
       }
     });
diff --git a/ckan/templates/_snippet/data-viewer-embed-branded-link.html b/ckan/templates/_snippet/data-viewer-embed-branded-link.html
deleted file mode 100644
index 87eceb6..0000000
--- a/ckan/templates/_snippet/data-viewer-embed-branded-link.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<html
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:i18n="http://genshi.edgewall.org/i18n"
-  xmlns:py="http://genshi.edgewall.org/"
-  xmlns:xi="http://www.w3.org/2001/XInclude"
-  py:strip=""
-  >
-
-<div class="branded-link">
-  <p>Powered by <a href="${h.url_for(controller='package', action='resource_read', id=c.package.id, resource_id=c.resource.id)}">
-  
-  ${g.site_title}
-  <img width="64" src="${h.url_for_static(g.site_logo)}" alt="${g.site_title} Logo" title="${g.site_title} Logo" id="logo" />
-  </a>
-  </p>
-</div>
-
-</html>
-
diff --git a/ckan/templates/_snippet/data-viewer-embed-dialog.html b/ckan/templates/_snippet/data-viewer-embed-dialog.html
deleted file mode 100644
index b0b382d..0000000
--- a/ckan/templates/_snippet/data-viewer-embed-dialog.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<html
-  xmlns="http://www.w3.org/1999/xhtml"
-  xmlns:i18n="http://genshi.edgewall.org/i18n"
-  xmlns:py="http://genshi.edgewall.org/"
-  xmlns:xi="http://www.w3.org/2001/XInclude"
-  py:strip=""
-  >
-
-<div class="modal-data-viewer-embed-dialog modal fade in" style="display: none;"
-  py:def="data_viewer_embed_dialog()">
-  <div class="modal-header">
-    <a class="close" data-dismiss="modal">×</a>
-    <h3>
-      Embed Data Viewer
-    </h3>
-  </div>
-  <div class="modal-body">
-    <div>
-      <p><strong>Embed this view</strong> by copying this into your webpage:</p>
-      <textarea class="embedIframeText" style="width: 100%; height: 200px;"></textarea>
-      <p>Choose width and height in pixels:</p>
-      <label for="iframe-width">Width:</label>
-      <input class="iframe-width" name="iframe-width" value="800"/>
-      <label for="iframe-height">Height:</label>
-      <input class="iframe-height" name="iframe-height" value="500"/>
-    </div>
-    <a class="embedLink" href="">Preview</a>
-  </div>
-</div>
-
-</html>
diff --git a/ckan/templates/package/resource_embedded_dataviewer.html b/ckan/templates/package/resource_embedded_dataviewer.html
index c03f4b9..5022a4d 100644
--- a/ckan/templates/package/resource_embedded_dataviewer.html
+++ b/ckan/templates/package/resource_embedded_dataviewer.html
@@ -43,23 +43,23 @@
 
       #ckanext-datapreview {
         width: ${c.width-2}px;
-        height: ${c.height-115}px;
+        height: ${c.height-81}px;
       }
 
       .recline-grid-container {
-        height: ${c.height-115}px;
+        height: ${c.height-81}px;
       }
 
       .recline-graph .graph {
-        height: ${c.height-115}px;
+        height: ${c.height-81}px;
       }
 
       .recline-map .map {
-        height: ${c.height-115}px;
+        height: ${c.height-81}px;
       }
 
       .branded-link {
-        height: 70px;
+        height: 34px;
       }
 
       .alert-messages {
@@ -82,7 +82,7 @@
     <div class="resource-preview">
       <div id="ckanext-datapreview"></div>
     </div>
-    <xi:include href="../_snippet/data-viewer-embed-branded-link.html" />
+    <xi:include href="../snippets/data-viewer-embed-branded-link.html" />
   </div>
 
   <py:def function="optional_footer">
diff --git a/ckan/templates/package/resource_read.html b/ckan/templates/package/resource_read.html
index c99805a..619c636 100644
--- a/ckan/templates/package/resource_read.html
+++ b/ckan/templates/package/resource_read.html
@@ -12,7 +12,7 @@
   py:strip="">
 
   <xi:include href="../_snippet/data-api-help.html" />
-  <xi:include href="../_snippet/data-viewer-embed-dialog.html" />
+  <xi:include href="../snippets/data-viewer-embed-dialog.html" />
 
   <py:def function="optional_head">
     <!-- data preview -->
diff --git a/ckan/templates/snippets/data-viewer-embed-branded-link.html b/ckan/templates/snippets/data-viewer-embed-branded-link.html
new file mode 100644
index 0000000..4bd0e45
--- /dev/null
+++ b/ckan/templates/snippets/data-viewer-embed-branded-link.html
@@ -0,0 +1,19 @@
+<html
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:i18n="http://genshi.edgewall.org/i18n"
+  xmlns:py="http://genshi.edgewall.org/"
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  py:strip=""
+  >
+
+<div class="branded-link">
+  <p>Powered by <a href="${h.url_for(controller='package', action='resource_read', id=c.package.id, resource_id=c.resource.id)}">
+  
+  ${g.site_title}
+  <img width="28" src="${h.url_for_static(g.site_logo)}" alt="${g.site_title} Logo" title="${g.site_title} Logo" id="logo" />
+  </a>
+  </p>
+</div>
+
+</html>
+
diff --git a/ckan/templates/snippets/data-viewer-embed-dialog.html b/ckan/templates/snippets/data-viewer-embed-dialog.html
new file mode 100644
index 0000000..b0b382d
--- /dev/null
+++ b/ckan/templates/snippets/data-viewer-embed-dialog.html
@@ -0,0 +1,31 @@
+<html
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:i18n="http://genshi.edgewall.org/i18n"
+  xmlns:py="http://genshi.edgewall.org/"
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  py:strip=""
+  >
+
+<div class="modal-data-viewer-embed-dialog modal fade in" style="display: none;"
+  py:def="data_viewer_embed_dialog()">
+  <div class="modal-header">
+    <a class="close" data-dismiss="modal">×</a>
+    <h3>
+      Embed Data Viewer
+    </h3>
+  </div>
+  <div class="modal-body">
+    <div>
+      <p><strong>Embed this view</strong> by copying this into your webpage:</p>
+      <textarea class="embedIframeText" style="width: 100%; height: 200px;"></textarea>
+      <p>Choose width and height in pixels:</p>
+      <label for="iframe-width">Width:</label>
+      <input class="iframe-width" name="iframe-width" value="800"/>
+      <label for="iframe-height">Height:</label>
+      <input class="iframe-height" name="iframe-height" value="500"/>
+    </div>
+    <a class="embedLink" href="">Preview</a>
+  </div>
+</div>
+
+</html>


================================================================
Compare: https://github.com/okfn/ckan/compare/7b5d6a6...b5ca629


More information about the ckan-changes mailing list