{# This is a version of the index page that will render for variant searches. To define a specific variant, also define a `variant_search_VARIANTTYPE.template` file, where VARIANTTYPE is whatever type is defined in the .yaml file. #} {% extends 'base.html' %} {% block extra_js %} {{ entry_template_header_includes|safe }} {# TODO: compile these together #} {% endblock %} {% block footer_js %} {% endblock %} {% block search_li %} {% endblock %} {% block search_li_form %} {% endblock %} {% block extra_nav %} {# Dictionaries #} {% include 'mobile_nav_dictionary_list.html' %} {% endblock %} {% block bodyclass %}main_search keyword_search{% endblock %} {%- set keyboard = false %} {% if current_variant_options %} {% set keyboard = current_variant_options.onscreen_keyboard %} {% endif -%} {% block content %}
{% if grouped_nav %} {% set nav_width = "span3" %} {% set dict_width = "span9" %} {% else %} {% set nav_width = "span4" %} {% set dict_width = "span8" %} {% endif %}

{% if current_variant_options %} {{ _from|iso_to_i18n }} ({{ gettext(current_variant_options.description) }}) → {{ _to|iso_to_i18n }} {% else %} {{ _from|iso_to_i18n }} → {{ _to|iso_to_i18n }} {% endif %} — {{ gettext(current_search_variant.description) }} {% if display_swap %} ({% trans %}Swap{% endtrans %}) {% endif %}

{# figure out if there's a variant, and if the reverse has variants, because if mobile, we want to force mobile variant in swap #}
{# copy-for-now #} {%- set keyboard = false %} {% if current_variant_options %} {% set keyboard = current_variant_options.onscreen_keyboard %} {% endif -%}
{# {% if keyboard %}
{% endif %} #} {% include 'keyword_search_form.html' %}
{% if available_keywords %}

Your search turned up words with one or more keywords. Narrow your search down by choosing more:

{% for k in available_keywords %} + {{ k }} {% endfor %}

{% endif %}
{# /copy-for-now #} {# TODO: keyword JS stuff #}
{% if analyses %}

{{ user_input }}{% trans user_input=user_input %} is a possible form of ... {% endtrans %}

{% endif %}
{% if successful_entry_exists %}
{% for tpl in entry_templates %} {{ tpl|safe }} {% endfor %} {% if leftover_analyses_template %}
{% if entry_templates|length == 0 %}

{% trans input=user_input %}Word {{ input }} not found.{% endtrans %}

{% else %}   {% endif %}

{% trans user_input=user_input %}Other analyses for {{ user_input }} without a translation.{% endtrans %}

{{- leftover_analyses_template|safe -}}
{% endif %}
{% else %} {% if not show_info %}
{% if entry_templates|length == 0 %}

{% trans input=user_input %}Word {{ input }} not found.{% endtrans %}

{% else %}   {% endif %}
{% if analyses %} {{- leftover_analyses_template|safe -}} {% endif %}
{% endif %} {% endif %} {% if show_info %} {{ search_info_template|safe }} {% endif %} {# NB: this could be a fun idea, but would take work to sort out. tl;dr: visual grid of keywords with counts, allow the user to pick one, and warn if there are too many entries, displaying keywords to narrow it down. #} {# {% if initial_keywords %}
{% for kw, count in initial_keywords[0:100] %}
{{ kw }} {{ count }} entries
{% endfor %}
{% endif %} #}
{%- if analyses %}

{{ user_input }}{% trans user_input=user_input %} is a possible form of ... {% endtrans %}

{{ all_analysis_template|safe }}
{%- endif -%}
{% endblock %}