Payments add modal form
* adds modal form for adding payments * generalizes generic_table_form.html for table-form-like usage in modal_form.html * adds css enhancements for focused input fields * adds BaseModalForm as specification to BaseForm, which inherits the BSModalForm class as well * adds translations
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<!--
|
||||
<article class="mb-5">{{form.form_caption}}</article>
|
||||
{% for field in form %}
|
||||
<div class="form-group{% if field.errors %} invalid{% endif %}">
|
||||
@@ -25,6 +26,8 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
-->
|
||||
{% include 'table/generic_table_form_body.html' %}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-default">{% trans 'Continue' %}</button>
|
||||
|
||||
@@ -16,25 +16,7 @@
|
||||
{% endif %}
|
||||
<form method="post" action="{{ form.action_url }}">
|
||||
{% csrf_token %}
|
||||
<table class="table">
|
||||
<tbody>
|
||||
{% for field in form %}
|
||||
<tr title="{{ field.help_text }}" class="{% if field.errors %}error{% endif %}">
|
||||
<th scope="row" class="col-sm-3">
|
||||
<div>{{ field.label }}<span class="label-required">{% if field.field.required %}*{% endif %}</span></div>
|
||||
<small>{{ field.help_text }}</small>
|
||||
</th>
|
||||
<td class="col-sm-9">
|
||||
{{ field }}
|
||||
{% for error in field.errors %}
|
||||
<strong>{{ error }}</strong>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<small>{% trans 'Fields with * are required.' %}</small>
|
||||
{% include 'table/generic_table_form_body.html' %}
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<a href="{{ form.cancel_redirect }}">
|
||||
20
templates/table/generic_table_form_body.html
Normal file
20
templates/table/generic_table_form_body.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{% load i18n %}
|
||||
<table class="table">
|
||||
<tbody>
|
||||
{% for field in form %}
|
||||
<tr title="{{ field.help_text }}" class="{% if field.errors %}error{% endif %}">
|
||||
<th scope="row" class="col-sm-3">
|
||||
<div>{{ field.label }}<span class="label-required">{% if field.field.required %}*{% endif %}</span></div>
|
||||
<small>{{ field.help_text }}</small>
|
||||
</th>
|
||||
<td class="col-sm-9">
|
||||
{{ field }}
|
||||
{% for error in field.errors %}
|
||||
<strong>{{ error }}</strong>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<small>{% trans 'Fields with * are required.' %}</small>
|
||||
Reference in New Issue
Block a user