diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/settings.tmpl | 4 | ||||
-rw-r--r-- | templates/status.tmpl | 23 |
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}} |