{% include '_macros/app_tile.html' %} {% include '_macros/addon_tile.html' %} {% include '_macros/more_button.html' %} {% macro results_subheader(query, count) %}

{{ _plural('{n} Result', '{n} Results', n=count) }}

{{ _plural('"{search_query}" returned {n} result', '"{search_query}" returned {n} results', search_query=query|escape, n=count) }}

{% endmacro %} {% set api_url = anonApiParams('search', params) %} {% if params.region %} {# If the user entered PotatoSearchâ„¢ `:region=` then update `region`. #} {% set api_url = api_url|urlparams(region=params.region) %} {% endif %} {% if params.sort %} {% set api_url = api_url|urlparams(sort=params.sort) %} {% endif %} {% defer (url=api_url, pluck='objects', as=getProductType, paginate='.app-list', id='searchresults') %} {{ results_subheader(raw_query, response.meta.total_count) }}
    {% for result in processor(this) %} {# TODO: rename 'app-list-app' #}
  • {% if getProductType(result) == 'addon' %} {{ addon_tile(result, src=trackingEvents.SRCS.search) }} {% else %} {# Searches for developer name should show categories. #} {% if params.author %} {{ app_tile(result, tray=True, src=trackingEvents.SRCS.search) }} {% else %} {{ app_tile(result, tray=True, alt_style=True, src=trackingEvents.SRCS.search) }} {% endif %} {% endif %}
  • {% endfor %} {# Render the more button if there's another page of results #} {% if response.meta.next %} {{ more_button(response.meta.next) }} {% endif %}
{% placeholder %}

{% empty %} {{ results_subheader(raw_query, 0) }}

{{ _('No results found') }}

{% except %}
{# Handle 500s so the page isn't blank. (bug 868667) #}

{{ _('No results found, try again later') }}

{% end %}