forked from rDrama/rDrama
1
0
Fork 0

add cc post search parameter

master
Aevann1 2022-11-07 02:22:06 +02:00
parent fbddf3e59c
commit 87cf4d13ff
2 changed files with 12 additions and 0 deletions

View File

@ -18,6 +18,7 @@ valid_params = [
'before',
'after',
'title',
'cc',
search_operator_hole,
]
@ -140,6 +141,13 @@ def searchposts(v):
except: abort(400)
posts = posts.filter(Submission.created_utc < before)
if 'cc' in criteria:
cc = criteria['cc'].lower().strip()
if cc == 'true': cc = True
elif cc == 'false': cc = False
else: abort(400)
posts = posts.filter(Submission.club == cc)
posts = apply_time_filter(t, posts, Submission)
posts = sort_objects(sort, posts, Submission,

View File

@ -75,6 +75,10 @@
<div style="display: inline-block; width: 150px; text-align: center;">Post Title Only:</div>
<button type="button" onClick="addParam()" class="searchparam mb-1">title:true</button>
</div>
<div>
<div style="display: inline-block; width: 150px; text-align: center;">Country Club:</div>
<button type="button" onClick="addParam()" class="searchparam mb-1">cc:true</button>
</div>
{% endif %}
</div>
</div>