aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2020-04-25 09:35:18 +0000
committerr <r@freesoftwareextremist.com>2020-04-25 09:35:18 +0000
commitf380371654dd81b258e5f37e50ffcf3764f117c1 (patch)
treeedfa323e84ea3264a7a0cf7ba4a3ee58895cbcf0 /templates
parent1e750f89b156c601fa5cfbda21e8c4b46be85b18 (diff)
downloadbloat-f380371654dd81b258e5f37e50ffcf3764f117c1.tar.gz
bloat-f380371654dd81b258e5f37e50ffcf3764f117c1.zip
Add option to hide attachments
Diffstat (limited to 'templates')
-rw-r--r--templates/settings.tmpl4
-rw-r--r--templates/status.tmpl23
2 files changed, 24 insertions, 3 deletions
diff --git a/templates/settings.tmpl b/templates/settings.tmpl
index 2773deb..d0710c3 100644
--- a/templates/settings.tmpl
+++ b/templates/settings.tmpl
@@ -22,6 +22,10 @@
<label for="thread-tab"> Open threads in new tab from timeline </label>
</div>
<div class="settings-form-field">
+ <input id="hide-attachments" name="hide_attachments" type="checkbox" value="true" {{if .Settings.HideAttachments}}checked{{end}}>
+ <label for="hide-attachments"> Hide attachments </label>
+ </div>
+ <div class="settings-form-field">
<input id="mask-nsfw" name="mask_nsfw" type="checkbox" value="true" {{if .Settings.MaskNSFW}}checked{{end}}>
<label for="mask-nsfw"> Mask NSFW attachments </label>
</div>
diff --git a/templates/status.tmpl b/templates/status.tmpl
index ade9d25..6433b9c 100644
--- a/templates/status.tmpl
+++ b/templates/status.tmpl
@@ -75,31 +75,48 @@
{{end}}
<div class="status-media-container">
{{range .MediaAttachments}}
+
{{if eq .Type "image"}}
+ {{if $.Ctx.HideAttachments}}
+ <a href="{{.URL}}" target="_blank"> [image] </a>
+ {{else}}
<a class="img-link" href="{{.URL}}" target="_blank">
<img class="status-image" src="{{.URL}}" alt="status-image" />
{{if (and $.Ctx.MaskNSFW $s.Sensitive)}}
<div class="status-nsfw-overlay"></div>
{{end}}
</a>
+ {{end}}
+
{{else if eq .Type "audio"}}
+ {{if $.Ctx.HideAttachments}}
+ <a href="{{.URL}}" target="_blank"> [audio] </a>
+ {{else}}
<audio class="status-audio" controls preload="none">
<source src="{{.URL}}">
- <p> Your browser doesn't support HTML5 audio </p>
+ <a href="{{.URL}}" target="_blank"> [audio] </a>
</audio>
+ {{end}}
+
{{else if eq .Type "video"}}
+ {{if $.Ctx.HideAttachments}}
+ <a href="{{.URL}}" target="_blank"> [video] </a>
+ {{else}}
<div class="status-video-container">
<video class="status-video" controls preload="none">
<source src="{{.URL}}">
- <p> Your browser doesn't support HTML5 video </p>
+ <a href="{{.URL}}" target="_blank"> [video] </a>
</video>
{{if (and $.Ctx.MaskNSFW $s.Sensitive)}}
<div class="status-nsfw-overlay"></div>
{{end}}
</div>
+ {{end}}
+
{{else}}
- <a href="{{.URL}}" target="_blank"> attachment </a>
+ <a href="{{.URL}}" target="_blank"> [attachment] </a>
{{end}}
+
{{end}}
</div>
{{if .Poll}}