diff --git a/app/scodoc/sco_inscr_passage.py b/app/scodoc/sco_inscr_passage.py index 9e690f301815ec183ca706db134e2ce334e9ad9a..d0d05cebb0c54153436fd14cc710af823162e617 100644 --- a/app/scodoc/sco_inscr_passage.py +++ b/app/scodoc/sco_inscr_passage.py @@ -349,6 +349,7 @@ def formsemestre_inscr_passage( inscrit_groupes=inscrit_groupes, inscrit_parcours=inscrit_parcours, ignore_jury=ignore_jury, + with_apo_cols=False, ) else: if not dialog_confirmed: @@ -447,9 +448,10 @@ def formsemestre_inscr_passage( """ ) - # return render_template( - "sco_page.j2", title="Passage des étudiants", content="\n".join(H) + "formsemestre/synchro_etuds.j2", + title="Passage des étudiants", + content="\n".join(H), ) @@ -462,6 +464,7 @@ def _build_page( inscrit_groupes=False, inscrit_parcours=False, ignore_jury=False, + with_apo_cols: bool = True, ): inscrit_groupes = int(inscrit_groupes) inscrit_parcours = int(inscrit_parcours) @@ -506,7 +509,7 @@ def _build_page( de ce semestre ({formsemestre.date_debut.strftime(scu.DATE_FMT)}) sont pris en compte.</em> </div> - {etuds_select_boxes(auth_etuds_by_sem, inscrits_ailleurs)} + {etuds_select_boxes(auth_etuds_by_sem, inscrits_ailleurs, with_apo_cols=with_apo_cols)} <input type="submit" name="submitted" value="Appliquer les modifications"/> @@ -586,6 +589,7 @@ def etuds_select_boxes( export_cat_xls=None, base_url="", read_only=False, + with_apo_cols: bool = True, ): """Boites pour selection étudiants par catégorie auth_etuds_by_cat = { category : { 'info' : {}, 'etuds' : ... } @@ -598,22 +602,7 @@ def etuds_select_boxes( return etuds_select_box_xls(auth_etuds_by_cat[export_cat_xls]) H = [ - """<script type="text/javascript"> - function sem_select(formsemestre_id, state) { - var elems = document.getElementById(formsemestre_id).getElementsByTagName("input"); - for (var i =0; i < elems.length; i++) { elems[i].checked=state; } - } - function sem_select_inscrits(formsemestre_id) { - var elems = document.getElementById(formsemestre_id).getElementsByTagName("input"); - for (var i =0; i < elems.length; i++) { - if (elems[i].parentNode.className.indexOf('inscrit') >= 0) { - elems[i].checked=true; - } else { - elems[i].checked=false; - } - } - } - </script> + """ <div class="etuds_select_boxes">""" ] # " # Élimine les boites vides: @@ -645,6 +634,7 @@ def etuds_select_boxes( sel_inscrits=sel_inscrits, xls_url=xls_url, inscrits_ailleurs=inscrits_ailleurs, + with_apo_cols=with_apo_cols, ) ) @@ -659,6 +649,7 @@ def etuds_select_box( sel_inscrits: bool = True, xls_url: str = "", inscrits_ailleurs: set = None, + with_apo_cols: bool = True, ) -> str: """HTML pour une "boite" avec une liste d'étudiants à sélectionner""" inscrits_ailleurs = inscrits_ailleurs or {} @@ -693,16 +684,17 @@ def etuds_select_box( if xls_url: H.append(f'<a href="{xls_url}">{scu.ICON_XLS}</a> ') H.append("</div>") - checkbox_title = "<th></th>" if with_checkbox else "" + checkbox_title = """<th class="no-sort"></th>""" if with_checkbox else "" + ths = ( + f"<th>Étape</th>{checkbox_title}<th>Nom</th><th>Paiement</th><th>Finalisé</th>" + if with_apo_cols + else f"{checkbox_title}<th>Nom</th>" + ) H.append( f"""<table class="etuds-box"> <thead> <tr> - <th>Étape</th> - {checkbox_title} - <th>Nom</th> - <th>Paiement</th> - <th>Finalisé</th> + {ths} </tr> </thead> <tbody> @@ -723,6 +715,7 @@ def etuds_select_box( etud_key=infos.get("etud_key", "etudid"), is_inscrit=is_inscrit, extra_class=extra_class, + with_apo_cols=with_apo_cols, ) ) H.append( @@ -741,6 +734,7 @@ def _etud_row( etud_key: str = "", is_inscrit: bool = False, extra_class: str = "", + with_apo_cols: bool = True, ) -> str: """HTML 'row' for this etud""" H = [] @@ -768,23 +762,33 @@ def _etud_row( ) paiement = etud.get("paiementinscription", True) datefinalisation = etud.get("datefinalisationinscription") - H.append( - f""" - <tr class="{extra_class}"> - <td class="etape">{etud.get("etape", "") or ""}</td> - {checkbox_cell} - <td data-order="{etud.get("nom", "").upper()}">{elink}</td> - <td class="paiement {'' if paiement else 'paspaye'}">{ - '' if paiement else 'non paiement' - }</td> - <td class="finalise" data-order="{ - datefinalisation.isoformat() if datefinalisation else '' - }">{"inscription finalisée le " + datefinalisation.strftime(scu.DATE_FMT) - if datefinalisation else "" } - </td> - </tr> - """ - ) + if with_apo_cols: + H.append( + f""" + <tr class="{extra_class}"> + <td class="etape">{etud.get("etape", "") or ""}</td> + {checkbox_cell} + <td data-order="{etud.get("nom", "").upper()}">{elink}</td> + <td class="paiement {'' if paiement else 'paspaye'}">{ + '' if paiement else 'non paiement' + }</td> + <td class="finalise" data-order="{ + datefinalisation.isoformat() if datefinalisation else '' + }">{"inscription finalisée le " + datefinalisation.strftime(scu.DATE_FMT) + if datefinalisation else "" } + </td> + </tr> + """ + ) + else: # juste checkbox et nom + H.append( + f""" + <tr class="{extra_class}"> + {checkbox_cell} + <td data-order="{etud.get("nom", "").upper()}">{elink}</td> + </tr> + """ + ) return "\n".join(H) diff --git a/app/templates/formsemestre/synchro_etuds.j2 b/app/templates/formsemestre/synchro_etuds.j2 index 2ee62ce74a75d609970dfb14f173e6730c950643..2da71a2ae0fbd2763cd41cb7f69432c6f7a4eb7f 100644 --- a/app/templates/formsemestre/synchro_etuds.j2 +++ b/app/templates/formsemestre/synchro_etuds.j2 @@ -1,15 +1,37 @@ {% extends "sco_page.j2" %} {% import 'wtf.j2' as wtf %} +{# Utilisé pour passage d'un semestre à l'autre et pour synchro Apogée #} + {% block scripts %} {{ super() }} <script> + function sem_select(formsemestre_id, state) { + let elems = document.getElementById(formsemestre_id).getElementsByTagName("input"); + for (var i =0; i < elems.length; i++) { + elems[i].checked = state; + } + } + function sem_select_inscrits(formsemestre_id) { + var elems = document.getElementById(formsemestre_id).getElementsByTagName("input"); + for (var i =0; i < elems.length; i++) { + if (elems[i].parentNode.className.indexOf('inscrit') >= 0) { + elems[i].checked=true; + } else { + elems[i].checked=false; + } + } + } + $(document).ready(function() { $('.etuds-box').DataTable({ paging: false, autoWidth: false, searching: false, - info: false // Disable the "Showing 1 to X of X entries" information + info: false, // Disable the "Showing 1 to X of X entries" + columnDefs: [ + { targets: 'no-sort', orderable: false } // Disable sorting on columns with class 'no-sort' + ] }); }); </script> diff --git a/sco_version.py b/sco_version.py index d06324c1c514af31f0737344c1cd4378e6ecf28d..83b81513ea7f6e5ebb69690c006a818455526d6b 100644 --- a/sco_version.py +++ b/sco_version.py @@ -3,7 +3,7 @@ "Infos sur version ScoDoc" -SCOVERSION = "9.7.36" +SCOVERSION = "9.7.37" SCONAME = "ScoDoc"