{% set title = __("Search") %} {% set formId = "search" %} {% set formError = getAndClearFormError(formId) %} {% extends "base.twig" %} {% block content %} {% if formError %} {% include "components/alert_error.twig" with { message: formError } %} {% endif %}
{% if g.get.query is defined and g.get.query is not null and g.get.query != "" %} {% if ctx.posts|length > 0 %}

{{ __("%result_count% result(s) in %search_duration% second(s)", { "result_count": ctx.posts|length, "search_duration": ctx.search_duration|number_format(2, __(".", context: "Number formatting"), __(",", context: "Number formatting")), }) }}

{% for post in ctx.posts|filter(p => not p.deleted) %} {% set hasAttachments = ctx.attachments[post.id]|length > 0 %} {% set postAuthor = ctx.users[post.authorId] %}

{% if hasAttachments %} {% endif %} {{ renderPostSummary(post.content) }}

{{ __("posted by %author% on %post_date% in %topic%", { "author": '' ~ (postAuthor ? postAuthor.displayName : __("unknown"))|e("html") ~ '', "post_date": '' ~ post.postDate.format("c")|e("html") ~ '', "topic": '' ~ (ctx.topics[post.topicId].isLocked ? ' ' : '') ~ (ctx.topics[post.topicId] ? ctx.topics[post.topicId].title : null)|default(__("unknown"))|e("html") ~ '', }) }}
{% endfor %}
{% else %}
{{ __("No results for this search") }}
{% endif %} {% endif %} {% endblock %}