{%- 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.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 -%} {% if post.deleted %}