diff options
author | FChannel <> | 2021-06-19 19:04:43 -0700 |
---|---|---|
committer | FChannel <> | 2021-06-19 19:04:43 -0700 |
commit | b4f7d00ad9d13f96323366ded2eb7702e37f6e52 (patch) | |
tree | 8a62817f7d1f70131533c2ab96f91270e0ad64db /static/ncatalog.html | |
parent | 6b265b0a8c2e45422f4a4601e041d44e5cef1c1b (diff) |
admin can mark objects as senstive
Diffstat (limited to 'static/ncatalog.html')
-rw-r--r-- | static/ncatalog.html | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/static/ncatalog.html b/static/ncatalog.html index 027a938..deb8e27 100644 --- a/static/ncatalog.html +++ b/static/ncatalog.html @@ -33,15 +33,31 @@ {{ if .Attachment }} {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} <a href="/deleteattach?id={{ .Id }}&board={{ $board.Actor.Name }}">[Delete Attachment]</a> + <a href="/marksensitive?id={{ .Id }}&board={{ $board.Actor.Name }}">[Mark Sensitive]</a> {{ end }} - <a id="{{ .Id }}-anchor" href="/{{ $board.Name }}/"> + + {{ if and .Sensitive $board.Actor.Restricted }} + <div id="hide-{{ .Id }}" style="display: none;">[Hide]</div> + <div id="sensitive-{{ .Id }}" style="display: none;"><div style="position: relative; text-align: center;"><img style="float: left; margin-right: 10px; margin-bottom: 10px; max-width: 180px; max-height: 180px;" src="/static/sensitive.png"><div style="width: 170px; position: absolute; margin-top: 75px; padding: 5px; background-color: black; color: white; cursor: default; ">NSFW Content</div></div></div> + {{ end }} + <a id="{{ .Id }}-anchor" href="/{{ $board.Name }}/"> <div id="media-{{ .Id }}" style="width:180px;"></div> </a> <script> media = document.getElementById("media-{{ .Id }}") + + if({{ .Sensitive }} && {{ $board.Actor.Restricted }}){ + sensitive = document.getElementById("sensitive-{{ .Id }}") + hide = document.getElementById("hide-{{ .Id }}") + sensitive.onclick = function(){document.getElementById("media-{{ .Id }}").style="display: block;"; document.getElementById("sensitive-{{ .Id }}").style="display: none;"; document.getElementById("hide-{{ .Id }}").style="display: block; cursor: pointer;"} + hide.onclick = function(){document.getElementById("media-{{ .Id }}").style="display: none;"; document.getElementById("sensitive-{{ .Id }}").style="display: block;"; document.getElementById("hide-{{ .Id }}").style="display: none;"} + sensitive.style = "display: block" + media.style = "display: none;" + } + if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "image"){ var img = document.createElement("img"); - img.style = "max-width: 180px; max-height: 180px; cursor: move;" + img.style = "max-width: 180px; max-height: 180px;" img.setAttribute("id", "img") img.setAttribute("main", "1") img.setAttribute("src", "{{ (index .Attachment 0).Href }}") |