diff --git a/templates/admin_statement_new.html b/templates/admin_statement_new.html index 5510387be675765f396714ad1222bc589c0aaae0..855059613c05f5d68fbe884426edf2d309d5ef14 100644 --- a/templates/admin_statement_new.html +++ b/templates/admin_statement_new.html @@ -3,5 +3,5 @@ {% block admin_title %}Add Statement{% endblock %} {% block content %} - {{ render_form(form, action_url=url_for(".statement_new"), action_text="Add", title="Add Statement") }} + {{ render_form(form, action_url=url_for(".statement_new"), btn_list=[("","Add Statement","add_statement"), ("redl-btn-meta","Add Meta","add_meta_statement")]) }} {% endblock %} diff --git a/templates/admin_topic_show.html b/templates/admin_topic_show.html index c18889648d820e7a220545a9822f8e8cf11711b0..d6ef4c792c4737b9f9318c4b02a9af2d205684de 100644 --- a/templates/admin_topic_show.html +++ b/templates/admin_topic_show.html @@ -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") }} + {{ 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")] ) }} <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 %} diff --git a/templates/macros.html b/templates/macros.html index 3150025bde0efe16d9948b9e1e1f209a9af7c794..655263b97dc268b85b6dcbfd138789a9e9b29f3c 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -104,7 +104,7 @@ {%- endmacro %} -{% macro render_form(form, action_url="", title=None, action_text="Submit", class_="mdl-card mdl-shadow--2dp mdl-cell mdl-cell--4-col mdl-cell--4-col-tablet mdl-cell--4-col-phone", title_class="mdl-card__title", title_text_class="mdl-card__title-text", content_class="mdl-card__supporting-text", action_class="mdl-card__actions", btn_class="mdl-button mdl-js-button mdl-button--raised mdl-button-colored") -%} +{% macro render_form(form, action_url="", title=None, action_text="Submit", class_="mdl-card mdl-shadow--2dp mdl-cell mdl-cell--4-col mdl-cell--4-col-tablet mdl-cell--4-col-phone", title_class="mdl-card__title", title_text_class="mdl-card__title-text", content_class="mdl-card__supporting-text", action_class="mdl-card__actions", btn_class="mdl-button mdl-js-button mdl-button--raised mdl-button-colored", btn_value="", btn_list=None) -%} <div class="{{ class_ }}"> <form method="POST" action="{{ action_url }}"> <div class="{{ title_class }}"> @@ -133,8 +133,16 @@ {% endfor %} </div> <div class="{{ action_class }}"> - <button type="submit" class="{{ btn_class }}">{{ action_text }}</button> + {% 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> + {% endfor %} + {% else %} + <button type="submit" class="{{ btn_class }}", value="{{ btn_value }}">{{ action_text }}</button> + {% endif %} + </div> </form> </div> {%- endmacro %} +