diff --git a/templates/macros.html b/templates/macros.html index ca64d1fc627763d59d9d05476f01de21c1cc4046..f3ac249720eb8aa5c1a96866ac08dae5d47ab62a 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -87,7 +87,7 @@ to not render a label for the CRSFTokenField --> action_text - text of submit button class_ - sets a class for form #} -{% macro render_form(form, action_url='', action_text='Submit', class_='', btn_class='btn btn-default', enctype=None, labels_visible=True, method="POST") -%} +{% macro render_form(form, action_url='', action_text='Submit', class_='', btn_class='btn btn-default', enctype=None, labels_visible=True, method="POST", textarea_rows=5) -%} <form method="{{method}}" action="{{ action_url }}" role="form" class="{{ class_ }}"{% if enctype is not none %}enctype="{{enctype}}"{% endif %}> {#{{ form.hidden_tag() if form.hidden_tag }}#} @@ -99,6 +99,8 @@ to not render a label for the CRSFTokenField --> {{ render_checkbox_field(f) }} {% elif f.type == 'RadioField' %} {{ render_radio_field(f) }} + {% elif f.type == 'TextAreaField' %} + {{ render_field(f, label_visible=labels_visible, rows=textarea_rows) }} {% else %} {{ render_field(f, label_visible=labels_visible) }} {% endif %} diff --git a/templates/top-edit.html b/templates/top-edit.html index 31e56b9afd9ffc1435d9f52bd0a523fdd4932da8..07d56be8f257d106a9e9da490a3e2a266a5286a3 100644 --- a/templates/top-edit.html +++ b/templates/top-edit.html @@ -4,6 +4,6 @@ {% block content %} <div class="container"> - {{render_form(form, action_url=url_for("edit_top", top_id=top.id, next=request.args.get("next") or url_for("show_protocol", protocol_id=top.protocol.id)), action_text="Ändern")}} + {{render_form(form, action_url=url_for("edit_top", top_id=top.id, next=request.args.get("next") or url_for("show_protocol", protocol_id=top.protocol.id)), action_text="Ändern", textarea_rows=5)}} </div> {% endblock %} diff --git a/templates/top-new.html b/templates/top-new.html index 516ca1aef1e2e06701313990192bed61d25c2cdf..249b61ef10eca8fa2f31fd2d19d10104d38f6ab2 100644 --- a/templates/top-new.html +++ b/templates/top-new.html @@ -18,7 +18,7 @@ </div> <div id="right-column" class="col-lg-6"> <h3>TOP hinzufügen</h3> - {{render_form(form, action_url=url_for("new_top", protocol_id=protocol.id, next=url_for("show_protocol", protocol_id=protocol.id)), action_text="Anlegen")}} + {{render_form(form, action_url=url_for("new_top", protocol_id=protocol.id, next=url_for("show_protocol", protocol_id=protocol.id)), action_text="Anlegen", textarea_rows=5)}} </div> </div> </div>