summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-07-13 12:26:16 +0200
committerLibravatar GitHub <noreply@github.com>2024-07-13 12:26:16 +0200
commitc83e96b8a740a44f565068d06c4f12eef486b7e5 (patch)
treea49ff113cb373953dfbe85e3406971a4d1a6779b /web
parent[bugfix] Fix panic in `isStatusHomeTimelineable` (#3096) (diff)
downloadgotosocial-c83e96b8a740a44f565068d06c4f12eef486b7e5.tar.xz
[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
Diffstat (limited to 'web')
-rw-r--r--web/source/css/thread.css9
-rw-r--r--web/template/thread.tmpl39
2 files changed, 18 insertions, 30 deletions
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 . }}
</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 }}
- {{- include "repliesStart" $ | indent 1 }}
- {{- end }}
+ {{- range $status := .context.Statuses }}
<article
- class="status{{- if $thisStatus.Indent }} indent-{{ $thisStatus.Indent }}{{- end -}}"
- {{- includeAttr "status_attributes.tmpl" $thisStatus | indentAttr 3 }}
+ class="status{{- if $status.ThreadContextStatus }} expanded{{- end -}}{{- if $status.Indent }} indent-{{ $status.Indent }}{{- end -}}"
+ {{- includeAttr "status_attributes.tmpl" $status | indentAttr 3 }}
>
- {{- include "status.tmpl" $thisStatus | indent 3 }}
+ {{- include "status.tmpl" $status | indent 3 }}
</article>
- {{- end }}
-
- {{- with $thisStatus := .context.Status }}
- {{- if $thisStatus.ThreadFirstReply }}
+ {{- if and $status.ThreadLastMain $.context.ThreadReplies }}
{{- 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 }}