diff options
author | Jonas Kohl | 2024-10-19 12:38:45 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-10-19 12:38:45 +0200 |
commit | f490626b8a2ff360c4a914615484ea6e5bf8cdee (patch) | |
tree | 96cbbcea2a63283b44186a32fcf6528f692f6523 /src/application/templates/modern/components/topic_log.twig | |
parent | 3c8f4f695f1b9ec7a188b85e0ce38bc69c697008 (diff) |
Add modern theme
Diffstat (limited to 'src/application/templates/modern/components/topic_log.twig')
-rw-r--r-- | src/application/templates/modern/components/topic_log.twig | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/application/templates/modern/components/topic_log.twig b/src/application/templates/modern/components/topic_log.twig new file mode 100644 index 0000000..853dc20 --- /dev/null +++ b/src/application/templates/modern/components/topic_log.twig @@ -0,0 +1,68 @@ +{%- set user = "" -%} +{%- if postAuthor is null -%} + {%- set user = __("(deleted)")|e("html") -%} +{%- else -%} + {%- set user = + '<a href="?_action=viewuser&user=' + ~ postAuthor.id|url_encode|e("html") + ~ '">' + ~ postAuthor.displayName|e("html") + ~ '</a>' + -%} +{%- endif -%} + +<div class="post log" id="post-{{ logMessage.id }}"> + <div class="post-pfp"> + {% if postAuthor %} + {% if hideActions %} + <img class="media-object" alt="{{ __("Profile picture") }}" src="?_action=profilepicture&user={{ postAuthor.id|url_encode }}" width="64" height="64"> + {% else %} + <a href="?_action=viewuser&user={{ postAuthor.id|url_encode }}"> + <img class="media-object" alt="{{ __("Profile picture") }}" src="?_action=profilepicture&user={{ postAuthor.id|url_encode }}" width="64" height="64"> + </a> + {% endif %} + {% else %} + <div class="media-object" style="width:64px;height:64px"></div> + {% endif %} + </div> + <div class="post-body"> + {% if logMessage.type == constant("mystic\\forum\\orm\\TopicLogMessage::LOCKED") %} + <div class="post-status post-status-warning"> + <svg viewBox="0 0 24 24" class="icon"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg> + <span> + <em>{{ __("%user% locked this topic", { + "user": user, + }) }}</em> + <br> + <small class="_time">{{ logMessage.postDate.format("c") }}</small> + </span> + </div> + {% elseif logMessage.type == constant("mystic\\forum\\orm\\TopicLogMessage::UNLOCKED") %} + <div class="post-status post-status-success"> + <svg viewBox="0 0 24 24" class="icon"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/></svg> + <span> + <em>{{ __("%user% unlocked this topic", { + "user": user, + }) }}</em> + <br> + <small class="_time">{{ logMessage.postDate.format("c") }}</small> + </span> + </div> + {% elseif logMessage.type == constant("mystic\\forum\\orm\\TopicLogMessage::TITLE_CHANGED") %} + <div class="post-status post-status-info"> + <svg viewBox="0 0 24 24" class="icon"><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/></svg> + <span> + <em>{{ __("%user% changed the title of this topic from %old_title% to %new_title%", { + "user": user, + "old_title": '<strong>' ~ logMessage.params.old_value|default(__("unknown"))|e("html") ~ '</strong>', + "new_title": '<strong>' ~ logMessage.params.new_value|default(__("unknown"))|e("html") ~ '</strong>', + }) }}</em> + <br> + <small class="_time">{{ logMessage.postDate.format("c") }}</small> + </span> + </div> + {% else %} + {{ __("unknown") }} + {% endif %} + </div> +</div> |