{% macro display_error(errors, name, field_error=False, msg=None) %} {% if errors.get(name) %} {% set error_msg = msg or errors.get(name) %} {% if h.is_list(error_msg) %} {% set error_msg = errors.get(name)[0] %} {% endif %} {% if field_error %}

{{ h.translate_string(error_msg) }}

{% else %}
{{ h.translate_string(error_msg) }}
{% endif %} {% endif %} {% endmacro %} {% macro dump(o) %} {% if h.is_dict(o) %} {% endif %} {% if h.is_list(o) %} {% endif %} {% if h.is_string(o) %}
  • {{o}}
  • {% endif %} {% endmacro %} {% macro paginator(pageobj) %} {% set page = pageobj.page %} {% set numpages = pageobj.page_count %} {% set url_for_page = h.paginator_page_url(pageobj) %} {% if numpages > 1 %}
    {% endif %}
    {% endmacro %} {% macro breadcrumbs(kvlist) %}
    {% endmacro %} {% macro if_(testValue,stringIfTrue,stringIfFalse='') %}{% if testValue %}{{stringIfTrue}}{% else %}{{stringIfFalse}}{% endif%}{% endmacro %} {% macro search_form(mini=False, placeholder='Search for data...', set_fields=None) %}
    {# extra_options can be passed in using the "call" syntax #} {% if caller %} {{ caller() }} {% endif %}
    {% if not mini %}
    {% if not c.query_error %} {% set count = c.page.item_count if c.page != '' else (c.package_count or 0) %}
    {{count}}
    {% else %} {% endif %}
    {% endif %}
    {% endmacro %} {% macro package_list_from_dict(packages,mini=False) %}
    {% for i in range(packages|length) %} {% if i%4==0 %}
    {% endif %} {% if i%3==0 %}
    {% endif %} {% if i%2==0 %}
    {% endif %} {% with %} {% set package = packages[i] %} {% set draft = h.is_draft_item(packages[i]) %} {% set unpublished = h.is_unpublished_item(packages[i]) %} {% set title = packages[i].get('title') or packages[i].get('name') %} {% set podrocje = h.get_podrocje(packages[i]) %} {% set total_counts = h.get_total_views(packages[i]) %}
    {% if packages[i].get('opsi_tip_naziv', '') %} {% set opsi_tip_naziv = packages[i].get('opsi_tip_naziv', '') %} {% endif %}
    {{podrocje or '(ni področja)'}}
    {{title}} {% if draft or unpublished %}{% if draft and unpublished %}(v potrjevanju){% elif unpublished %}(v urejanju){% else %}(osnutek){% endif %}{% endif %}   {{total_counts}} ogledov {{ h.get_total_likes(packages[i].id) }}
    {% for format in h.formats_for_package(package) %} {{format_box(format.lower())}} {% endfor %} {% if h.has_datastore_resource(package) %} {{format_box('Prog. vmesnik')}} {% endif %}
     
    {% endwith %} {% endfor %}
    {% endmacro %} {% macro dict_to_attributes(d) -%} {% for k, v in d.iteritems() -%}{{k}}="{{v}}"{%- endfor %} {%- endmacro %} {% macro facet_box(title, unselected, selected, if_empty, more_button=None) %}

    {{title}}

    {% for (link,text,tooltip,facet_class) in selected %} {% endfor %} {% for i in range(unselected|length) %} {% with %} {% set (link,text,tooltip,facet_class) = unselected[i] %} {% set overflow = i>5 and more_button %} {% endwith %} {% endfor %} {% if more_button and unselected|length>5 %}
      več  
      manj  
    {% endif %} {% if not selected|length and not unselected|length %}
    {{if_empty}}
    {% endif %}
    {% endmacro %} {% macro facet_filters() %} {% endmacro %} {% macro contact_details(name, email, phone, web_url, web_name) %} {% if email and '@' in email %}
  • Elektronska pošta: {{h.encode_email(email)}}
  • {% else %} {% if email and 'http' in email %}
  • Spletni naslov: {{email}}
  • {% else %} {% if email %}
  • Elektronska pošta: {{email}}
  • {% endif %} {% endif %} {% endif %} {% if phone %}
  • Telefon: {{phone}}
  • {% endif %} {% if web_url %}
  • Spletni naslov: {{h.truncate(web_name or web_url, 32)}}
  • {% endif %} {% if not (email or phone or web_url) %}

    Ni kontaktnih podatkov

    {% endif %} {% endmacro %} {% macro format_box(format_name) %}
    {% if format_name %} {{h.dgu_format_name(format_name)}} {% endif %}
    {% endmacro %} {% macro primary_theme_input(data, errors) %} {% for theme, theme_dict in h.sorted_list(h.themes().iteritems()) %} {% endfor %} {% if errors.get('theme-primary', '') %}

    {{errors.get('theme-primary', '')}}

    {% endif %} {% endmacro %} {% macro secondary_theme_input(data, errors) %} {% for theme, theme_dict in h.sorted_list(h.themes().iteritems()) %} {% endfor %} {% if errors.get('themes-secondary', '') %}

    {{errors.get('themes-secondary', '')}}

    {% endif %} {% endmacro %}