Modal and other tweaks
* removes WIKI_URL, replaces with HELP_LINK since it was the same before as well * refactors modal form processing (process_request()) * modal form can now display errors directly inside the modal (as intended by the devs) * modals now properly support the GET-POST workflow that is intended by the devs. More information here: https://github.com/trco/django-bootstrap-modal-forms/issues/183 * Improves label-field linking in generic_table_form_body.html * removes isDeleteForm attribute from modal_form_script.html
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
{% 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">
|
||||
<label for="id_{{ field.name }}">{{ field.label }}<span class="label-required">{% if field.field.required %}*{% endif %}</span></label>
|
||||
<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>
|
||||
{% if form.has_required_fields %}
|
||||
<small>{% trans 'Fields with * are required.' %}</small>
|
||||
{% endif %}
|
||||
<table class="table">
|
||||
<tbody>
|
||||
{% for field in form %}
|
||||
<tr title="{{ field.help_text }}" class="{% if field.errors %}alert-danger{% endif %}">
|
||||
<th scope="row" class="col-sm-3">
|
||||
<label for="id_{{ field.name }}">{{ field.label }}<span class="label-required">{% if field.field.required %}*{% endif %}</span></label>
|
||||
<small>{{ field.help_text }}</small>
|
||||
</th>
|
||||
<td class="col-sm-9">
|
||||
{{ field }}
|
||||
{% for error in field.errors %}
|
||||
<br>
|
||||
<strong class="invalid">{{ error }}</strong>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% if form.has_required_fields %}
|
||||
<small>{% trans 'Fields with * are required.' %}</small>
|
||||
{% endif %}
|
||||
@@ -5,7 +5,7 @@
|
||||
{% endcomment %}
|
||||
|
||||
|
||||
<form method="post" action="{{form.action_url}}" {% for attr_key, attr_val in form.form_attrs.items %} {{attr_key}}="{{attr_val}}"{% endfor %}>
|
||||
<form method="post" action="" {% for attr_key, attr_val in form.form_attrs.items %} {{attr_key}}="{{attr_val}}"{% endfor %}>
|
||||
{% csrf_token %}
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{{form.form_title}}</h5>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
$(".{{btn_class}}").each(function () {
|
||||
$(this).modalForm({
|
||||
formURL: $(this).data("form-url"),
|
||||
isDeleteForm: {{modal_reload_page}},
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user