[#52] Show dataset map correctly on all 2.x versions

This commit is contained in:
amercader 2014-01-09 17:46:45 +00:00
parent 92fd782b99
commit 4a7a70855a
3 changed files with 22 additions and 36 deletions

View File

@ -1,30 +1,23 @@
/* Side bar */
.module-narrow #dataset-map-container{
height: 200px;
}
.module-content #dataset-map-container{
/* Primary content */
.dataset-map-section-20x {
padding: 0 25px;
margin: 20px 0;
}
.dataset-map #dataset-map-container{
height: 250px;
}
#dataset-map-attribution{
font-size: x-small;
font-size: x-small;
}
.module-narrow #dataset-map-attribution{
margin-left: 3px;
}
.olControlAttribution {
left: 5px;
right: inherit;
bottom: 3px !important;
}
#dataset-map-container div.olControlAttribution {
font-size: 9px;
font-family: helvetica,tahoma,verdana,sans-serif;
line-height: 12px;
left: 5px;
bottom: 3px;
color: #666;
}

View File

@ -12,9 +12,8 @@ extent
{% endif %}
#}
<article class="module prose">
<section class="module-content">
<h3>{{ _('Dataset extent') }}</h3>
{% snippet "spatial/snippets/dataset_map_base.html", extent=extent %}
</section>
</article>
<section class="dataset-map-section {% if g.ckan_base_version.startswith('2.0') %}dataset-map-section-20x{% endif %}">
<h3>{{ _('Dataset extent') }}</h3>
{% snippet "spatial/snippets/dataset_map_base.html", extent=extent %}
</section>

View File

@ -197,7 +197,7 @@ the main body of the dataset details page, but these can be easily modified to
suit your project needs
To add a map to the sidebar, add this to the dataset details page template (eg
``myproj/ckanext/myproj/templates/package/read.html``)::
``ckanext-myproj/ckanext/myproj/templates/package/read.html``)::
{% block secondary_content %}
{{ super() }}
@ -211,23 +211,17 @@ To add a map to the sidebar, add this to the dataset details page template (eg
For adding the map to the main body, add this::
{% block primary_content %}
{% block primary_content_inner %}
<!-- ... -->
{{ super() }}
<article class="module prose">
{% set dataset_extent = h.get_pkg_dict_extra(c.pkg_dict, 'spatial', '') %}
{% if dataset_extent %}
{% snippet "spatial/snippets/dataset_map.html", extent=dataset_extent %}
{% endif %}
<!-- ... -->
{% set dataset_extent = h.get_pkg_dict_extra(c.pkg_dict, 'spatial', '') %}
{% if dataset_extent %}
{% snippet "spatial/snippets/dataset_map.html", extent=dataset_extent %}
{% endif %}
</article>
{% endblock %}
You need to load the ``spatial_metadata`` plugin to use these snippets.
Legacy Search