From 7d685c5e64149e20c7dc8977f645e050be53ddfd Mon Sep 17 00:00:00 2001 From: Jonas Kohl Date: Tue, 10 Dec 2024 17:15:10 +0100 Subject: Add classic theme --- src/application/templates/old/components/post.twig | 169 +++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 src/application/templates/old/components/post.twig (limited to 'src/application/templates/old/components/post.twig') diff --git a/src/application/templates/old/components/post.twig b/src/application/templates/old/components/post.twig new file mode 100644 index 0000000..6b04bca --- /dev/null +++ b/src/application/templates/old/components/post.twig @@ -0,0 +1,169 @@ +{%- set fileAttachments = attachments|filter(a => not (a.mimeType starts with "image/" or a.mimeType starts with "video/")) -%} +{%- set imageAttachments = attachments|filter(a => a.mimeType starts with "image/" or a.mimeType starts with "video/") -%} + +{%- set canReply = + not post.deleted + and not topic.isLocked + and currentUser is not null + and currentUser.hasPermission(permission("CREATE_OWN_POST")) +-%} + +{%- set canEdit = + not post.deleted + and not topic.isLocked + and currentUser is not null + and ( + ( + postAuthor is not null + and postAuthor.id == currentUser.id + and postAuthor.hasPermission(permission("EDIT_OWN_POST")) + ) + or currentUser.hasPermission(permission("EDIT_OTHER_POST")) + ) -%} + +{%- set canDelete = + not post.deleted + and currentUser is not null + and ( + ( + postAuthor is not null + and postAuthor.id == currentUser.id + and postAuthor.hasPermission(permission("DELETE_OWN_POST")) + ) + or currentUser.hasPermission(permission("DELETE_OTHER_POST")) + ) -%} + +{%- set canViewAttachments = currentUser is not null -%} + +{%- set your_are_the_author = + currentUser is not null + and postAuthor is not null + and currentUser.id == postAuthor.id +-%} + +{%- set is_op = + topicAuthor is not null + and postAuthor is not null + and postAuthor.id == topicAuthor.id +-%} + +{%- set hasOtherAttachments = (fileAttachments|length > 0) -%} + +{% if post.deleted %} +
+ {# + #}{{ __("This post has been deleted") }} + |