Browse Source

style(association): modifie le layout_template de CreateForm

pull/178/head
Raphael 1 year ago
parent
commit
65517fadeb
  1. 12
      assets/scss/components/_forms.scss
  2. 3
      benevalibre/association/forms.py
  3. 18
      benevalibre/templates/association/forms/layouts/association_informations_form.html

12
assets/scss/components/_forms.scss

@ -60,3 +60,15 @@
.input-group .search-input {
border-color: $white;
}
// Make the research intended fields stand out from the others
// Only association creation or update forms are concerned
.research-data-fieldset {
padding: 1rem;
margin-top: 1rem;
border: 1px solid $info;
&__legend {
font-style: italic;
}
}

3
benevalibre/association/forms.py

@ -28,6 +28,9 @@ class CreateForm(CustomTapeformMixin, TapeformFieldsetsMixin, forms.ModelForm):
for g in models.ActivityFieldGroup.objects.all()
]
layout_template = (
"association/forms/layouts/association_informations_form.html"
)
fieldsets = [
{

18
benevalibre/templates/association/forms/layouts/association_informations_form.html

@ -0,0 +1,18 @@
{% extends form.base_layout_template %}
{% load tapeforms %}
{% block visible_fields %}
{% csrf_token %}
{% for fieldset in form.get_fieldsets %}
<div class="{{ fieldset.extra.css_class }}">
<fieldset>
{% form fieldset %}
</fieldset>
{% if fieldset.extra.css_class == "research-data-fieldset" %}
<div class="research-data-fieldset__legend">
{{ fieldset.extra.legend }}
</div>
{% endif %}
</div>
{% endfor %}
{% endblock %}
Loading…
Cancel
Save
Map all the world