harvester-d4science/ckanext/harvest/templates/source/search.html

70 lines
2.2 KiB
HTML

{% extends "page.html" %}
{% block subtitle %}{{ _("Harvest sources") }}{% endblock %}
{% block breadcrumb_content %}
<li class="active">{{ h.nav_link(_('Harvest Sources'), named_route='{0}_search'.format(c.dataset_type)) }}</li>
{% endblock %}
{% if g.ckan_base_version.startswith('2.0') %}
{# CKAN 2.0 #}
{% block add_action_content %}
{{ h.snippet('snippets/add_source_button.html', dataset_type=c.dataset_type) }}
{% endblock %}
{% endif %}
{% block primary_content %}
{% if g.ckan_base_version.startswith('2.0') %}
{# CKAN 2.0 #}
{% include 'source/search_2.0.html' %}
{% else %}
{# > CKAN 2.0 #}
<section class="module">
<div class="module-content">
{% block page_primary_action %}
<div class="page_primary_action">
{{ h.snippet('snippets/add_source_button.html', dataset_type=c.dataset_type) }}
</div>
{% endblock %}
{% set facets = {
'fields': c.fields_grouped,
'search': c.search_facets,
'titles': c.facet_titles,
'translated_fields': c.translated_fields,
'remove_field': c.remove_field }
%}
{% set sorting = [
(_('Relevance'), 'score desc, metadata_modified desc'),
(_('Name Ascending'), 'title_string asc'),
(_('Name Descending'), 'title_string desc'),
(_('Last Modified'), 'metadata_modified desc'),
(_('Popular'), 'views_recent desc') if g.tracking_enabled else (false, false) ]
%}
{% snippet 'snippets/search_form.html', type='harvest', query=c.q, sorting=sorting, sorting_selected=c.sort_by_selected, count=c.page.item_count, facets=facets, show_empty=request.params, error=c.query_error, placeholder=_("Search harvest sources...") %}
{{ h.snippet('snippets/source_list.html', sources=c.page.items, show_organization=true) }}
</div>
{{ c.page.pager(q=c.q) }}
</section>
{% endif %}
{% endblock %}
{% block secondary_content %}
{% for facet in c.facet_titles %}
{{ h.snippet('snippets/facet_list.html', title=c.facet_titles[facet], name=facet, alternative_url=h.url_for('{0}_search'.format(c.dataset_type))) }}
{% endfor %}
{% endblock %}