| 
									
										
										
										
											2023-01-05 12:43:00 +01:00
										 |  |  | {{- /*
 | 
					
						
							| 
									
										
										
										
											2023-04-04 11:33:11 +02:00
										 |  |  | // GoToSocial
 | 
					
						
							|  |  |  | // Copyright (C) GoToSocial Authors admin@gotosocial.org
 | 
					
						
							|  |  |  | // SPDX-License-Identifier: AGPL-3.0-or-later
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This program is free software: you can redistribute it and/or modify
 | 
					
						
							|  |  |  | // it under the terms of the GNU Affero General Public License as published by
 | 
					
						
							|  |  |  | // the Free Software Foundation, either version 3 of the License, or
 | 
					
						
							|  |  |  | // (at your option) any later version.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This program is distributed in the hope that it will be useful,
 | 
					
						
							|  |  |  | // but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
					
						
							|  |  |  | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
					
						
							|  |  |  | // GNU Affero General Public License for more details.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // You should have received a copy of the GNU Affero General Public License
 | 
					
						
							|  |  |  | // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
					
						
							| 
									
										
										
										
											2023-01-05 12:43:00 +01:00
										 |  |  | */ -}}
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-12 20:36:03 +02:00
										 |  |  | {{- define "repliesSummary" -}}
 | 
					
						
							|  |  |  |     {{- if .context.ThreadRepliesShown -}}
 | 
					
						
							|  |  |  |         {{- if .context.ThreadRepliesHidden -}}
 | 
					
						
							| 
									
										
										
										
											2024-07-13 12:26:16 +02:00
										 |  |  |             {{- if eq .context.ThreadRepliesShown 1 -}}
 | 
					
						
							| 
									
										
										
										
											2024-07-12 20:36:03 +02:00
										 |  |  |                 {{- /* Some replies are hidden. */ -}}
 | 
					
						
							|  |  |  |                 {{ .context.ThreadRepliesShown }} visible reply
 | 
					
						
							|  |  |  |             {{- else if gt .context.ThreadRepliesShown 1 -}}
 | 
					
						
							|  |  |  |                 {{ .context.ThreadRepliesShown }} visible replies
 | 
					
						
							|  |  |  |             {{- end -}}
 | 
					
						
							|  |  |  |                 ; {{ .context.ThreadRepliesHidden }} more {{ if eq .context.ThreadRepliesHidden 1 }}reply{{ else }}replies{{ end }} hidden or not public
 | 
					
						
							| 
									
										
										
										
											2023-12-27 11:23:52 +01:00
										 |  |  |         {{- else -}}
 | 
					
						
							| 
									
										
										
										
											2024-07-12 20:36:03 +02:00
										 |  |  |             {{- /* No hidden replies. */ -}}
 | 
					
						
							|  |  |  |             {{- if eq .context.ThreadReplies 1 -}}
 | 
					
						
							|  |  |  |                 {{ .context.ThreadReplies }} reply
 | 
					
						
							|  |  |  |             {{- else if gt .context.ThreadReplies 1 -}}
 | 
					
						
							|  |  |  |                 {{ .context.ThreadReplies }} replies
 | 
					
						
							|  |  |  |             {{- end -}}
 | 
					
						
							| 
									
										
										
										
											2023-12-27 11:23:52 +01:00
										 |  |  |         {{- end -}}
 | 
					
						
							| 
									
										
										
										
											2024-07-13 12:26:16 +02:00
										 |  |  |     {{- else -}}
 | 
					
						
							|  |  |  |         {{- .context.ThreadRepliesHidden }} {{ if eq .context.ThreadRepliesHidden 1 }}reply{{ else }}replies{{ end }} hidden or not public
 | 
					
						
							| 
									
										
										
										
											2023-12-27 11:23:52 +01:00
										 |  |  |     {{- end -}}
 | 
					
						
							|  |  |  | {{- end -}}
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-12 20:36:03 +02:00
										 |  |  | {{- define "threadSummary" -}}
 | 
					
						
							|  |  |  |     {{- if .context.ThreadHidden -}}
 | 
					
						
							|  |  |  |         {{- if eq .context.ThreadShown 1 -}}
 | 
					
						
							|  |  |  |             Single visible post
 | 
					
						
							|  |  |  |         {{- else if gt .context.ThreadShown 1 -}}
 | 
					
						
							|  |  |  |             Thread of {{ .context.ThreadShown }} visible posts
 | 
					
						
							|  |  |  |         {{- end -}}
 | 
					
						
							|  |  |  |             ; {{ .context.ThreadHidden }} more {{ if eq .context.ThreadHidden 1 }}post{{ else }}posts{{ end }} hidden or not public
 | 
					
						
							|  |  |  |     {{- else -}}
 | 
					
						
							|  |  |  |         {{- /* No hidden posts */ -}}
 | 
					
						
							|  |  |  |         {{- if eq .context.ThreadLength 1 -}}
 | 
					
						
							|  |  |  |             Single post
 | 
					
						
							|  |  |  |         {{- else if gt .context.ThreadLength 1 -}}
 | 
					
						
							|  |  |  |             Thread of {{ .context.ThreadLength }} posts
 | 
					
						
							|  |  |  |         {{- end -}}
 | 
					
						
							|  |  |  |     {{- end -}}
 | 
					
						
							|  |  |  | {{- end -}}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {{- define "repliesStart" -}}
 | 
					
						
							| 
									
										
										
										
											2023-12-27 11:23:52 +01:00
										 |  |  | {{- with . }}
 | 
					
						
							| 
									
										
										
										
											2024-07-12 20:36:03 +02:00
										 |  |  | </section>
 | 
					
						
							|  |  |  | <section class="thread thread-replies" aria-labelledby="replies" open>
 | 
					
						
							| 
									
										
										
										
											2024-07-13 12:26:16 +02:00
										 |  |  |     <div class="col-header replies{{- if not .context.ThreadRepliesShown }} hidden-only{{- end -}}">
 | 
					
						
							| 
									
										
										
										
											2024-07-12 20:36:03 +02:00
										 |  |  |         <h2 id="replies">{{- template "repliesSummary" . -}}</h2>
 | 
					
						
							|  |  |  |         <a href="#thread-summary">back to top</a>
 | 
					
						
							| 
									
										
										
										
											2023-12-27 11:23:52 +01:00
										 |  |  |     </div>
 | 
					
						
							| 
									
										
										
										
											2024-07-12 20:36:03 +02:00
										 |  |  | {{- end }}
 | 
					
						
							|  |  |  | {{- end -}}
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | {{- with . }}
 | 
					
						
							|  |  |  | <main class="thread-wrapper" data-nosnippet>
 | 
					
						
							|  |  |  |     <section class="thread thread-main" aria-labelledby="thread-summary">
 | 
					
						
							|  |  |  |         <div class="col-header">
 | 
					
						
							|  |  |  |             <h2 id="thread-summary">{{- template "threadSummary" . -}}</h2>
 | 
					
						
							|  |  |  |             {{- if .context.ThreadRepliesShown }}
 | 
					
						
							|  |  |  |             <a href="#replies">jump to replies</a>
 | 
					
						
							|  |  |  |             {{- end }}
 | 
					
						
							|  |  |  |         </div>
 | 
					
						
							| 
									
										
										
										
											2024-07-13 12:26:16 +02:00
										 |  |  |         {{- range $status := .context.Statuses }}
 | 
					
						
							| 
									
										
										
										
											2024-07-12 20:36:03 +02:00
										 |  |  |         <article
 | 
					
						
							| 
									
										
										
										
											2024-07-13 12:26:16 +02:00
										 |  |  |             class="status{{- if $status.ThreadContextStatus }} expanded{{- end -}}{{- if $status.Indent }} indent-{{ $status.Indent }}{{- end -}}"
 | 
					
						
							|  |  |  |             {{- includeAttr "status_attributes.tmpl" $status | indentAttr 3 }}
 | 
					
						
							| 
									
										
										
										
											2024-07-12 20:36:03 +02:00
										 |  |  |         >
 | 
					
						
							| 
									
										
										
										
											2024-07-13 12:26:16 +02:00
										 |  |  |             {{- include "status.tmpl" $status | indent 3 }}
 | 
					
						
							| 
									
										
										
										
											2024-07-12 20:36:03 +02:00
										 |  |  |         </article>
 | 
					
						
							| 
									
										
										
										
											2024-07-13 12:26:16 +02:00
										 |  |  |         {{- if and $status.ThreadLastMain $.context.ThreadReplies }}
 | 
					
						
							| 
									
										
										
										
											2024-07-12 20:36:03 +02:00
										 |  |  |         {{- include "repliesStart" $ | indent 1 }}
 | 
					
						
							|  |  |  |         {{- end }}
 | 
					
						
							|  |  |  |         {{- end }}
 | 
					
						
							|  |  |  |     </section>
 | 
					
						
							| 
									
										
										
										
											2021-09-13 14:45:33 +02:00
										 |  |  | </main>
 | 
					
						
							| 
									
										
										
										
											2023-12-27 11:23:52 +01:00
										 |  |  | {{- end }}
 |