rename over18 and over-18 to nsfw

master
Aevann 2023-10-05 13:15:05 +03:00
parent 978399ff10
commit aeb9e669d4
4 changed files with 9 additions and 9 deletions

View File

@ -5,7 +5,7 @@ function approve_emoji(t, name) {
"tags": document.getElementById(`${name}-tags`).value,
"name": document.getElementById(`${name}-name`).value,
"kind": document.getElementById(`${name}-kind`).value,
"over_18": document.getElementById(`${name}-over-18`).checked,
"over_18": document.getElementById(`${name}-nsfw`).checked,
},
() => {
document.getElementById(`${name}-emoji`).remove()

View File

@ -15,7 +15,7 @@ search_operator_hole = HOLE_NAME
valid_params = [
'author',
'domain',
'over18',
'nsfw',
'post',
'before',
'after',
@ -112,7 +112,7 @@ def searchposts(v):
) for x in criteria['q']]
posts = posts.filter(*words)
if 'over18' in criteria: posts = posts.filter(Post.over_18==True)
if 'nsfw' in criteria: posts = posts.filter(Post.over_18==True)
if 'domain' in criteria:
domain = criteria['domain']
@ -236,7 +236,7 @@ def searchcomments(v):
' & '.join(tokens),
postgresql_regconfig='english'))
if 'over18' in criteria: comments = comments.filter(Comment.over_18 == True)
if 'nsfw' in criteria: comments = comments.filter(Comment.over_18 == True)
if search_operator_hole in criteria:
comments = comments.filter(Post.sub == criteria[search_operator_hole])

View File

@ -85,7 +85,7 @@
{% if FEATURES['NSFW_MARKING'] %}
<div>
<div style="display: inline-block; width: 150px; text-align: center">NSFW Only:</div>
<button type="button" data-nonce="{{g.nonce}}" data-onclick="addParam(this, 'bool')" class="searchparam mb-1">over18:true</button>
<button type="button" data-nonce="{{g.nonce}}" data-onclick="addParam(this, 'bool')" class="searchparam mb-1">nsfw:true</button>
</div>
{% endif %}
{% endif %}

View File

@ -45,8 +45,8 @@
{% if FEATURES['NSFW_MARKING'] %}
<div class="custom-control custom-checkbox mt-4">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="emoji-over-18" name="over_18">
<label class="custom-control-label" for="emoji-over-18">NSFW</label>
<input autocomplete="off" type="checkbox" class="custom-control-input" id="emoji-nsfw" name="over_18">
<label class="custom-control-label" for="emoji-nsfw">NSFW</label>
</div>
{% endif %}
@ -101,8 +101,8 @@
{% if FEATURES['NSFW_MARKING'] %}
<div class="custom-control custom-checkbox mt-4">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="{{emoji.name}}-over-18" name="over_18" {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}readonly{% endif %} {% if emoji.over_18 %}checked{% endif %}>
<label class="custom-control-label" for="{{emoji.name}}-over-18">NSFW</label>
<input autocomplete="off" type="checkbox" class="custom-control-input" id="{{emoji.name}}-nsfw" name="over_18" {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}readonly{% endif %} {% if emoji.over_18 %}checked{% endif %}>
<label class="custom-control-label" for="{{emoji.name}}-nsfw">NSFW</label>
</div>
{% endif %}
</div>