{% extends 'aristotle_mdr/base.html' %} {% load i18n %} {% load humanize %} {% load bootstrap3 %} {% load staticfiles %} {% load aristotle_tags aristotle_search_tags %} {% load compile_static %} {% block extra_head_scripts %} {% endblock %} {% block header %} {% include 'aristotle_mdr/header.html' with hide_search=True %} {% endblock %} {% block title %}{% trans "Search" %}{% if query %} {% trans "results" context 'Search results' %} - {{ query }}{% endif %}{% endblock %} {% block content %}
{# open main_search_form #}
{% if user.is_active %} {% comment %} Only logged in users have workgroups. If you aren't logged in you can *only* see public items. {% endcomment %} {% endif %} Advanced help
{# close main_search_form for when results #}
{% if form.errors %}

There were one or more error with your search selections, please correct them and try again.

{% endif %}
{% if query or form.filter_search %}

Results

{% if form.auto_broaden_search %} {% endif %}
{% if form.applied_filters %}
Showing only items where {% search_describe_filters form %}
{% endif %}

{% if page.has_other_pages %} Showing {{ page.start_index }} - {{ page.end_index }} of {{ page.paginator.count }} results. {% else %} Showing {{ page.paginator.count }} results. {% endif %}

{# ----- If there are spelling suggestions, show them. ----- #} {% if form.auto_correct_spell_search or form.has_spelling_suggestions %} {% if form.auto_correct_spell_search %}
{% if page.object_list %}

No results for: {{ form.original_query }}

Searching instead for: {% for word,suggestion in form.spelling_suggestions %} {% if suggestion %} {{ suggestion }} {% else %} {{ word }} {% endif %} {% endfor %} {% else %}

No results for: {{ form.original_query }}

Tried searching instead for: {% for word,suggestion in form.spelling_suggestions %} {% if suggestion %} {{ suggestion }} {% else %} {{ word }} {% endif %} {% endfor %}, but no results were found. {% endif %}
{# closes div#spelling #} {% elif form.has_spelling_suggestions %} Did you mean: {% for word,suggestion in form.spelling_suggestions %} {% if suggestion %} {{ suggestion }} {% else %} {{ word }} {% endif %} {% endfor %} {% endif %} {% endif %}
{% endif %}
{# ----- MAIN RESULTS PAGE STARTS HERE ----- #} {% if query or form.filter_search %} {% if page.object_list %}
Refine your results
{% if form.facets.fields.facet_model_ct %}
Item types
{% for f in form.facets.fields.facet_model_ct %}
{% with ct='ct'|get_item_from_facet:f.0 %} {{ ct.name|title }} ({{ f.1 }}) {% endwith %}
{% endfor %} {% endif %} {% if form.facets.fields.registrationAuthorities %}
Registration Authorities
{% for f in form.facets.fields.registrationAuthorities %}
{% with ra='ra'|get_item_from_facet:f.0 %} {% if ra %} {{ ra.name }} ({{ f.1 }}) {% else %} {# the user wants unregistered content, show that #} {% trans 'Not registered' %} ({{ f.1 }}) {% endif %} {% endwith %}
{% endfor %} {% endif %} {% if request.user.is_active and form.facets.fields.restriction %}
Restriction
{% for f in form.facets.fields.restriction %}
{{ f.0|restriction_to_text }}{{f.o}} ({{ f.1 }})
{% endfor %} {% endif %} {% if form.facets.fields.statuses %}
Status
{% for f in form.facets.fields.statuses %}
{{ f.0|search_state_to_text }} ({{ f.1 }})
{% endfor %} {% endif %} {% if request.user.is_active and form.facets.fields.workgroup %}
Workgroup
{% for f in form.facets.fields.workgroup %}
{% with wg='wg'|get_item_from_facet:f.0 %} {{ wg.name }} ({{ f.1 }}) {% endwith %}
{% endfor %} {% endif %} {% for field,details in form.extra_facet_fields %} {% if details.values %}
{{details.details.title}}
{% if details.details.applied %}
Active facets
{% endif %} {% for f,count in details.values %} {% if f %}
{% facet_display details.details f %} ({{ count }})
{% endif %} {% endfor %} {% endif %} {% endfor %}
{% csrf_token %}
    {% for result in page.object_list %} {% if result %}
  1. {% if result.object.concept %} {% include "search/badge.html" with result=result %} {% if result.object.concept in request.user.profile.favourites.all %} {% endif %} {% else %}
    {% endif %}
    {% include result.searchindex.template_name with item=result.object %}
  2. {% endif %} {% empty %}
  3. No results found.
  4. {% endfor %}
{% include "aristotle_mdr/helpers/list_action_bar.html" with wrap=True %}
{% include "aristotle_mdr/helpers/paginator.html" with page=page %}
{% else %}

No results found.

{% if form.auto_broaden_search %}

{% endif %} {% if form.attempted_filter_search %} {% endif %}

{% endif %} {% elif form.errors %} {% else %} {# Show some example queries to run, maybe query syntax, something else? #}

Enter a query above to search the registry.

{% endif %} {% bootstrap_modal 'search_concept_help' %} {% endblock %}