diff --git a/ckanext/odsh/public/odsh.css b/ckanext/odsh/public/odsh.css index abdb5c6a83f24a3f45c9c5335da4ea189f4a96d4..bdc0e270ba7ba191b73921b5fcc42aa3b2d15d1d 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 825b8d90d7c3066d894a8362c5599d304dcd47bb..9597da673921613a4a8c9f15e2c7269c33e2943b 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 15db411b37129b00065415488d7f1d4565ba2360..e8b90c80e88bdc9efa41ffdc6d3ae229057cf218 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