From 051e6e80dbb7e93fc13274453f8d6b48601f006c Mon Sep 17 00:00:00 2001
From: anonymous <anonymous>
Date: Tue, 4 Dec 2018 11:07:07 +0100
Subject: [PATCH] ODPSH-137: change layout

---
 ckanext/odsh/public/odsh.css                  |  7 +++++
 ckanext/odsh/templates/package/read_base.html | 26 -------------------
 .../odsh/templates/package/snippets/info.html | 26 ++++++++++++++++++-
 3 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/ckanext/odsh/public/odsh.css b/ckanext/odsh/public/odsh.css
index abdb5c6a..bdc0e270 100644
--- a/ckanext/odsh/public/odsh.css
+++ b/ckanext/odsh/public/odsh.css
@@ -1124,6 +1124,13 @@ body {
     margin-right:0px;
     font-weight: normal;
 }
+.module.module-narrow.dataset-map{
+    margin: 5px 0;
+}
+.spatial-detail.info-detail{
+    margin-bottom: 0px;
+}
+
 #dataset-map .module-heading [class^="icon-"],
 #dataset-map .module-heading [class*=" icon-"] {
   font-size: 14px;
diff --git a/ckanext/odsh/templates/package/read_base.html b/ckanext/odsh/templates/package/read_base.html
index 825b8d90..9597da67 100644
--- a/ckanext/odsh/templates/package/read_base.html
+++ b/ckanext/odsh/templates/package/read_base.html
@@ -29,32 +29,6 @@
 {% endblock %}
 
 {% block spatial_map %}
-{% set dataset_extent = h.get_pkg_dict_extra(c.pkg_dict, 'spatial', '') %}
-{% if dataset_extent %}
-{% snippet "spatial/snippets/dataset_map_sidebar.html", extent=dataset_extent %}
-{% endif %}
-{% block spatial_info %}
-{% set map_text = h.odsh_get_spatial_text(pkg) %}
-<div class="spatial-detail info-detail">
-    <div>{{ _('Spatial uri') }}:</div>
-    {%set ext=map_text if map_text else '-'%}
-    <p>{{ ext }}</p>
-</div>
-
-<div class="info-detail">
-    {% if map_text %}
-    <p class='map-text'> {{_('Map showing the borders of {map_text}').format(map_text=map_text)}} </p>
-    {% endif %}
-    {% set bbox = h.odsh_get_bounding_box(pkg) %}
-    {% if bbox%}
-    <div>{{ _('borders of map') }}:</div>
-    <p> {{ '{0:0.3f}'.format(bbox[0]).zfill(2).replace('.',',') }}° {{_('in east')}}</p>
-    <p> {{ '{0:0.3f}'.format(bbox[1]).replace('.',',') }}° {{_('in west')}}</p>
-    <p> {{ '{0:0.3f}'.format(bbox[2]).replace('.',',') }}° {{_('in south')}}</p>
-    <p> {{ '{0:0.3f}'.format(bbox[3]).replace('.',',') }}° {{_('in north')}}</p>
-    {% endif %}
-</div>
-{% endblock %}
 {% endblock %}
 
 {% endblock %}
\ No newline at end of file
diff --git a/ckanext/odsh/templates/package/snippets/info.html b/ckanext/odsh/templates/package/snippets/info.html
index 15db411b..e8b90c80 100644
--- a/ckanext/odsh/templates/package/snippets/info.html
+++ b/ckanext/odsh/templates/package/snippets/info.html
@@ -67,7 +67,31 @@ Example:
 
             {% endblock %}
         </div>
+        {% set map_text = h.odsh_get_spatial_text(pkg) %}
+        <div class="spatial-detail info-detail">
+            <div>{{ _('Spatial uri') }}:</div>
+            {%set ext=map_text if map_text else '-'%}
+            <p>{{ ext }}</p>
+        </div>
+        {% set dataset_extent = h.get_pkg_dict_extra(c.pkg_dict, 'spatial', '') %}
+        {% if dataset_extent %}
+        <section class="module module-narrow dataset-map">
+            {% snippet "spatial/snippets/dataset_map_base.html", extent=dataset_extent %}
+        </section>
+        {% endif %}
+        {% block spatial_info %}
+        <div class="info-detail">
+            {% set bbox = h.odsh_get_bounding_box(pkg) %}
+            {% if bbox%}
+            <div>{{ _('borders of map') }}:</div>
+            <p> {{ '{0:0.3f}'.format(bbox[0]).zfill(2).replace('.',',') }}° {{_('in east')}}</p>
+            <p> {{ '{0:0.3f}'.format(bbox[1]).replace('.',',') }}° {{_('in west')}}</p>
+            <p> {{ '{0:0.3f}'.format(bbox[2]).replace('.',',') }}° {{_('in south')}}</p>
+            <p> {{ '{0:0.3f}'.format(bbox[3]).replace('.',',') }}° {{_('in north')}}</p>
+            {% endif %}
+        </div>
+        {% endblock %}
     </div>
 </section>
 {% endif %}
-{% endblock %}
+{% endblock %}
\ No newline at end of file
-- 
GitLab