-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from JiscSD/update_year_filter_ordering
Update year filter ordering
- Loading branch information
Showing
4 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,4 @@ coverage.xml | |
|
||
# Sphinx documentation | ||
docs/_build/ | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
ckanext/customised_fields_from_tag_vocabulary/templates/snippets/facet_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% ckan_extends %} | ||
|
||
{% block facet_list_items %} | ||
{% with items = items or h.get_facet_items_dict(name, search_facets or c.search_facets) %} | ||
{% if items %} | ||
{% set sorted_items = h.reorder_facet(title, items) %} | ||
<nav aria-label="{{ title }}"> | ||
<ul class="{{ nav_class or 'list-unstyled nav nav-simple nav-facet' }}"> | ||
{% for item in sorted_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 label_truncated = h.truncate(label, 22) if not label_function else label %} | ||
{% set count = count_label(item['count']) if count_label else ('%d' % item['count']) %} | ||
<li class="{{ nav_item_class or 'nav-item' }}{% if item.active %} active{% endif %}"> | ||
<a href="{{ href }}" title="{{ label if label != label_truncated else '' }}"> | ||
<span class="item-label">{{ label_truncated }}</span> | ||
<span class="hidden separator"> - </span> | ||
<span class="item-count badge">{{ count }}</span> | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</nav> | ||
|
||
<p class="module-footer"> | ||
{% if h.get_param_int('_%s_limit' % name) %} | ||
{% if h.has_more_facets(name, search_facets or c.search_facets) %} | ||
<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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters