Respect lexicon post enable setting
This commit is contained in:
parent
f88ee3a526
commit
d172848231
|
@ -10,6 +10,7 @@
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
{% if current_lexicon.allow_post %}
|
||||||
<section>
|
<section>
|
||||||
<form action="" method="post" novalidate>
|
<form action="" method="post" novalidate>
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
|
@ -17,7 +18,7 @@
|
||||||
<p>{{ form.submit() }}</p>
|
<p>{{ form.submit() }}</p>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
{% endif %}
|
||||||
{% for post in new_posts %}
|
{% for post in new_posts %}
|
||||||
{{ make_post(post, True) }}
|
{{ make_post(post, True) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -89,6 +89,7 @@ def setup(lexicon_name):
|
||||||
form.turn_count.data = lexicon.turn_count
|
form.turn_count.data = lexicon.turn_count
|
||||||
form.player_limit.data = lexicon.player_limit
|
form.player_limit.data = lexicon.player_limit
|
||||||
form.character_limit.data = lexicon.character_limit
|
form.character_limit.data = lexicon.character_limit
|
||||||
|
form.allow_post.data = lexicon.allow_post
|
||||||
return render_template(
|
return render_template(
|
||||||
"settings.jinja",
|
"settings.jinja",
|
||||||
lexicon_name=lexicon_name,
|
lexicon_name=lexicon_name,
|
||||||
|
@ -109,6 +110,7 @@ def setup(lexicon_name):
|
||||||
lexicon.turn_count = form.turn_count.data
|
lexicon.turn_count = form.turn_count.data
|
||||||
lexicon.player_limit = form.player_limit.data
|
lexicon.player_limit = form.player_limit.data
|
||||||
lexicon.character_limit = form.character_limit.data
|
lexicon.character_limit = form.character_limit.data
|
||||||
|
lexicon.allow_post = form.allow_post.data
|
||||||
g.db.session.commit() # TODO refactor into backend
|
g.db.session.commit() # TODO refactor into backend
|
||||||
flash("Settings saved")
|
flash("Settings saved")
|
||||||
return redirect(
|
return redirect(
|
||||||
|
|
|
@ -49,6 +49,7 @@ class SetupSettingsForm(FlaskForm):
|
||||||
widget=NumberInput(),
|
widget=NumberInput(),
|
||||||
validators=[Optional()],
|
validators=[Optional()],
|
||||||
)
|
)
|
||||||
|
allow_post = BooleanField("Allow players to make posts")
|
||||||
submit = SubmitField("Submit")
|
submit = SubmitField("Submit")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,7 @@
|
||||||
<p>
|
<p>
|
||||||
{{ number_setting(form.character_limit) }}
|
{{ number_setting(form.character_limit) }}
|
||||||
</p>
|
</p>
|
||||||
|
<p>{{ flag_setting(form.allow_post) }}</p>
|
||||||
<p>{{ form.submit() }}</p>
|
<p>{{ form.submit() }}</p>
|
||||||
</form>
|
</form>
|
||||||
{% for message in get_flashed_messages() %}
|
{% for message in get_flashed_messages() %}
|
||||||
|
|
Loading…
Reference in New Issue