-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajout switch ancien/nouveau + GB/ECCO
- Loading branch information
Showing
8 changed files
with
159 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
from django.contrib import admin | ||
from .models import BaseEleve, Departement, Commune | ||
from .models import BaseEleve, MEE, Allergie, Spe, TroubleCognitif | ||
|
||
# Register your models here. | ||
admin.site.register(BaseEleve) | ||
admin.site.register(Departement) | ||
admin.site.register(Commune) | ||
admin.site.register(MEE) | ||
admin.site.register(Allergie) | ||
admin.site.register(TroubleCognitif) | ||
admin.site.register(Spe) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Fonction permettant de cacher les champs inutiles du resp2 | ||
function Hide() { | ||
if(document.getElementById('nouvelle').checked) { | ||
document.getElementById('div_id_2-niveau_an_passe').style.display = 'none'; | ||
document.getElementById('div_id_2-gb_an_passe').style.display = 'none'; | ||
document.getElementById('div_id_2-ecco_an_passe').style.display = 'none'; | ||
} else { | ||
document.getElementById('div_id_2-niveau_an_passe').style.display = ''; | ||
document.getElementById('div_id_2-gb_an_passe').style.display = ''; | ||
document.getElementById('div_id_2-ecco_an_passe').style.display = ''; | ||
} | ||
} | ||
// Vérifie id_1-resp2 est à aucun (fonction Hide) après le chargement du document. | ||
// Utile lors du retour en arrière dans le formulaire | ||
document.addEventListener("DOMContentLoaded", function() { | ||
Hide(); | ||
}); | ||
// Appelle la fonction quand on change le statut de resp2 | ||
window.onload = function() { | ||
document.getElementById('nouvelle').onchange = Hide; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{% load crispy_forms_field %} | ||
<div class="form-group row"> | ||
{% if field.label and form_show_labels %} | ||
{# not field|is_radioselect in row below can be removed once Django 3.2 is no longer supported #} | ||
<label {% if field.id_for_label and not field|is_radioselect %}for="{{ field.id_for_label }}" {% endif %}class="{% if 'form-horizontal' in form_class %}col-form-label {% endif %}{{ label_class }}{% if field.field.required %} requiredField{% endif %}"> | ||
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %} | ||
</label> | ||
{% endif %} | ||
<div id="div_{{ field.auto_id }}" class="custom-control custom-checkbox{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}"> | ||
|
||
{% if field|is_checkbox and form_show_labels %} | ||
{%if use_custom_control%} | ||
{% if field.errors %} | ||
{% crispy_field field 'class' 'custom-control-input is-invalid' %} | ||
{% else %} | ||
{% crispy_field field 'class' 'custom-control-input' %} | ||
{% endif %} | ||
{% else %} | ||
{% if field.errors %} | ||
{% crispy_field field 'class' 'form-check-input is-invalid' %} | ||
{% else %} | ||
{% crispy_field field 'class' 'form-check-input' %} | ||
{% endif %} | ||
{% endif %} | ||
<label for="{{ field.id_for_label }}" class="{%if use_custom_control%}custom-control-label{% else %}form-check-label{% endif %}{% if field.field.required %} requiredField{% endif %}"> | ||
{% if field.field.required %}<span class="asteriskField">*</span>{% endif %} | ||
</label> | ||
{% include 'bootstrap4/layout/help_text_and_errors.html' %} | ||
{% endif %} | ||
|
||
</div> | ||
|
||
</div> | ||
|