forked from rDrama/rDrama
add cc post search parameter
parent
fbddf3e59c
commit
87cf4d13ff
|
@ -18,6 +18,7 @@ valid_params = [
|
||||||
'before',
|
'before',
|
||||||
'after',
|
'after',
|
||||||
'title',
|
'title',
|
||||||
|
'cc',
|
||||||
search_operator_hole,
|
search_operator_hole,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -140,6 +141,13 @@ def searchposts(v):
|
||||||
except: abort(400)
|
except: abort(400)
|
||||||
posts = posts.filter(Submission.created_utc < before)
|
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 = apply_time_filter(t, posts, Submission)
|
||||||
|
|
||||||
posts = sort_objects(sort, posts, Submission,
|
posts = sort_objects(sort, posts, Submission,
|
||||||
|
|
|
@ -75,6 +75,10 @@
|
||||||
<div style="display: inline-block; width: 150px; text-align: center;">Post Title Only:</div>
|
<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>
|
<button type="button" onClick="addParam()" class="searchparam mb-1">title:true</button>
|
||||||
</div>
|
</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 %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue