From f490626b8a2ff360c4a914615484ea6e5bf8cdee Mon Sep 17 00:00:00 2001 From: Jonas Kohl Date: Sat, 19 Oct 2024 12:38:45 +0200 Subject: Add modern theme --- src/application/templates/modern/search.twig | 69 ++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/application/templates/modern/search.twig (limited to 'src/application/templates/modern/search.twig') diff --git a/src/application/templates/modern/search.twig b/src/application/templates/modern/search.twig new file mode 100644 index 0000000..3546f41 --- /dev/null +++ b/src/application/templates/modern/search.twig @@ -0,0 +1,69 @@ +{% 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 %} -- cgit v1.2.3