From c83e96b8a740a44f565068d06c4f12eef486b7e5 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 13 Jul 2024 12:26:16 +0200 Subject: [chore/frontend] Tweak threading a bit, inform about hidden replies (#3097) * [chore/frontend] Tweak threading a bit, inform about hidden replies * whoops * round off bottom of replies col-header if no replies visible --- web/source/css/thread.css | 9 +++++++++ web/template/thread.tmpl | 39 +++++++++------------------------------ 2 files changed, 18 insertions(+), 30 deletions(-) (limited to 'web') diff --git a/web/source/css/thread.css b/web/source/css/thread.css index 4f4e3e938..e2e6ae6b7 100644 --- a/web/source/css/thread.css +++ b/web/source/css/thread.css @@ -42,6 +42,15 @@ h2 { margin-right: auto; } + + &.replies.hidden-only { + /* + No visible replies below this column + header, so round off the bottom. + */ + border-bottom-left-radius: $br; + border-bottom-right-radius: $br; + } } .status { diff --git a/web/template/thread.tmpl b/web/template/thread.tmpl index 8b4aa2248..0cf9ecb05 100644 --- a/web/template/thread.tmpl +++ b/web/template/thread.tmpl @@ -20,7 +20,7 @@ {{- define "repliesSummary" -}} {{- if .context.ThreadRepliesShown -}} {{- if .context.ThreadRepliesHidden -}} - {{- if eq .context.ThreadReplies 1 -}} + {{- if eq .context.ThreadRepliesShown 1 -}} {{- /* Some replies are hidden. */ -}} {{ .context.ThreadRepliesShown }} visible reply {{- else if gt .context.ThreadRepliesShown 1 -}} @@ -35,6 +35,8 @@ {{ .context.ThreadReplies }} replies {{- end -}} {{- end -}} + {{- else -}} + {{- .context.ThreadRepliesHidden }} {{ if eq .context.ThreadRepliesHidden 1 }}reply{{ else }}replies{{ end }} hidden or not public {{- end -}} {{- end -}} @@ -60,7 +62,7 @@ {{- with . }}
-
+

{{- template "repliesSummary" . -}}

back to top
@@ -77,41 +79,18 @@ {{- end }}
- {{- range $thisStatus := .context.Ancestors }} - {{- if $thisStatus.ThreadFirstReply }} - {{- include "repliesStart" $ | indent 1 }} - {{- end }} + {{- range $status := .context.Statuses }}
- {{- include "status.tmpl" $thisStatus | indent 3 }} + {{- include "status.tmpl" $status | indent 3 }}
- {{- end }} - - {{- with $thisStatus := .context.Status }} - {{- if $thisStatus.ThreadFirstReply }} + {{- if and $status.ThreadLastMain $.context.ThreadReplies }} {{- include "repliesStart" $ | indent 1 }} {{- end }} -
- {{- include "status.tmpl" $thisStatus | indent 3 }} -
{{- end }} - {{- range $thisStatus := .context.Descendants }} - {{- if $thisStatus.ThreadFirstReply }} - {{- include "repliesStart" $ | indent 1 }} - {{- end }} -
- {{- include "status.tmpl" $thisStatus | indent 3 }} -
- {{- end }} {{- if .context.ThreadReplies }}
{{- end }} -- cgit v1.2.3