{% extends "page.html" %} {% import 'macros/kata_form.html' as kata_form %} {% block subtitle %}{{ _("Search for a Dataset") }}{% endblock %} {% block breadcrumb_content %}
  • {{ h.nav_link(_('Search Datasets'), controller='package', action='search', highlight_actions = 'new index') }}
  • {% endblock %} {% block breadcrumb %} {% if h.check_access('package_create') %}
    {% link_for _('Add Dataset'), controller='package', action='new', class_='btn btn-primary', icon='plus-sign-alt' %}
    {% endif %} {{ super() }} {% endblock %} {% block content_primary_nav %} {{ _('Search') }} {{ _('Advanced search') }} {% endblock %} {% block primary_content_inner %}
    {# Basic search tab #} {# Advanced search tab #} {# CREATE A HIDDEN ROW TO CLONE FROM, WITH PARSED FIELD NAMES BEGINNING WITH LEADING ___ SO THEY WON'T BE PARSED #} {% set current_search_rows = [{ 'field': '___' ~ c.search_fields | first, 'text': '', 'operator': 'AND' }] %} {% if c.current_search_rows %} {% do current_search_rows.extend(c.current_search_rows) %} {% else %} {% do current_search_rows.append({ 'field': c.search_fields | first, 'text': '', 'operator': 'AND' }) %} {% endif %}
    {% block search_title %} {% if not no_title %}

    {% snippet 'snippets/search_result_text.html', query=c.q, count=c.page.item_count, type='dataset' %}

    {% endif %} {% endblock %} {% block search_facets %} {% set facets = { 'fields': c.fields_grouped, 'search': c.search_facets, 'titles': c.facet_titles, 'translated_fields': c.translated_fields, 'remove_field': c.remove_field } %} {% if facets %}

    {% for field in facets.fields %} {% set search_facets_items = facets.search.get(field)['items'] %} {{ facets.titles.get(field) }}: {% for value in facets.fields[field] %} {%- if facets.translated_fields and facets.translated_fields.has_key((field,value)) -%} {{ facets.translated_fields[(field,value)] }} {%- else -%} {{ h.list_dict_filter(search_facets_items, 'name', 'display_name', value) }} {%- endif %} {% endfor %} {% endfor %}

    {% endif %} {% endblock %}
    {% if c.query_error %} {% trans %}

    There was an error while searching. Please try again.

    {% endtrans %} {% endif %} {{ h.snippet('snippets/package_list.html', packages=c.page.items) }} {{ c.page.pager(q=c.q) }} {% endblock primary_content_inner %} {% block primary_content %} {{ super() }} {% block package_search_results_api %}
    {% set api_link = h.link_to(_('API'), h.url_for(controller='api', action='get_api', ver=3)) %} {% set api_doc_link = h.link_to(_('API Docs'), 'http://docs.ckan.org/en/{0}/api.html'.format(g.ckan_doc_version)) %} {% if g.dumps_url -%} {% set dump_link = h.link_to(_('full {format} dump').format(format=g.dumps_format), g.dumps_url) %} {% trans %} You can also access this registry using the {{ api_link }} (see {{ api_doc_link }}) or download a {{ dump_link }}. {% endtrans %} {% else %} {% trans %} You can also access this registry using the {{ api_link }} (see {{ api_doc_link}}). {% endtrans %} {%- endif %}
    {% endblock %} {% endblock primary_content %} {% block secondary_content %} {% for facet in c.facet_titles %} {{ h.snippet('snippets/facet_list.html', title=c.facet_titles[facet], name=facet, fields=c.fields_grouped, limits=c.search_facets_limits) }} {% endfor %} {% endblock %}