Skip to content
Snippets Groups Projects
Select Git revision
  • c764118bfa97aaf1753f688ca84f84854d47c8a7
  • master default protected
  • add-frequency-to-form
  • dev protected
  • ckan-2.11.0
  • add-package-custom-fields
  • fix-adding-datasets-for-users-and-editors
  • add-auth-subroute
  • 71-migrate-custom-fields-to-ckanext-scheming
  • add-author-maintainer-information
  • fix-inline-flex-btns
  • fix-known-spatial-uri-validation
  • py3
  • 47-aktuelle-resource-einer-collection-wird-nicht-mehr-gefunden
  • 10-eingabe-der-dct-accrualperiodicity-in-weboberflache
  • v1.3
  • 2.5.3
  • 2.5.2
  • 2.5.1
  • 2.5.0
  • 2.4.7
  • 2.4.6
  • 2.4.5
  • 2.4.4
  • 2.4.3
  • 2.4.2
  • 2.4.1
  • 2.4.0
  • 2.3.1
  • 2.3.0
  • 2.2.0
  • 2.1.0
  • 2.0.0
  • 1.4.3
  • 1.4.2
  • 1.4.1
36 results

facet_list.html

  • facet_list.html 2.68 KiB
    {% ckan_extends %}
    
    {% block facet_list_heading %}
      {# {% set title = title or h.get_facet_title(name) %}
      {{ title }} #}
    {% endblock %}
    
    {% block facet_list_items %}
    {# {% with items = items or h.get_facet_items_dict(name,20) %} #}
    {% with items = items or h.odsh_get_facet_items_dict(name,20) %}
    {% if items %}
    <nav>
      {% set title = title or h.get_facet_title(name) %}
      <div class="nav-title">{{ title }}</div>
        <ul class="{{ nav_class or 'unstyled nav nav-simple nav-facet' }}">
            {% for item in items %}
            {% set href = h.remove_url_param(name, item.name, extras=extras, alternative_url=alternative_url) if
            item.active else h.add_url_param(new_params={name: item.name}, extras=extras, alternative_url=alternative_url)
            %}
            {% set label = label_function(item) if label_function else item.display_name %}
            {% set count = count_label(item['count']) if count_label else ('%d' % item['count']) %}
            {% set digits = max([label|string|length,2)] %}
            {% set label_truncated = h.truncate(label, 29-digits) if not label_function else label %}
            <li class="{{ nav_item_class or 'nav-item' }}">
    	  <div class="facet_label">
    	    {# TODO: checkbox-id vereinheitlichen (code-duplikation) und sicher gegen Titel mit Leerzeichen machen! #}
    	    <input type="checkbox" {% if item.active %} checked {% endif %} class="filter-checkbox" id="check-{{ title.lower() }}-{{ loop.index }}"/>
    	    <label class="mylabel" for="check-{{ title.lower() }}-{{ loop.index }}"></label>
    	    <a href="{{ href }}" title="{{ label if label != label_truncated else '' }}">
                    <span>{{ label_truncated }}</span>
                </a>
    	  </div>
    	  <div class="facet_count">
                <span class="facet_count">{{ count }}</span>
    	  </div>
            </li>
            {% endfor %}
        </ul>
    </nav>
    
    {# TODO: when there are more than N facets ('with items...' above), how many should be
    displayed and how should these links look? Pascal R. 12.10.2018 #}
    {#<p class="module-footer">
        {% if h.get_param_int('_%s_limit' % name) %}
        {% if h.has_more_facets(name) %}
        <a href="{{ h.remove_url_param('_%s_limit' % name, replace=0, extras=extras, alternative_url=alternative_url) }}"
            class="read-more">{{ _('Show More {facet_type}').format(facet_type=title) }}</a>
        {% endif %}
        {% else %}
        <a href="{{ h.remove_url_param('_%s_limit' % name, extras=extras, alternative_url=alternative_url) }}" class="read-more">{{
            _('Show Only Popular {facet_type}').format(facet_type=title) }}</a>
        {% endif %}
    </p>#}
    
    {% else %}
    <p class="module-content empty">{{ _('There are no {facet_type} that match this search').format(facet_type=title) }}</p>
    {% endif %}
    {% endwith %}
    {% endblock %}