Skip to content
Snippets Groups Projects
info.html 7.8 KiB
Newer Older
  • Learn to ignore specific revisions
  • {#
    Displays a sidebard module with information for given package
    
    pkg - The package dict that owns the resources.
    
    Example:
    
    {% snippet "package/snippets/info.html", pkg=pkg %}
    
    #}
    
    root's avatar
    root committed
    
    
    Thorge Petersen's avatar
    Thorge Petersen committed
    {% set daterange = h.get_daterange_prettified(pkg) %}
    
    root's avatar
    root committed
    {% set license_attribution_by_text = h.odsh_extract_value_from_extras(pkg.extras, 'licenseAttributionByText') %}
    
    
    {% block package_info %}
    
      {% if pkg %}
        <section class="module module-narrow">
          <div class="module context-info">
    
            <div class="module-content">
    
              {% block package_info_inner %}
    
                {% block heading %}
    
    root's avatar
    root committed
                {% endblock heading %}
    
    root's avatar
    root committed
                {% block groups %} {# aka categories #}
    
                  {% if pkg.groups|length %}
                    <div class="info-detail groups-detail">
                      <div>
    
    root's avatar
    root committed
                        {% trans category_count=pkg.groups|length %}
    
    Thorge Petersen's avatar
    Thorge Petersen committed
                        Category:
    
    root's avatar
    root committed
                        {% pluralize %}
    
    Thorge Petersen's avatar
    Thorge Petersen committed
                        Categories:
    
    root's avatar
    root committed
                        {% endtrans %}
    
                      </div>
                      {% for category in pkg.groups %}
                        <span class='category-with-icon'>
                          <span class='category-icon-container'>
    
    root's avatar
    root committed
                            <img src="/base/images/icon_kat_{{category.name}}.svg" />
    
                          </span>
                          <span class="category-name">
    
    root's avatar
    root committed
                            {{ category.display_name }}
    
    root's avatar
    root committed
                        </span>
    
                      {% endfor %}
                    </div>
                  {% endif %}
    
    root's avatar
    root committed
                {% endblock groups %}
    
    anonymous's avatar
    anonymous committed
    
                {% block timerange %}
    
                  {% if daterange %}
                    <div class="timerange-detail info-detail">
                      <div>{{ _('Period') }}:</div>
                      <p>{{ daterange }}</p>
                    </div>
                  {% endif %}
    
    root's avatar
    root committed
                {% endblock timerange %}
    
    root's avatar
    root committed
                
    
    anonymous's avatar
    anonymous committed
                {% block last_change %}
    
                  <div class="last-change-detail info-detail">
    
    anonymous's avatar
    anonymous committed
                    {% set value = h.odsh_extract_value_from_extras(pkg.extras,'issued')%}
                    {% set issued = h.odsh_render_datetime(value) if value else h.odsh_render_datetime(pkg.metadata_created)%} 
    
                    <div>{{ _('Issued') }}:</div>
                    <span property="dc:issued">{{ issued }}</span>
    
                  </div>
                  <div class="last-change-detail info-detail">
    
    anonymous's avatar
    anonymous committed
                    {% set modified = h.odsh_render_datetime(pkg.metadata_modified)%} 
    
                    <div>{{ _('Modified') }}:</div>
                    <span property="dc:modified">{{ modified }}</span>
    
    root's avatar
    root committed
                {% endblock last_change %}
    
                {% block license %}
    
                  <div class="license-detail info-detail">
    
    root's avatar
    root committed
                    <div>{{ _('License') }}:</div>
                    {%set lic=pkg.license_title if pkg.license_title else '-'%}
                    {%set licenseAttributionByText = h.odsh_extract_value_from_extras(pkg.extras,'licenseAttributionByText') %}
                    {%set name=' (' + licenseAttributionByText +')' if licenseAttributionByText else ''%}
    
                    <a href="{{pkg.license_url}}" rel="dc:rights">{{ lic }}</a>{{ name }}
                  </div>
    
    root's avatar
    root committed
                {% endblock license %}
    
    anonymous's avatar
    anonymous committed
    
    
    	          {% block musterdatensatz %}
    
                    {% set mdk=h.odsh_load_raw_mdk_sample_dataset() %}
    
                    {% set musterdatensatzName = mdk[pkg.reference] %}
    
                    <div class="musterdatensatz-detail info-detail">
    
                      <div>{{ _('Sample Dataset') }}:</div>
    
                      <a href="/dataset?reference={{ pkg.reference }}">{{ musterdatensatzName }}</a>
    
                    </div>
                  {% endif %}
                {% endblock musterdatensatz %}
    
                {% block applicableLegislation %}
                  {% if pkg.applicableLegislation %}
                    {% set applicable_legislation_urls = pkg.applicableLegislation.split(',') %}
                    <div class="applicableLegislation-detail info-detail">
    
                      <div>{{ _('Applicable Legislation') }}:</div>
    
                      <ul class="inline-list">
                      {% for url in applicable_legislation_urls %}
                        {% set applicable_legislation = h.odsh_load_applicable_legislations(url.strip('{}')) %}
                        <li><a href="{{ applicable_legislation.uri }}">{{ applicable_legislation.short_title if applicable_legislation.short_title else applicable_legislation.title }}</a></li>
                      {% endfor %}
                      </ul>
                    </div>
                  {% endif %}
                {% endblock applicableLegislation %}
    
                {% block hvdCategories %}
                  {% if pkg.hvdCategory %}
                    {% set hvd_urls = pkg.hvdCategory.split(',') %}
                    <div class="hvdCategories-detail info-detail">
    
                      <div>
                        {{ _('HVD Categories') }}:
    
                        <a data-module="odsh_popover" data-module-trigger="custom" data-module-text="{{ _('A High-Value Dataset (HVD) category refers to a group of datasets that are considered particularly important and valuable. These datasets cover various topics such as maps, environmental data, weather information, statistics, company details, and data related to transportation. The European Commission has identified six main categories of these high-value datasets to ensure that they are easily accessible and useful for different purposes. These categories help to organize and prioritize datasets that have the potential to significantly benefit European citizens and businesses.') }}" title="{{ _('HVD Categories') }}">
    
                          <i class="fa fa-circle-info"></i>
                        </a>
                      </div>
    
                      <ul class="inline-list">
                      {% for url in hvd_urls %}
                        {% set hvd = h.odsh_load_hvd_categories(url.strip('{}')) %}
    
                        <li>{{ hvd.short_title if hvd.short_title else hvd.title }}</li>
    
                      {% endfor %}
                      </ul>
                    </div>
                  {% endif %}
                {% endblock hvdCategories %}
    
    
              {% endblock package_info_inner %}
    
    anonymous's avatar
    anonymous committed
            {% 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>
    
    anonymous's avatar
    anonymous committed
            </div>
    
            {% set dataset_extent = h.get_pkg_dict_extra(pkg, 'spatial', '') %}
    
    anonymous's avatar
    anonymous committed
            {% if dataset_extent %}
    
              <section class="module module-narrow dataset-map">
    
    anonymous's avatar
    anonymous committed
                {% snippet "snippets/dataset_map.html", extent=dataset_extent %}
    
    anonymous's avatar
    anonymous committed
            {% endif %}
            {% block spatial_info %}
    
              <div class="info-detail">
    
    anonymous's avatar
    anonymous committed
                {% set bbox = h.odsh_get_bounding_box(pkg) %}
                {% if bbox%}
    
                  <div>{{ _('Map boundaries') }}:</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 north')}}</p>
                  <p> {{ '{0:0.3f}'.format(bbox[3]).replace('.',',') }}° {{_('in south')}}</p>
    
    anonymous's avatar
    anonymous committed
                {% endif %}
    
    anonymous's avatar
    anonymous committed
            {% endblock %}
    
              <div class="info-detail metadata-links">
                <div>{{ _('DCAT-AP.de metadata') }}</div>
                <ul>
                  <li><a href="/dataset/{{ pkg.id }}.rdf">Download (RDF/XML)</a></li>
                  <li><a href="/dataset/{{ pkg.id }}.ttl">Download (Turtle)</a></li>
                  <li><a href="/dataset/{{ pkg.id }}.n3">Download (N3)</a></li>
                  <li><a href="/dataset/{{ pkg.id }}.jsonld">Download (JSON-LD)</a></li>
                </ul>
              </div>      
    
            {% endblock metadata_links %}
    
          </div>
        </section>
      {% endif %}
    
    root's avatar
    root committed
    {% endblock package_info %}