{% extends "search/base.html" %} {% set locale = request.locale %} {% if locale in settings.LOCALES %} {% set locale_native = settings.LOCALES[locale].native %} {% endif %} {% set default_locale_native = settings.LOCALES[settings.LANGUAGE_CODE].native %} {% set meta = (('WT.oss', q), ('WT.oss_r', num_results)) %} {% block title %} {% if query %} {{ page_title(_('Search Results for "{query}"')|f(query=query)) }} {% else %} {{ page_title(_('Search')) }} {% endif %} {% endblock %} {% block bodyclass %}search-results search-results-no-demo{% if waffle.flag('search_doc_navigator') %} search-navigator-flush{% endif %}{% endblock %} {% macro doc_block(doc, index) -%}
  • {{ doc.title }}

    {{ doc.excerpt|safe }}

    {{ doc.url|replace('https://', '') }} {% if waffle.flag('search_explanation') %}Score: {{ doc.score }}{% endif%} {% if doc.parent %} {% trans parent_url=doc.parent.url, parent_title=doc.parent.title, parent_language=settings.LOCALES[doc.parent.locale].native %} translated from {{ parent_title }} ({{ parent_language }}) {% endtrans %} {% endif %}

  • {% endmacro %} {% block content %}

    {{ _('MDN Site Search') }}

    {{ _('Search') }}

    {{ _('Results') }}

    {% if locale_native %} {% if query %} {% if locale_native == default_locale_native %} {% trans count=count %} {{ count }} document found for "{{ query }}" in {{ locale_native }}. {% pluralize %} {{ count }} documents found for "{{ query }}" in {{ locale_native }}. {% endtrans %} {% else %} {% trans count=count %} {{ count }} document found for "{{ query }}" in {{ locale_native }} and {{ default_locale_native }}. {% pluralize %} {{ count }} documents found for "{{ query }}" in {{ locale_native }} and {{ default_locale_native }}. {% endtrans %} {% endif %} {% else %} {% if locale_native == default_locale_native %} {% trans count=count %} {{ count }} document found in {{ locale_native }}. {% pluralize %} {{ count }} documents found in {{ locale_native }}. {% endtrans %} {% else %} {% trans count=count %} {{ count }} document found in {{ locale_native }} and {{ default_locale_native }}. {% pluralize %} {{ count }} documents found in {{ locale_native }} and {{ default_locale_native }}. {% endtrans %} {% endif %} {% endif %} {% else %} {% if query %} {% trans count=count %} {{ count }} document found for "{{ query }}". {% pluralize %} {{ count }} documents found for "{{ query }}". {% endtrans %} {% else %} {% trans count=count %} {{ count }} document found. {% pluralize %} {{ count }} documents found. {% endtrans %} {% endif %} {% endif %} {% if count %} {% if not previous and not next %} {{ _('Showing all results.') }} {% else %} {% trans %}Showing results {{ start }} to {{ end }}.{% endtrans %} {% endif %} {% endif %} {% if locale != settings.LANGUAGE_CODE %} {% trans %} Search again in {{ default_locale_native }} only {% endtrans %} {% endif %} {% if request.user.is_superuser %} Search index: {{ index.name }} (created: {{ index.created_at }}) {% endif %}

    {% if count %}

    {{ _('Docs') }}

      {% for doc in documents %} {{ doc_block(doc, loop.index) }} {% endfor %}
    {% if previous %} {{ _('Previous') }} {% endif %} {% if next %} {{ _('Next') }} {% endif %}
    {% endif %}
    {% if filters %}
    {% for filter_group in filters %}
    {{ _('Filter by') }} {{ filter_group.name }} {% for filter in filter_group.options %} {% if filter.count == 0 %} {% elif filter.slug in selected_filters %} {% else %} {% endif %} {% endfor %}
    {% endfor %} {% endif %}
    {% endblock %}