{% extends "package/read_common.html" %} {% import "inventory/inventory_util_jinja.html" as inventory_m with context %} {% import "_dgu_jinja_util.html" as m with context %} {% import "issues/common.html" as common with context %} {% set can_update=h.check_access('package_update',{'id':c.pkg.id}) %} {% set api_res_count = [] %} {# hackish way of making sure to load api info JS only once, because Jinja variables lose scope #} {# c.pkg_dict - the result of package_show c.pkg - package object (don't use this if you can...) #} {% block optional_head %} {# removed until using DCAT extension: #} {{ super() }} {% endblock %} {% block title %}{{c.pkg_dict.get('title', c.pkg_dict['name'])}} - Zbirke{% endblock %} {% block breadcrumb_content %} {{ h.build_nav('dgu_search', _('Datasets')) }} {{ h.build_nav('dataset_read', c.pkg_dict.get('title', c.pkg_dict['name']), id=c.pkg_dict['name']) }} {% endblock %} {% block pre_primary %} {% set open_data = h.is_open_data(c.pkg_dict) %}
{% endblock %} {% macro package_content() %} {% set is_location_data = h.is_location_data(c.pkg_dict) %} {% set dataset_is_from_ns_pubhub = h.dataset_is_from_ns_pubhub(c.pkg_dict) %} {% if c.pkg_revision_id %}
Pregled različice podatkovne zbirke
{% if c.pkg_revision_not_latest %}
To je stara različica podatkovne zbirke, spremenjene ob {{h.render_datetime(c.pkg_revision_timestamp)}}. Lahko se precej razlikuje od trenutne različice.
{% endif %} {% if not c.pkg_revision_not_latest %}
To je trenutna različica podatkovne zbirke, spremenjene ob {{h.render_datetime(c.pkg_revision_timestamp)}}.
{% endif %}
{% endif %} {#
{% if h.has_bounding_box(c.pkg_extras) and h.has_extent(c.pkg) %}

Območje prostorskih podatkov

Zemljepisna širina: {{h.as_dict(c.pkg_extras).get('bbox-north-lat')[:7]}}° do {{h.as_dict(c.pkg_extras).get('bbox-south-lat')[:7]}}°
Zemljepisna dolžina: {{h.as_dict(c.pkg_extras).get('bbox-west-long')[:7]}}° do {{h.as_dict(c.pkg_extras).get('bbox-east-long')[:7]}}°
{% endif %} {% if h.has_extent(c.pkg) %}
{% endif %}
#}
{% set publisher_name = c.pkg.get_organization().name %} {% set issue_count = h.get_issue_count(c.pkg.id) %}
{% if h.individual_resources(not can_update) %}

Podatkovni viri ({{ h.individual_resources(not can_update)|length }})

{{ download_all() }}
{{ resource_table(h.individual_resources(not can_update), publisher_name) }} {% endif %} {% if h.timeseries_resources(not can_update) %}

Podatkovni viri ({{ h.timeseries_resources(not can_update)|length }} v periodični vrsti)

{{ download_all() }}
{% for year, items in h.groupby(h.timeseries_resources(not can_update)|reverse, h.extract_year) %}

{{ year }}

{{ resource_table(items, publisher_name) }}
{% endfor %} {% endif %}
{% if h.additional_resources(not can_update) or h.gemini_resources() or h.csv_resources()%}

Dodatne povezave ({{h.additional_resources(not can_update)|length + h.gemini_resources()|length + h.csv_resources()|length}})

{{resource_table(h.additional_resources(not can_update) + h.gemini_resources() + h.csv_resources(), publisher_name)}} {% endif %} {% if not (is_location_data or h.individual_resources(not can_update) or h.timeseries_resources(not can_update) or h.additional_resources(not can_update)) %} (brez datotek) {% endif %}

Dodatne informacije

{% for field_dict, label_attributes, value_attributes in h.get_package_fields(c.pkg, c.pkg_dict, h.as_dict(c.pkg_extras), h.was_dataset_harvested(c.pkg_extras), is_location_data, dataset_is_from_ns_pubhub) %} {# TODO: label_attributes and value_attributes are dicts, we need to decouple them #} {% endfor %} {% if is_location_data and h.as_dict(c.pkg_extras).get('resource-type') in ('dataset', 'series', 'service') %} {% set is_service=h.as_dict(c.pkg_extras).get('resource-type')=='service' %} {% endif %}
{{ field_dict.get('label') or field_dict['name'] }} {{ field_dict.get('value') or 'Ni podatka' }}
Povezane {{ m.if_(is_service,'zbirke','storitve') }} {% if h.coupled_pkg_tuples(c.pkg) %}
    {% for name, title in h.coupled_pkg_tuples(c.pkg) %}
  • {{ title }}
  • {% endfor %}
{% endif %} {% if not h.coupled_pkg_tuples(c.pkg) %} (ni povezav) {% endif %}
{% if h.has_related_apps(c.pkg_dict.get('id')) %}

Povezane aplikacije

{% endif %} {% if h.is_plugin_enabled('issues') and h.issues_enabled(c.pkg_dict) %}

Issues

{% set issues = h.issues_list(c.pkg_dict.id, status='open') %} {% if issues['count'] %}

{{ ungettext('{number} open issue', '{number} open issues', issues['count']).format(number=issues['count']) }}:

{% else %}

0 open issues

{% endif %} {% set closed_issues = h.issues_list(c.pkg_dict.id, status='closed') %} {% if closed_issues['count'] %}

{{ ungettext('{number} closed issue', '{number} closed issues', closed_issues['count']).format(number=closed_issues['count']) }}   Odkrij Skrij

{% else %}

0 closed issues

{% endif %}
{% endif %}
{#
#} {% endmacro %} {% macro download_all() %}
{% if h.is_plugin_enabled('downloadall') %} {% set zip_res = h.downloadall__pop_zip_resource(c.pkg_dict) %} {% set resource_size = h.get_resource_size_formatted(zip_res) %} {% if zip_res %} {% else %} {% endif %} Prenesi vse{% if resource_size %} ({{ resource_size }}){% endif %} {% endif %}
{% endmacro %} {% macro resource_table(resources, publisher_name) %} {% set non_download_formats = ('API', 'ASPX', 'HTML', 'SPARQL', 'WCS', 'WFS', 'WMS') %}
{% for res in resources %} {% if res.get('gemini',False) %} {% set file_format = res.get('type','') %} {% else %} {% set file_format = res.get('format','').lower() %} {% set file_format_short = res.get('format','').lower()[:4] %} {% endif %}
{{file_format}}
{{file_format_short}}
{% if res.get('scraped') or res.get('scraper_url') %} {{h.scraper_icon(res, alt=m.if_(res.get('scraper_url'), "Ta povezava kaže na datoteke, ki se dodajajo avtomatično z naslova: https://scraperwiki.com/scrapers/%s" % res.get('scraper_url'), ""))}} {% endif %}
{{h.resource_display_name(res)}}
{% if not res.get('displayed', True) or res.get('displayed',True) == 'False' or res.get('displayed',True) == 'false' %}

(ta datoteka ni prikazana javnim uporabnikom)

{% endif %}
{{res.get('date','')}}
{% with %} {% set is_location_data = h.is_location_data(c.pkg_dict) %} {% set is_harvest_metadata = res.get('gemini',False) or res.get('is_harvest_metadata',False) %} {# i.e. the gemini metadata links, shown as resources #} {% set archiver_format = '' if h.is_string(res.get('archiver', {})) else res.get('archiver', {})['format'] or '' %} {% set resource_size = h.get_resource_size_formatted(res) %} {% set is_download = not is_location_data and res.get('resource_type') != 'api' and (res.format or '').upper() not in non_download_formats and archiver_format not in non_download_formats %} {% set is_html = not is_download and (res.format and res.format.upper() == 'HTML' or archiver_format.upper() == 'HTML') %} {% if is_download and not is_harvest_metadata %} Prenos {% if resource_size %} ({{ resource_size }}) {% endif %} {% else %} Povezava {% if not is_html and res.format %} na {{ res.format }}{% endif %} {% endif %} {% if h.is_datastore_compatible(res) %} {% snippet 'package/snippets/data_api_button.html', resource=res, suppress_script=(api_res_count|length > 0) %} {% if api_res_count.append(1) %}{% endif %} {% endif %} {% if not is_harvest_metadata %} Več ... {% endif %} {# exclamation mark #} {% if h.is_resource_broken(res) %} {% endif %} {% endwith %}
{% endfor %}
{% endmacro %}