forked from MarseyWorld/MarseyWorld
allow ppl to avoid effortposts and nsfw
parent
76587eeb33
commit
cf2f91df64
|
@ -111,8 +111,13 @@ def searchposts(v):
|
|||
) for x in criteria['q']]
|
||||
posts = posts.filter(*words)
|
||||
|
||||
if 'nsfw' in criteria: posts = posts.filter(Post.nsfw==True)
|
||||
if 'effortpost' in criteria: posts = posts.filter(Post.effortpost==True)
|
||||
if 'nsfw' in criteria:
|
||||
nsfw = criteria['nsfw'].lower().strip() == 'true'
|
||||
posts = posts.filter_by(nsfw=nsfw)
|
||||
|
||||
if 'effortpost' in criteria:
|
||||
effortpost = criteria['effortpost'].lower().strip() == 'true'
|
||||
posts = posts.filter_by(effortpost=effortpost)
|
||||
|
||||
if 'domain' in criteria:
|
||||
domain = criteria['domain']
|
||||
|
|
|
@ -86,13 +86,13 @@
|
|||
{% endif %}
|
||||
{% if FEATURES['NSFW_MARKING'] %}
|
||||
<div>
|
||||
<div style="display: inline-block; width: 150px; text-align: center">NSFW Only:</div>
|
||||
<div style="display: inline-block; width: 150px; text-align: center">NSFW:</div>
|
||||
<button type="button" data-nonce="{{g.nonce}}" data-onclick="addParam(this, 'bool')" class="searchparam mb-1">nsfw:true</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if request.path.startswith('/search/posts') %}
|
||||
<div>
|
||||
<div style="display: inline-block; width: 150px; text-align: center">Effortposts Only:</div>
|
||||
<div style="display: inline-block; width: 150px; text-align: center">Effortpost:</div>
|
||||
<button type="button" data-nonce="{{g.nonce}}" data-onclick="addParam(this, 'bool')" class="searchparam mb-1">effortpost:true</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue