Commit b827804a authored by Kristijan Čagran's avatar Kristijan Čagran
Browse files

Some GUI fixes

parent 2c6fc913
......@@ -112,85 +112,46 @@
{% set publisher_name = c.pkg.get_organization().name %}
{% set issue_count = h.get_issue_count(c.pkg.id) %}
{#<!--
{% if not h.is_unpublished_item(c.pkg_dict) %}
<h2>Arhiv podatkov</h2>
{% if h.packagezip_has_data(c.pkg) == None %}
<p style="margin-bottom: 20px;">
<!-- Data Package Zip še ni bil ustvarjen za to podatkovno zbirko. -->
Arhiv ZIP s podatki te zbirke še ni bil ustvarjen.
<a class="js-tooltip" data-toggle="tooltip" data-html='true' data-placement="right" title="Razlog za to je verjetno relativna novost te podatkovne zbirke. Poizkusite ponovno kasneje." href="javascript:0" style="text-decoration:none;color:#000;">
<i class="fi-info-sign"></i>
</a>
</p>
{% elif not h.packagezip_has_data(c.pkg) %}
<p style="margin-bottom: 20px;">
<a href="{{h.packagezip_url(c.pkg)}}">Arhiv ZIP</a> ni priporočen za to podatkovno zbirko
<a class="js-tooltip" data-toggle="tooltip" data-html='true' data-placement="right" title="Zip datoteka morda ne vsebuje podatkov. To se zgodi v kolikor izvorni podatki niso na voljo, če je prišlo do napak med arhiviranjem, ali če so podatki na voljo le preko API-ja." href="javascript:0" style="text-decoration:none;color:#000;">
<i class="fi-info-sign"></i>
</a>
</p>
{% else %}
<p>Prenesite paket vseh datotek te podatkovne zbirke</p>
<div class="datapackage-zip">
<div class="row">
<div class="col-sm-6">
<div class="dataset-resource">
<div class="dataset-resource-format">
<i class="fi-25x icon-archive"></i>
<span class="format-name">ZIP</span>
</div>
<div class="dataset-resource-text">
<div class="inner">
<div class="inner-row description">
<div class="inner-cell">
Vsi podatki
</div>
</div>
<div class="inner-row actions">
<div class="inner-cell">
<a href="{{h.packagezip_url(c.pkg)}}" class="dataset-resource-chevron" style="pointer-events:auto;">
<strong>
Prenos ZIP
</strong>
{% if h.packagezip_size(c.pkg) %}
({{h.packagezip_size(c.pkg)|filesizeformat}})
{% endif %}
</a>
</div>
</div>
</div>
</div>
</div><!-- /dataset-resource -->
</div><!-- /col-sm-6 -->
</div>
</div>
{% endif %}
<div class="dataset-resources">
<!-- Resources -->
{% if h.individual_resources(not can_update) %}
<div class="row">
<div class="small-12 medium-8 columns">
<h2>Podatkovni viri ({{ h.individual_resources(not can_update)|length }})</h2>
</div>
{{ download_all(h.individual_resources(not can_update), publisher_name) }}
</div>
{{ resource_table(h.individual_resources(not can_update), publisher_name) }}
{% endif %}
-->#}
<div class="dataset-resources">
<!-- Resources -->
{% if h.individual_resources(not can_update) %}
<h2>Podatkovni viri ({{h.individual_resources(not can_update)|length}})</h2>
{{resource_table(h.individual_resources(not can_update), publisher_name)}}
{% endif %}
{% if h.timeseries_resources(not can_update) %}
<h2>Podatkovni viri ({{h.timeseries_resources(not can_update)|length}} v periodični vrsti)</h2>
{% for year, items in h.groupby(h.timeseries_resources(not can_update)|reverse, h.extract_year) %}
<div class="year">
<h3>{{year}} <span class="showyear" style="display: none;">Več podrobnosti <i class="fi-arrow-down"></i></span><span class="hideyear" style="display: none;"> Manj podrobnosti <i class="fi-arrow-up"></i></span></h3>
<div class="year_items">
{{resource_table(items, publisher_name)}}
</div>
</div>
{% endfor %}
{% endif %}
{% if h.timeseries_resources(not can_update) %}
<div class="row">
<div class="small-12 medium-8 columns">
<h2>Podatkovni viri ({{ h.timeseries_resources(not can_update)|length }} v periodični vrsti)</h2>
</div>
{{ download_all(items, publisher_name) }}
</div>
{% for year, items in h.groupby(h.timeseries_resources(not can_update)|reverse, h.extract_year) %}
<div class="year">
<h3>{{ year }} <span class="showyear" style="display: none;">Več podrobnosti <i
class="fi-arrow-down"></i></span><span class="hideyear" style="display: none;"> Manj podrobnosti <i
class="fi-arrow-up"></i></span></h3>
<div class="year_items">
{{ resource_table(items, publisher_name) }}
</div>
</div>
{% endfor %}
{% endif %}
</div>
<div class="dataset-resources-additional">
{% if h.additional_resources(not can_update) or h.gemini_resources() or h.csv_resources()%}
<h2>Dodatne povezave ({{h.additional_resources(not can_update)|length + h.gemini_resources()|length + h.csv_resources()|length}})</h2>
<div class="row">
<div class="small-12 medium-8 columns">
<h2>Dodatne povezave ({{h.additional_resources(not can_update)|length + h.gemini_resources()|length + h.csv_resources()|length}})</h2>
</div>
{{ download_all(h.additional_resources(not can_update) + h.gemini_resources() + h.csv_resources(), publisher_name) }}
</div>
{{resource_table(h.additional_resources(not can_update) + h.gemini_resources() + h.csv_resources(), publisher_name)}}
{% endif %}
......@@ -199,41 +160,49 @@
{% endif %}
</div>
<div class="dataset-additional-information" >
<!-- Dataset Information Section -->
<h2>Dodatne informacije</h2>
<table class="table table-bordered table-condensed table-dgu-fixed-size dgu-table">
<tbody>
<div class="dataset-additional-information">
<!-- Dataset Information Section -->
<div class="row">
<div class="small-12 columns">
<h2>Dodatne informacije</h2>
</div>
</div>
<div class="row">
<div class="small-12 columns">
<table class="table table-bordered table-condensed table-dgu-fixed-size dgu-table">
<tbody>
{% 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) %}
<tr>
{# TODO: label_attributes and value_attributes are dicts, we need to decouple them #}
<th class="key" {{m.dict_to_attributes(label_attributes)}}>{{field_dict.get('label') or field_dict['name']}}</th>
<td class="value" {{m.dict_to_attributes(value_attributes)}}>{{field_dict.get('value') or 'Ni podatka'}}</td>
</tr>
<tr>
{# TODO: label_attributes and value_attributes are dicts, we need to decouple them #}
<th class="key" {{ m.dict_to_attributes(label_attributes) }}>{{ field_dict.get('label') or field_dict['name'] }}</th>
<td class="value" {{ m.dict_to_attributes(value_attributes) }}>{{ field_dict.get('value') or 'Ni podatka' }}</td>
</tr>
{% endfor %}
{% if is_location_data and h.as_dict(c.pkg_extras).get('resource-type') in ('dataset', 'series', 'service') %}
<tr>
{% set is_service=h.as_dict(c.pkg_extras).get('resource-type')=='service' %}
<th class="key">Povezane {{m.if_(is_service,'zbirke','storitve')}}</th>
<td class="value">
{% if h.coupled_pkg_tuples(c.pkg)%}
<ul>
{% for name, title in h.coupled_pkg_tuples(c.pkg) %}
<li>
<a href="/dataset/{{name}}">{{title}}</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% if not h.coupled_pkg_tuples(c.pkg) %}
<span>(ni povezav)</span>
{% endif %}
</td>
</tr>
<tr>
{% set is_service=h.as_dict(c.pkg_extras).get('resource-type')=='service' %}
<th class="key">Povezane {{ m.if_(is_service,'zbirke','storitve') }}</th>
<td class="value">
{% if h.coupled_pkg_tuples(c.pkg) %}
<ul>
{% for name, title in h.coupled_pkg_tuples(c.pkg) %}
<li>
<a href="/dataset/{{ name }}">{{ title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% if not h.coupled_pkg_tuples(c.pkg) %}
<span>(ni povezav)</span>
{% endif %}
</td>
</tr>
{% endif %}
</tbody>
</table>
</tbody>
</table>
</div>
</div>
</div>
{% if h.has_related_apps(c.pkg_dict.get('id')) %}
<h2>Povezane aplikacije</h2>
......@@ -288,23 +257,27 @@
{% endmacro %}
{% macro resource_table(resources, publisher_name) %}
{% macro download_all(resources, publisher_name) %}
{% set non_download_formats = ('HTML', 'API', 'WMS', 'WCS', 'SPARQL') %}
<div class="small-12 medium-5 columns text-right">
<div class="mr-15">
{% if h.is_plugin_enabled('downloadall') %}
xxx:{{ xxx }}
{% if h.is_plugin_enabled('downloadall') %}
<div class="btn-group" style="float:right; margin-top: -7px;">
{% set zip_res = h.downloadall__pop_zip_resource(c.pkg_dict) %}
{% if zip_res %}
<a class="button resource-url-analytics resource-type-{{ zip_res.resource_type }}" href="{{ zip_res.url }}">
{% else %}
<a class="button" disabled="disabled" title="{{ _('This download is not currently available') }}" href="#">
{% endif %}
<span class="icon-download"></span><strong>{{ _('Download all') }}</strong>
</a>
<a class="button w-230 resource-url-analytics resource-type-{{ zip_res.resource_type }}" href="{{ zip_res.url }}">
{% else %}
<a class="button w-230" disabled="disabled" title="{{ _('This download is not currently available') }}" href="#">
{% endif %}
<span class="icon-download"></span><strong>{{ _('Download all') }}</strong>
</a>
{% endif %}
</div>
</div>
{% endif %}
{% endmacro %}
{% macro resource_table(resources, publisher_name) %}
<div class="row">
{% for res in resources %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment