Skip to content
Snippets Groups Projects
Commit 481dcd7d authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Set a useful default textarea height

parent d76e69bf
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,7 @@ to not render a label for the CRSFTokenField --> ...@@ -87,7 +87,7 @@ to not render a label for the CRSFTokenField -->
action_text - text of submit button action_text - text of submit button
class_ - sets a class for form 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 method="{{method}}" action="{{ action_url }}" role="form" class="{{ class_ }}"{% if enctype is not none %}enctype="{{enctype}}"{% endif %}>
{#{{ form.hidden_tag() if form.hidden_tag }}#} {#{{ form.hidden_tag() if form.hidden_tag }}#}
...@@ -99,6 +99,8 @@ to not render a label for the CRSFTokenField --> ...@@ -99,6 +99,8 @@ to not render a label for the CRSFTokenField -->
{{ render_checkbox_field(f) }} {{ render_checkbox_field(f) }}
{% elif f.type == 'RadioField' %} {% elif f.type == 'RadioField' %}
{{ render_radio_field(f) }} {{ render_radio_field(f) }}
{% elif f.type == 'TextAreaField' %}
{{ render_field(f, label_visible=labels_visible, rows=textarea_rows) }}
{% else %} {% else %}
{{ render_field(f, label_visible=labels_visible) }} {{ render_field(f, label_visible=labels_visible) }}
{% endif %} {% endif %}
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
{% block content %} {% block content %}
<div class="container"> <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> </div>
{% endblock %} {% endblock %}
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</div> </div>
<div id="right-column" class="col-lg-6"> <div id="right-column" class="col-lg-6">
<h3>TOP hinzufügen</h3> <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> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment