diff --git a/contrib/forms/project.py b/contrib/forms/project.py index 5750967a..36417f72 100644 --- a/contrib/forms/project.py +++ b/contrib/forms/project.py @@ -284,8 +284,11 @@ class DoctorateAdmissionProjectForm(forms.Form): class Media: js = ('js/dependsOn.min.js',) - def __init__(self, hide_proximity_commission_fields=True, *args, **kwargs): + def __init__(self, admission_type, hide_proximity_commission_fields=True, *args, **kwargs): self.person = getattr(self, 'person', kwargs.pop('person', None)) + self.admission_type = admission_type + self.label_classes = self.get_field_label_classes() + super().__init__(*args, **kwargs) # Set proximity commission fields value from API data @@ -367,3 +370,38 @@ def get_selected_doctorate(self, sector, doctorat): return next( # pragma: no branch d for d in doctorats if doctorat == "{doctorat.sigle}-{doctorat.annee}".format(doctorat=d) ) + + def get_field_label_classes(self): + """Returns the classes that should be applied to the label of the form fields.""" + + possible_mandatory_fields = [ + 'justification', + 'type_contrat_travail', + 'eft', + 'bourse_recherche', + 'autre_bourse_recherche', + 'raison_non_soutenue', + 'titre_projet', + ] + + if self.admission_type == AdmissionType.ADMISSION.name: + possible_mandatory_fields += [ + 'type_financement', + 'bourse_date_debut', + 'bourse_date_fin', + 'bourse_preuve', + 'duree_prevue', + 'temps_consacre', + 'est_lie_fnrs_fria_fresh_csc', + 'resume_projet', + 'documents_projet', + 'proposition_programme_doctoral', + 'langue_redaction_these', + 'projet_doctoral_deja_commence', + 'projet_doctoral_institution', + 'projet_doctoral_date_debut', + 'institution', + 'domaine_these', + ] + + return {field_name: 'required_text' for field_name in possible_mandatory_fields} diff --git a/contrib/views/doctorate/form_tabs/project.py b/contrib/views/doctorate/form_tabs/project.py index c76275ac..0916cfbe 100644 --- a/contrib/views/doctorate/form_tabs/project.py +++ b/contrib/views/doctorate/form_tabs/project.py @@ -59,6 +59,7 @@ class DoctorateAdmissionProjectFormView(LoadDossierViewMixin, WebServiceFormMixi def get_form_kwargs(self): kwargs = super().get_form_kwargs() kwargs['person'] = self.person + kwargs['admission_type'] = self.admission.type_admission return kwargs def get_initial(self): diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 90849c66..2eec36e2 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -2462,6 +2462,10 @@ msgid "" "
  • Without any filter nor any contour
  • " msgstr "" +msgid "" +"The promoters may be changed during the admissions process." +msgstr "" + msgid "" "The secondary school diploma is the Certificat d'Enseignement Secondaire " "Superieur (CESS, Certificate of Higher Secondary Education). It is commonly " diff --git a/locale/fr_BE/LC_MESSAGES/django.po b/locale/fr_BE/LC_MESSAGES/django.po index 690ad08f..af58aaf7 100644 --- a/locale/fr_BE/LC_MESSAGES/django.po +++ b/locale/fr_BE/LC_MESSAGES/django.po @@ -2842,6 +2842,10 @@ msgstr "" "et de face
  • Photo récente en couleur
  • Aucun filtre appliqué ni trace de contour
  • " +msgid "" +"The promoters may be changed during the admissions process." +msgstr "Le promoteur ou la promotrice pourront être modifiés au cours du processus d'admission." + msgid "" "The secondary school diploma is the Certificat d'Enseignement Secondaire " "Superieur (CESS, Certificate of Higher Secondary Education). It is commonly " diff --git a/templates/admission/doctorate/forms/project.html b/templates/admission/doctorate/forms/project.html index 1f9d47ae..5532dcff 100644 --- a/templates/admission/doctorate/forms/project.html +++ b/templates/admission/doctorate/forms/project.html @@ -48,7 +48,7 @@
    Please also consult the special provisions of the field for all pre-admission conditions. {% endblocktrans %}

    - {% bootstrap_field form.justification form_group_class="form-group required_field" %} + {% bootstrap_field form.justification label_class=form.label_classes.justification %} {% endif %} @@ -91,50 +91,50 @@ {% panel _("Funding") %}
    - {% bootstrap_field_with_tooltip form.type_financement classes="form-group required_field" %} + {% bootstrap_field_with_tooltip form.type_financement label_class=form.label_classes.type_financement %}
    - {% bootstrap_field form.type_contrat_travail show_help=False form_group_class="form-group col-md-4 required_field" %} + {% bootstrap_field form.type_contrat_travail show_help=False label_class=form.label_classes.type_contrat_travail form_group_class="form-group col-md-4" %}
    - {% bootstrap_field form.eft form_group_class="form-group required_field" placeholder="" %} + {% bootstrap_field form.eft label_class=form.label_classes.eft placeholder="" %}
    - {% bootstrap_field form.bourse_recherche form_group_class="form-group col-md-4 required_field" %} + {% bootstrap_field form.bourse_recherche label_class=form.label_classes.bourse_recherche form_group_class="form-group col-md-4" %}
    {% bootstrap_field form.autre_bourse_recherche placeholder="" %}
    - {% bootstrap_field form.bourse_date_debut form_group_class="form-group col-md-5 required_field" %} - {% bootstrap_field_with_tooltip form.bourse_date_fin classes="form-group col-md-4 required_field" %} + {% bootstrap_field form.bourse_date_debut label_class=form.label_classes.bourse_date_debut form_group_class="form-group col-md-5" %} + {% bootstrap_field_with_tooltip form.bourse_date_fin label_class=form.label_classes.bourse_date_fin classes="col-md-4" %}
    - {% bootstrap_field_with_tooltip form.bourse_preuve classes="form-group required_field" %} + {% bootstrap_field_with_tooltip form.bourse_preuve label_class=form.label_classes.bourse_preuve %}
    - {% bootstrap_field form.duree_prevue placeholder="" form_group_class="form-group required_field" %} + {% bootstrap_field form.duree_prevue placeholder="" label_class=form.label_classes.duree_prevue %}
    - {% bootstrap_field form.temps_consacre placeholder="" form_group_class="form-group required_field" %} + {% bootstrap_field form.temps_consacre placeholder="" label_class=form.label_classes.temps_consacre %}
    - {% bootstrap_field_with_tooltip form.est_lie_fnrs_fria_fresh_csc classes="form-group required_field" %} + {% bootstrap_field_with_tooltip form.est_lie_fnrs_fria_fresh_csc label_class=form.label_classes.est_lie_fnrs_fria_fresh_csc %}
    - {% bootstrap_field form.commentaire_financement form_group_class="form-group" %} + {% bootstrap_field form.commentaire_financement %}
    {% endpanel %} {% panel _("PhD research project") %} - {% bootstrap_field form.titre_projet form_group_class="form-group required_field" placeholder="" %} - {% bootstrap_field_with_tooltip form.resume_projet classes="form-group required_field" %} + {% bootstrap_field form.titre_projet label_class=form.label_classes.titre_projet placeholder="" %} + {% bootstrap_field_with_tooltip form.resume_projet label_class=form.label_classes.resume_projet %}
    - {% bootstrap_field form.langue_redaction_these form_group_class="form-group required_field" %} + {% bootstrap_field form.langue_redaction_these label_class=form.label_classes.langue_redaction_these %}
    @@ -148,9 +148,9 @@ website or from your doctoral manager. {% endblocktrans %}

    - {% bootstrap_field form.documents_projet form_group_class="form-group required_field" %} + {% bootstrap_field form.documents_projet label_class=form.label_classes.documents_projet %} {% if admission.type_admission == 'ADMISSION' %} - {% bootstrap_field form.proposition_programme_doctoral form_group_class="form-group required_field" %} + {% bootstrap_field form.proposition_programme_doctoral label_class=form.label_classes.proposition_programme_doctoral %} {% endif %} {% bootstrap_field_with_tooltip form.projet_formation_complementaire %} {% bootstrap_field form.graphe_gantt %} @@ -158,14 +158,14 @@ {% endpanel %} {% panel _("PhD research experience") %} - {% bootstrap_field form.projet_doctoral_deja_commence form_group_class="form-group required_field" %} + {% bootstrap_field form.projet_doctoral_deja_commence label_class=form.label_classes.projet_doctoral_deja_commence %}
    - {% bootstrap_field form.projet_doctoral_institution placeholder="" form_group_class="form-group required_field" %} + {% bootstrap_field form.projet_doctoral_institution placeholder="" label_class=form.label_classes.projet_doctoral_institution %}
    - {% bootstrap_field form.projet_doctoral_date_debut form_group_class="form-group required_field" %} + {% bootstrap_field form.projet_doctoral_date_debut label_class=form.label_classes.projet_doctoral_date_debut %}
    @@ -173,10 +173,10 @@
    - {% bootstrap_field form.institution placeholder="" form_group_class="form-group required_field" %} + {% bootstrap_field form.institution placeholder="" label_class=form.label_classes.institution %}
    - {% bootstrap_field form.domaine_these placeholder="" form_group_class="form-group required_field" %} + {% bootstrap_field form.domaine_these placeholder="" label_class=form.label_classes.domaine_these %}
    {% bootstrap_field form.non_soutenue %} @@ -186,7 +186,7 @@
    - {% bootstrap_field form.raison_non_soutenue form_group_class="form-group required_field" placeholder="" %} + {% bootstrap_field form.raison_non_soutenue label_class=form.label_classes.raison_non_soutenue placeholder="" %}
    {% endpanel %} diff --git a/templates/admission/doctorate/forms/supervision.html b/templates/admission/doctorate/forms/supervision.html index b075e4c7..64a9b98b 100644 --- a/templates/admission/doctorate/forms/supervision.html +++ b/templates/admission/doctorate/forms/supervision.html @@ -8,7 +8,7 @@ * The core business involves the administration of students, teachers, * courses, programs and so on. * - * Copyright (C) 2015-2023 Université catholique de Louvain (http://www.uclouvain.be) + * Copyright (C) 2015-2024 Université catholique de Louvain (http://www.uclouvain.be) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -88,40 +88,55 @@
    {% csrf_token %} {% bootstrap_form_errors add_form %} - {% panel _("Add a promoter or a CA member") %} -
    -
    - {% bootstrap_field add_form.type %} -
    -
    - {% bootstrap_field add_form.internal_external %} -
    -
    - {% bootstrap_field add_form.tutor %} -
    -
    - {% bootstrap_field add_form.person %} -
    -
    -
    -
    - {% bootstrap_field add_form.prenom %} - {% bootstrap_field add_form.nom %} - {% bootstrap_field add_form.email %} - {% bootstrap_field add_form.est_docteur %} - {% bootstrap_field add_form.institution %} - {% bootstrap_field add_form.ville %} - {% bootstrap_field add_form.pays %} - {% bootstrap_field add_form.langue %} +
    +
    +

    + {% translate 'Add a promoter or a CA member' %} + {% if admission.type_admission == 'PRE_ADMISSION' %} + + {% endif %} +

    +
    +
    +
    +
    + {% bootstrap_field add_form.type %} +
    +
    + {% bootstrap_field add_form.internal_external %} +
    +
    + {% bootstrap_field add_form.tutor %} +
    +
    + {% bootstrap_field add_form.person %} +
    +
    +
    +
    + {% bootstrap_field add_form.prenom %} + {% bootstrap_field add_form.nom %} + {% bootstrap_field add_form.email %} + {% bootstrap_field add_form.est_docteur %} + {% bootstrap_field add_form.institution %} + {% bootstrap_field add_form.ville %} + {% bootstrap_field add_form.pays %} + {% bootstrap_field add_form.langue %} +
    +
    - - {% endpanel %} +
    {% endif %} @@ -142,6 +157,7 @@ {% endblock tab_content %} {% block script %} + {{ add_form.media }} {{ approval_form.media }} {{ approve_by_pdf_form.media }} diff --git a/templates/admission/tags/bootstrap_field_with_tooltip.html b/templates/admission/tags/bootstrap_field_with_tooltip.html index 2f04c9b8..5663b2d2 100644 --- a/templates/admission/tags/bootstrap_field_with_tooltip.html +++ b/templates/admission/tags/bootstrap_field_with_tooltip.html @@ -30,7 +30,7 @@ {% bootstrap_field field %} {% else %}
    -