Add a site setting for the post filtering feature
This commit is contained in:
parent
e3ed57a29e
commit
68b10ff3f8
3 changed files with 7 additions and 2 deletions
|
@ -969,7 +969,7 @@ def submit_post(v, sub=None):
|
||||||
title_html=title_html,
|
title_html=title_html,
|
||||||
sub=sub,
|
sub=sub,
|
||||||
ghost=False,
|
ghost=False,
|
||||||
filter_state='filtered' if v.admin_level == 0 else 'normal'
|
filter_state='filtered' if v.admin_level == 0 and app.config['SETTINGS']['FilterNewPosts'] else 'normal'
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
|
|
|
@ -72,6 +72,11 @@
|
||||||
<label class="custom-control-label" for="Fart mode">Fart mode</label>
|
<label class="custom-control-label" for="Fart mode">Fart mode</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="custom-control custom-switch">
|
||||||
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="FilterNewPosts" {% if site_settings['FilterNewPosts'] %}checked{% endif %} onchange="post_toast(this,'/admin/site_settings/FilterNewPosts');">
|
||||||
|
<label class="custom-control-label" for="FilterNewPosts">Filter New Posts</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="custom-control custom-switch">
|
<div class="custom-control custom-switch">
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="Read-only mode" {% if site_settings['Read-only mode'] %}checked{% endif %} onchange="post_toast(this,'/admin/site_settings/Read-only mode');">
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="Read-only mode" {% if site_settings['Read-only mode'] %}checked{% endif %} onchange="post_toast(this,'/admin/site_settings/Read-only mode');">
|
||||||
<label class="custom-control-label" for="Read-only mode">Read-only mode</label>
|
<label class="custom-control-label" for="Read-only mode">Read-only mode</label>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"Bots": true, "Fart mode": false, "Read-only mode": false, "Signups": true}
|
{"Bots": true, "Fart mode": false, "Read-only mode": false, "Signups": true, "FilterNewPosts": false}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue