Updates generic_table_form.html
* updates generic template
This commit is contained in:
parent
1ced6fdadd
commit
befffbde15
@ -5,44 +5,44 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="table-container">
|
<div class="container">
|
||||||
<h4>
|
<h4>
|
||||||
{{ form.form_title }}
|
{{ form.form_title }}
|
||||||
</h4>
|
</h4>
|
||||||
{% if form.form_caption is not None %}
|
{% if form.form_caption is not None %}
|
||||||
<div>
|
<small>
|
||||||
{{ form.form_caption }}
|
{{ form.form_caption }}
|
||||||
</div>
|
</small>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<form method="post" action="{{ form.action_url }}">
|
<form method="post" action="{{ form.action_url }}">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<table>
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for field in form %}
|
{% for field in form %}
|
||||||
<tr title="{{ field.help_text }}" class="{% if field.errors %}error{% endif %}">
|
<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>
|
<div>{{ field.label }}<span class="label-required">{% if field.field.required %}*{% endif %}</span></div>
|
||||||
<small>{{ field.help_text }}</small>
|
<small>{{ field.help_text }}</small>
|
||||||
</th>
|
</th>
|
||||||
<td class="small-12">
|
<td class="col-sm-9">
|
||||||
{{ field }}
|
{{ field }}
|
||||||
{% for error in field.errors %}
|
{% for error in field.errors %}
|
||||||
<b>{{ error }}</b>
|
<strong>{{ error }}</strong>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="label-required">{% trans 'Fields with * are required.' %}</div>
|
<small>{% trans 'Fields with * are required.' %}</small>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-1 columns">
|
<div class="col-md">
|
||||||
<a href="{{ form.cancel_redirect }}">
|
<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>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-10 columns">
|
<div class="col-md d-flex justify-content-end">
|
||||||
<button class="button small append-value right" type="submit" title="{% trans 'Save' %}">{% trans 'Save' %}</button>
|
<button class="btn btn-default" type="submit" title="{% trans 'Save' %}">{% trans 'Save' %}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -25,7 +25,7 @@ class UserNotificationForm(BaseForm):
|
|||||||
help_text=_("Select the situations when you want to receive a notification"),
|
help_text=_("Select the situations when you want to receive a notification"),
|
||||||
widget=forms.CheckboxSelectMultiple(
|
widget=forms.CheckboxSelectMultiple(
|
||||||
attrs={
|
attrs={
|
||||||
"class": "no-bullets",
|
"class": "list-unstyled",
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
choices=[]
|
choices=[]
|
||||||
@ -35,6 +35,7 @@ class UserNotificationForm(BaseForm):
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
self.user = user
|
self.user = user
|
||||||
self.form_title = _("Edit notifications")
|
self.form_title = _("Edit notifications")
|
||||||
|
self.form_caption = _("")
|
||||||
self.action_url = reverse("user:notifications")
|
self.action_url = reverse("user:notifications")
|
||||||
self.cancel_redirect = reverse("user:index")
|
self.cancel_redirect = reverse("user:index")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user