NSFW content in spoiler

This commit is contained in:
localhost_frssoft 2023-11-05 17:46:14 +03:00
parent e99b6aa5f2
commit 306b0fe3b3
2 changed files with 5 additions and 0 deletions

1
README
View file

@ -12,6 +12,7 @@ Changes (localhost_custom fork):
- visible edited post time - visible edited post time
- visible quoted post (status in status) - visible quoted post (status in status)
- hide boosts in spoiler - hide boosts in spoiler
- hide NSFW content and attachments in spoiler
- some micro visual changes - some micro visual changes
- some others changes no matter - some others changes no matter

View file

@ -105,6 +105,7 @@
<div class="status-content"> <div class="status-content">
{{if .Sensitive}}[NSFW]<br/>{{end}} {{if .Sensitive}}[NSFW]<br/>{{end}}
{{- if .SpoilerText}}{{EmojiFilter (HTML .SpoilerText) .Emojis | Raw}}<br/>{{end -}} {{- if .SpoilerText}}{{EmojiFilter (HTML .SpoilerText) .Emojis | Raw}}<br/>{{end -}}
{{if .Sensitive}}<details>{{end}}
{{- StatusContentFilter .Content .Emojis .Mentions | Raw -}} {{- StatusContentFilter .Content .Emojis .Mentions | Raw -}}
{{if .Pleroma.Quote}} {{if .Pleroma.Quote}}
<details> <details>
@ -112,6 +113,7 @@
{{template "status" (WithContext .Pleroma.Quote $.Ctx)}} {{template "status" (WithContext .Pleroma.Quote $.Ctx)}}
</details> </details>
{{end}} {{end}}
{{if .Sensitive}}</details>{{end}}
</div> </div>
{{end}} {{end}}
{{$st_id := .ID}} {{$st_id := .ID}}
@ -132,6 +134,7 @@
</div> </div>
{{end}} {{end}}
{{if .MediaAttachments}} {{if .MediaAttachments}}
{{if .Sensitive}}<details><summary>NSFW attachments</summary>{{end}}
<div class="status-media-container"> <div class="status-media-container">
{{range .MediaAttachments}} {{range .MediaAttachments}}
@ -185,6 +188,7 @@
{{end}} {{end}}
{{end}} {{end}}
</div> </div>
{{if .Sensitive}}</details>{{end}}
{{end}} {{end}}
{{if .Poll}} {{if .Poll}}
<form class="poll-form" action="/vote/{{.Poll.ID}}" method="POST" target="_self"> <form class="poll-form" action="/vote/{{.Poll.ID}}" method="POST" target="_self">