fix: server-render unread drawer static strings

window.require is undefined in the NodeBB 4 webpack client build, so the
translateText helper never ran and unread drawer strings rendered as raw
[[unread:title]] / [[unread:no-unread-topics]]. Move the static strings into
the benchpress template (translated at render time) and have client.js only
manage the topic <li> rows.
This commit is contained in:
2026-07-17 18:31:43 +02:00
parent 070871c692
commit e84599d4f9
2 changed files with 26 additions and 34 deletions
+3 -1
View File
@@ -3,5 +3,7 @@
<span component="unread/count" class="badge rounded-1 bg-primary {{{ if !unreadCount.topic }}}hidden{{{ end }}}">{unreadCount.topic}</span>
</a>
<ul class="dropdown-menu wg-topbar__dropdown unread-dropdown p-1 shadow" role="menu" data-wg-unread-menu>
<li class="dropdown-item disabled"><i class="fa fa-fw fa-spinner fa-spin" aria-hidden="true"></i> [[unread:title]]</li>
<li data-wg-unread-loading class="dropdown-item disabled"><i class="fa fa-fw fa-spinner fa-spin" aria-hidden="true"></i> [[unread:title]]</li>
<li data-wg-unread-empty class="hidden"><span class="dropdown-item disabled">[[unread:no-unread-topics]]</span></li>
<li data-wg-unread-footer><hr class="dropdown-divider"><a class="dropdown-item wg-unread-item--all" href="{relative_path}/unread">[[unread:title]]</a></li>
</ul>