Updates generic_table_form.html

* updates generic template
This commit is contained in:
mipel 2021-07-09 07:46:20 +02:00
parent 903a22973f
commit 50d98b2a83
2 changed files with 14 additions and 13 deletions

View File

@ -5,44 +5,44 @@
{% endblock %}
{% block body %}
<div class="table-container">
<div class="container">
<h4>
{{ form.form_title }}
</h4>
{% if form.form_caption is not None %}
<div>
<small>
{{ form.form_caption }}
</div>
</small>
{% endif %}
<form method="post" action="{{ form.action_url }}">
{% csrf_token %}
<table>
<table class="table">
<tbody>
{% for field in form %}
<tr title="{{ field.help_text }}" class="{% if field.errors %}error{% endif %}">
<th scope="row" class="small-3">
<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="small-12">
<td class="col-sm-9">
{{ field }}
{% for error in field.errors %}
<b>{{ error }}</b>
<strong>{{ error }}</strong>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="label-required">{% trans 'Fields with * are required.' %}</div>
<small>{% trans 'Fields with * are required.' %}</small>
<div class="row">
<div class="large-1 columns">
<div class="col-md">
<a href="{{ form.cancel_redirect }}">
<button class="button small append-value" type="button" title="{% trans 'Cancel' %}">{% trans 'Cancel' %}</button>
<button class="btn btn-default" type="button" title="{% trans 'Cancel' %}">{% trans 'Cancel' %}</button>
</a>
</div>
<div class="large-10 columns">
<button class="button small append-value right" type="submit" title="{% trans 'Save' %}">{% trans 'Save' %}</button>
<div class="col-md d-flex justify-content-end">
<button class="btn btn-default" type="submit" title="{% trans 'Save' %}">{% trans 'Save' %}</button>
</div>
</div>
</form>

View File

@ -25,7 +25,7 @@ class UserNotificationForm(BaseForm):
help_text=_("Select the situations when you want to receive a notification"),
widget=forms.CheckboxSelectMultiple(
attrs={
"class": "no-bullets",
"class": "list-unstyled",
}
),
choices=[]
@ -35,6 +35,7 @@ class UserNotificationForm(BaseForm):
super().__init__(*args, **kwargs)
self.user = user
self.form_title = _("Edit notifications")
self.form_caption = _("")
self.action_url = reverse("user:notifications")
self.cancel_redirect = reverse("user:index")