mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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:
@@ -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 }}
|
||||
|
Reference in New Issue
Block a user