{% extends "cranefly/search/layout.html" %} {% import "cranefly/macros.html" as macros with context %} {% block title %}{{ macros.page_title(title=_("Search Results"),parent=_('Search Community')) }}{% endblock %} {% block action %}
{% if results %}

{% trans count=items_total, results=items_total|intcomma, query=query_string(search_query) %}Search for "{{ query }}" has returned one result:{% pluralize %}Search for "{{ query }}" has returned {{ results }} results:{% endtrans %} {% trans %}New Search{% endtrans %}

{% for result in results %}
{% if result.user_id %} {% else %} {{ result.user_name }} {% endif %}

{{ result.thread.name }}

{{ result.post_clean|highlight(search_query, 320)|safe }}

{% trans forum=forum(result.forum), user=username(result), date=result.date|reltimesince|low %}In {{ forum }} by {{ user }} {{ date }}{% endtrans %}

{% endfor %}
{{ pager() }} {% else %}

{% trans %}Looks like your search has expired. Please try searching again.{% endtrans %}

{% endif %}
{% endblock %} {% macro query_string(query) -%} {{ query }} {%- endmacro %} {% macro forum(forum) -%} {{ forum }} {%- endmacro %} {% macro username(post) -%} {% if post.user_id -%} {{ post.user.username }} {%- else -%} {{ post.user_name }} {%- endif %} {%- endmacro %} {% macro pager() -%} {% if items_total > 0 and pagination['total'] > 1 %} {% endif %} {%- endmacro %}