Skip to content
Snippets Groups Projects
Commit 3581f84d authored by Hinrikus Wolf's avatar Hinrikus Wolf
Browse files

add support for meta-button, still useless

parent df2e165a
No related branches found
No related tags found
No related merge requests found
......@@ -274,6 +274,12 @@ def statement():
def statement_new():
form = AddStatementForm()
if form.validate_on_submit():
statement = request.form.get("submit","add_statement")
if statement == "add_meta_statement":
topic = Topic.query.filter_by(id=form.topic.data).first()
return redirect(url_for(".topic_show", id=topic.id))
else:
topic = Topic.query.filter_by(id=form.topic.data).first()
speaker = speaker_by_name_or_number(form.speaker_name.data, topic.event.id)
if topic is not None and speaker is not None:
......
......@@ -3,5 +3,5 @@
{% block admin_title %}Add Statement{% endblock %}
{% block content %}
{{ render_form(form, action_url=url_for(".statement_new"), btn_list=[("","Add Statement","add_statement"), ("redl-btn-meta","Add Meta","add_meta_statement")]) }}
{{ render_form(form, action_url=url_for(".statement_new"), btn_list=[("","Add Statement","add_statement"), ("mdl-button--colored","Add Meta","add_meta_statement")]) }}
{% endblock %}
......@@ -47,7 +47,7 @@
</div>
<div class="mdl-separator rede-separator"></div>
<div class="mdl-cell mdl-cell--3-col mdl-cell--3-col-tablet mdl-cell--4-col-phone mdl-grid mdl-grid--no-spacing">
{{ render_form(form, action_url=url_for(".statement_new"), action_text="Add", title="Add Statement", class_="mdl-card mdl-shadow--2dp mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone", btn_list=[("","Add Statement","add_statement"), ("redl-btn-meta","Add Meta","add_meta_statement")] ) }}
{{ render_form(form, action_url=url_for(".statement_new"), action_text="Add", title="Add Statement", class_="mdl-card mdl-shadow--2dp mdl-cell mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone", btn_list=[("","Add Statement","add_statement"), ("mdl-button--colored","Add Meta","add_meta_statement")] ) }}
<div class="mdl-cell mdl-card mdl-shadow--2dp mdl-cell--12-col mdl-cell--8-col-tablet mdl-cell--4-col-phone">
<ul class="rede-list-no-bullet">
{% if topic.sorted_statements()|length() > 0 %}
......
......@@ -135,10 +135,10 @@
<div class="{{ action_class }}">
{% if btn_list != none %}
{%for this_btn_class, action_text, btn_value in btn_list %}
<button type="submit" class="{{ btn_class }} {{ this_btn_class }}", value="{{ btn_value }}">{{ action_text }}</button>
<button type="submit" class="{{ btn_class }} {{ this_btn_class }}" name="submit" value="{{ btn_value }}">{{ action_text }}</button>
{% endfor %}
{% else %}
<button type="submit" class="{{ btn_class }}", value="{{ btn_value }}">{{ action_text }}</button>
<button type="submit" class="{{ btn_class }}" value="{{ btn_value }}">{{ action_text }}</button>
{% endif %}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment