[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
This commit is contained in:
tobi
2024-07-13 12:26:16 +02:00
committed by GitHub
parent bbbdf01213
commit c83e96b8a7
6 changed files with 90 additions and 102 deletions

View File

@@ -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 . }}
</section>
<section class="thread thread-replies" aria-labelledby="replies" open>
<div class="col-header replies">
<div class="col-header replies{{- if not .context.ThreadRepliesShown }} hidden-only{{- end -}}">
<h2 id="replies">{{- template "repliesSummary" . -}}</h2>
<a href="#thread-summary">back to top</a>
</div>
@@ -77,41 +79,18 @@
{{- end }}
</div>
{{- range $thisStatus := .context.Ancestors }}
{{- if $thisStatus.ThreadFirstReply }}
{{- range $status := .context.Statuses }}
<article
class="status{{- if $status.ThreadContextStatus }} expanded{{- end -}}{{- if $status.Indent }} indent-{{ $status.Indent }}{{- end -}}"
{{- includeAttr "status_attributes.tmpl" $status | indentAttr 3 }}
>
{{- include "status.tmpl" $status | indent 3 }}
</article>
{{- if and $status.ThreadLastMain $.context.ThreadReplies }}
{{- include "repliesStart" $ | indent 1 }}
{{- end }}
<article
class="status{{- if $thisStatus.Indent }} indent-{{ $thisStatus.Indent }}{{- end -}}"
{{- includeAttr "status_attributes.tmpl" $thisStatus | indentAttr 3 }}
>
{{- include "status.tmpl" $thisStatus | indent 3 }}
</article>
{{- end }}
{{- with $thisStatus := .context.Status }}
{{- if $thisStatus.ThreadFirstReply }}
{{- include "repliesStart" $ | indent 1 }}
{{- end }}
<article
class="status expanded{{- if $thisStatus.Indent }} indent-{{ $thisStatus.Indent }}{{- end -}}"
{{- includeAttr "status_attributes.tmpl" $thisStatus | indentAttr 3 }}
>
{{- include "status.tmpl" $thisStatus | indent 3 }}
</article>
{{- end }}
{{- range $thisStatus := .context.Descendants }}
{{- if $thisStatus.ThreadFirstReply }}
{{- include "repliesStart" $ | indent 1 }}
{{- end }}
<article
class="status{{- if $thisStatus.Indent }} indent-{{ $thisStatus.Indent }}{{- end -}}"
{{- includeAttr "status_attributes.tmpl" $thisStatus | indentAttr 3 }}
>
{{- include "status.tmpl" $thisStatus | indent 3 }}
</article>
{{- end }}
{{- if .context.ThreadReplies }}
</section>
{{- end }}