Add option to mask nsfw attachments

This commit is contained in:
r 2019-12-31 11:00:21 +00:00
parent 9e556721c5
commit 1aff0569bf
6 changed files with 32 additions and 6 deletions

View file

@ -20,6 +20,10 @@
<input id="thread-tab" name="thread_in_new_tab" type="checkbox" value="true" {{if .Settings.ThreadInNewTab}}checked{{end}}>
<label for="thread-tab"> Open threads in new tab from timeline </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>
<button type="submit"> Save </button>
</form>

View file

@ -61,7 +61,7 @@
{{if eq .Type "image"}}
<a class="img-link" href="{{.URL}}" target="_blank">
<img class="status-image" src="{{.URL}}" alt="status-image" />
{{if $.Sensitive}}
{{if (and $.MaskNSFW $.Sensitive)}}
<div class="status-nsfw-overlay"></div>
{{end}}
</a>
@ -76,7 +76,7 @@
<source src="{{.URL}}">
<p> Your browser doesn't support HTML5 video </p>
</video>
{{if $.Sensitive}}
{{if (and $.MaskNSFW $.Sensitive)}}
<div class="status-nsfw-overlay"></div>
{{end}}
</div>