forked from ScoDoc/ScoDoc
Débouchés: tags. Implements #396
This commit is contained in:
parent
68128c27d5
commit
a1f5340935
@ -71,12 +71,10 @@ def report_debouche_date(start_year=None, fmt="html"):
|
|||||||
etudids = get_etudids_with_debouche(start_year)
|
etudids = get_etudids_with_debouche(start_year)
|
||||||
tab = table_debouche_etudids(etudids, keep_numeric=keep_numeric)
|
tab = table_debouche_etudids(etudids, keep_numeric=keep_numeric)
|
||||||
|
|
||||||
tab.filename = scu.make_filename("debouche_scodoc_%s" % start_year)
|
tab.filename = scu.make_filename(f"debouche_scodoc_{start_year}")
|
||||||
tab.origin = (
|
tab.origin = f"Généré par {sco_version.SCONAME} le {scu.timedate_human_repr()}"
|
||||||
"Généré par %s le " % sco_version.SCONAME + scu.timedate_human_repr() + ""
|
tab.caption = f"Récapitulatif débouchés à partir du 1/1/{start_year}."
|
||||||
)
|
tab.base_url = f"{request.base_url}?start_year={start_year}"
|
||||||
tab.caption = "Récapitulatif débouchés à partir du 1/1/%s." % start_year
|
|
||||||
tab.base_url = "%s?start_year=%s" % (request.base_url, start_year)
|
|
||||||
return tab.make_page(
|
return tab.make_page(
|
||||||
title="""<h2 class="formsemestre">Débouchés étudiants </h2>""",
|
title="""<h2 class="formsemestre">Débouchés étudiants </h2>""",
|
||||||
init_qtip=True,
|
init_qtip=True,
|
||||||
@ -118,7 +116,16 @@ def get_etudids_with_debouche(start_year):
|
|||||||
|
|
||||||
def table_debouche_etudids(etudids, keep_numeric=True):
|
def table_debouche_etudids(etudids, keep_numeric=True):
|
||||||
"""Rapport pour ces étudiants"""
|
"""Rapport pour ces étudiants"""
|
||||||
L = []
|
rows = []
|
||||||
|
# Recherche les débouchés:
|
||||||
|
itemsuivi_etuds = {etudid: itemsuivi_list_etud(etudid) for etudid in etudids}
|
||||||
|
all_tags = set()
|
||||||
|
for debouche in itemsuivi_etuds.values():
|
||||||
|
if debouche:
|
||||||
|
for it in debouche:
|
||||||
|
all_tags.update(tag.strip() for tag in it["tags"].split(","))
|
||||||
|
all_tags = tuple(sorted(all_tags))
|
||||||
|
|
||||||
for etudid in etudids:
|
for etudid in etudids:
|
||||||
etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
|
etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
|
||||||
# retrouve le "dernier" semestre (au sens de la date de fin)
|
# retrouve le "dernier" semestre (au sens de la date de fin)
|
||||||
@ -152,25 +159,33 @@ def table_debouche_etudids(etudids, keep_numeric=True):
|
|||||||
"sem_ident": "%s %s"
|
"sem_ident": "%s %s"
|
||||||
% (last_sem["date_debut_iso"], last_sem["titre"]), # utile pour tris
|
% (last_sem["date_debut_iso"], last_sem["titre"]), # utile pour tris
|
||||||
}
|
}
|
||||||
|
|
||||||
# recherche des débouchés
|
# recherche des débouchés
|
||||||
debouche = itemsuivi_list_etud(etudid) # liste de plusieurs items
|
debouche = itemsuivi_etuds[etudid] # liste de plusieurs items
|
||||||
if debouche:
|
if debouche:
|
||||||
row["debouche"] = "<br>".join(
|
if keep_numeric: # pour excel:
|
||||||
[
|
row["debouche"] = "\n".join(
|
||||||
str(it["item_date"])
|
f"""{it["item_date"]}: {it["situation"]}""" for it in debouche
|
||||||
+ " : "
|
)
|
||||||
+ it["situation"]
|
else:
|
||||||
+ " <i>"
|
row["debouche"] = "<br>".join(
|
||||||
+ it["tags"]
|
[
|
||||||
+ "</i>"
|
str(it["item_date"])
|
||||||
for it in debouche
|
+ " : "
|
||||||
]
|
+ it["situation"]
|
||||||
) #
|
+ " <i>"
|
||||||
|
+ it["tags"]
|
||||||
|
+ "</i>"
|
||||||
|
for it in debouche
|
||||||
|
]
|
||||||
|
)
|
||||||
|
for it in debouche:
|
||||||
|
for tag in it["tags"].split(","):
|
||||||
|
tag = tag.strip()
|
||||||
|
row[f"tag_{tag}"] = tag
|
||||||
else:
|
else:
|
||||||
row["debouche"] = "non renseigné"
|
row["debouche"] = "non renseigné"
|
||||||
L.append(row)
|
rows.append(row)
|
||||||
L.sort(key=lambda x: x["sem_ident"])
|
rows.sort(key=lambda x: x["sem_ident"])
|
||||||
|
|
||||||
titles = {
|
titles = {
|
||||||
"civilite": "",
|
"civilite": "",
|
||||||
@ -184,21 +199,25 @@ def table_debouche_etudids(etudids, keep_numeric=True):
|
|||||||
"effectif": "Eff.",
|
"effectif": "Eff.",
|
||||||
"debouche": "Débouché",
|
"debouche": "Débouché",
|
||||||
}
|
}
|
||||||
|
columns_ids = [
|
||||||
|
"semestre",
|
||||||
|
"semestre_id",
|
||||||
|
"periode",
|
||||||
|
"civilite",
|
||||||
|
"nom",
|
||||||
|
"prenom",
|
||||||
|
"moy",
|
||||||
|
"rang",
|
||||||
|
"effectif",
|
||||||
|
"debouche",
|
||||||
|
]
|
||||||
|
for tag in all_tags:
|
||||||
|
titles[f"tag_{tag}"] = tag
|
||||||
|
columns_ids.append(f"tag_{tag}")
|
||||||
tab = GenTable(
|
tab = GenTable(
|
||||||
columns_ids=(
|
columns_ids=columns_ids,
|
||||||
"semestre",
|
|
||||||
"semestre_id",
|
|
||||||
"periode",
|
|
||||||
"civilite",
|
|
||||||
"nom",
|
|
||||||
"prenom",
|
|
||||||
"moy",
|
|
||||||
"rang",
|
|
||||||
"effectif",
|
|
||||||
"debouche",
|
|
||||||
),
|
|
||||||
titles=titles,
|
titles=titles,
|
||||||
rows=L,
|
rows=rows,
|
||||||
# html_col_width='4em',
|
# html_col_width='4em',
|
||||||
html_sortable=True,
|
html_sortable=True,
|
||||||
html_class="table_leftalign table_listegroupe",
|
html_class="table_leftalign table_listegroupe",
|
||||||
|
@ -1495,7 +1495,12 @@ def formsemestre_note_etuds_sans_notes(
|
|||||||
</div>
|
</div>
|
||||||
{message}
|
{message}
|
||||||
|
|
||||||
<form method="post">
|
<style>
|
||||||
|
.sco-std-form select, .sco-std-form input[type="submit"] {{
|
||||||
|
height: 24px;
|
||||||
|
}}
|
||||||
|
</style>
|
||||||
|
<form class="sco-std-form" method="post">
|
||||||
<input type="hidden" name="formsemestre_id" value="{formsemestre.id}">
|
<input type="hidden" name="formsemestre_id" value="{formsemestre.id}">
|
||||||
<input type="hidden" name="etudid" value="{etudid or ""}">
|
<input type="hidden" name="etudid" value="{etudid or ""}">
|
||||||
|
|
||||||
@ -1506,7 +1511,7 @@ def formsemestre_note_etuds_sans_notes(
|
|||||||
<option value="ATT" selected>ATT (en attente)</option>
|
<option value="ATT" selected>ATT (en attente)</option>
|
||||||
<option value="EXC">EXC (neutralisée)</option>
|
<option value="EXC">EXC (neutralisée)</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="submit" name="enregistrer">
|
<input type="submit" value="Enregistrer">
|
||||||
</form>
|
</form>
|
||||||
{html_sco_header.sco_footer()}
|
{html_sco_header.sco_footer()}
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user