From c9604f216a87ae867a7c31e10abbb43f30e2f19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 23 Sep 2022 10:41:39 -0400 Subject: [PATCH] use partial for topic events --- templates/partials/topic/event.tpl | 26 ++++++++++++++++++++++++++ templates/topic.tpl | 6 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 templates/partials/topic/event.tpl diff --git a/templates/partials/topic/event.tpl b/templates/partials/topic/event.tpl new file mode 100644 index 0000000..3a1dd99 --- /dev/null +++ b/templates/partials/topic/event.tpl @@ -0,0 +1,26 @@ +
  • +
    + +
    + + {{{ if ./href}}} + {./text} + {{{ else }}} + {./text} + {{{ end }}} +   + + {{{ if ./user }}} + {{{ if ./user.system }}} + [[global:system-user]]  + {{{ else }}} + {buildAvatar(./user, "xs", true)}   {./user.username}  + {{{ end }}} + {{{ end }}} + + + {{{ if privileges.isAdminOrMod }}} +   + {{{ end }}} +
  • + diff --git a/templates/topic.tpl b/templates/topic.tpl index a42dfa3..5a79157 100644 --- a/templates/topic.tpl +++ b/templates/topic.tpl @@ -71,7 +71,11 @@ - {renderTopicEvents(@index, config.topicPostSort)} + {{{ if (config.topicPostSort != "most_votes") }}} + {{{ each ./events}}} + + {{{ end }}} + {{{ end }}} {{{end}}}