forked from ScoDoc/ScoDoc
blackify
This commit is contained in:
parent
d681c9d246
commit
d56c9a3c99
@ -131,10 +131,10 @@ def moduleimpl_inscriptions_edit(
|
||||
"""
|
||||
% M
|
||||
)
|
||||
H.append('<table><tr>')
|
||||
H.append("<table><tr>")
|
||||
H.append(_make_menu(context, partitions, "Ajouter", "true"))
|
||||
H.append(_make_menu(context, partitions, "Enlever", "false"))
|
||||
H.append('</tr></table>')
|
||||
H.append("</tr></table>")
|
||||
H.append(
|
||||
"""
|
||||
<p><br/></p>
|
||||
@ -217,14 +217,10 @@ def _make_menu_old_xxx(context, partitions, title="", check="true"):
|
||||
|
||||
return "".join(H)
|
||||
|
||||
|
||||
def _make_menu(context, partitions, title="", check="true"):
|
||||
"""Menu with list of all groups"""
|
||||
items = [
|
||||
{
|
||||
"title" : "Tous",
|
||||
"attr" : "onclick=\"group_select('', -1, %s)\"" % check
|
||||
}
|
||||
]
|
||||
items = [{"title": "Tous", "attr": "onclick=\"group_select('', -1, %s)\"" % check}]
|
||||
p_idx = 0
|
||||
for partition in partitions:
|
||||
if partition["partition_name"] != None:
|
||||
@ -232,12 +228,18 @@ def _make_menu(context, partitions, title="", check="true"):
|
||||
for group in sco_groups.get_partition_groups(context, partition):
|
||||
items.append(
|
||||
{
|
||||
"title" : "%s %s" % (partition["partition_name"], group["group_name"]),
|
||||
"attr" : "onclick=\"group_select('%s', %s, %s)\"" % (
|
||||
group["group_name"], p_idx, check)
|
||||
"title": "%s %s"
|
||||
% (partition["partition_name"], group["group_name"]),
|
||||
"attr": "onclick=\"group_select('%s', %s, %s)\""
|
||||
% (group["group_name"], p_idx, check),
|
||||
}
|
||||
)
|
||||
return '<td class="inscr_addremove_menu">' + makeMenu( title, items, base_url=context.absolute_url(), alone=True ) + "</td>"
|
||||
return (
|
||||
'<td class="inscr_addremove_menu">'
|
||||
+ makeMenu(title, items, base_url=context.absolute_url(), alone=True)
|
||||
+ "</td>"
|
||||
)
|
||||
|
||||
|
||||
def moduleimpl_inscriptions_stats(context, formsemestre_id, REQUEST=None):
|
||||
"""Affiche quelques informations sur les inscriptions
|
||||
@ -278,7 +280,7 @@ def moduleimpl_inscriptions_stats(context, formsemestre_id, REQUEST=None):
|
||||
commons = [] # modules communs a tous les etuds du semestre
|
||||
options = [] # modules ou seuls quelques etudiants sont inscrits
|
||||
for mod in Mlist:
|
||||
all, nb_inscrits, descr = descr_inscrs_module(
|
||||
tous_inscrits, nb_inscrits, descr = descr_inscrs_module(
|
||||
context,
|
||||
sem,
|
||||
mod["moduleimpl_id"],
|
||||
@ -286,7 +288,7 @@ def moduleimpl_inscriptions_stats(context, formsemestre_id, REQUEST=None):
|
||||
partitions,
|
||||
partitions_etud_groups,
|
||||
)
|
||||
if all:
|
||||
if tous_inscrits:
|
||||
commons.append(mod)
|
||||
else:
|
||||
mod["descri"] = descr
|
||||
@ -420,8 +422,7 @@ def moduleimpl_inscriptions_stats(context, formsemestre_id, REQUEST=None):
|
||||
def descr_inscrs_module(
|
||||
context, sem, moduleimpl_id, set_all, partitions, partitions_etud_groups
|
||||
):
|
||||
"""returns All, nb_inscrits, descr All true si tous inscrits
|
||||
"""
|
||||
"""returns tous_inscrits, nb_inscrits, descr"""
|
||||
ins = context.do_moduleimpl_inscription_list(moduleimpl_id=moduleimpl_id)
|
||||
set_m = set([x["etudid"] for x in ins]) # ens. des inscrits au module
|
||||
non_inscrits = set_all - set_m
|
||||
@ -523,8 +524,7 @@ def is_inscrit_ue(context, etudid, formsemestre_id, ue_id):
|
||||
|
||||
|
||||
def do_etud_desinscrit_ue(context, etudid, formsemestre_id, ue_id, REQUEST=None):
|
||||
"""Desincrit l'etudiant de tous les modules de cette UE dans ce semestre.
|
||||
"""
|
||||
"""Desincrit l'etudiant de tous les modules de cette UE dans ce semestre."""
|
||||
cnx = context.GetDBConnexion()
|
||||
cursor = cnx.cursor(cursor_factory=ScoDocCursor)
|
||||
cursor.execute(
|
||||
@ -558,8 +558,7 @@ def do_etud_desinscrit_ue(context, etudid, formsemestre_id, ue_id, REQUEST=None)
|
||||
|
||||
|
||||
def do_etud_inscrit_ue(context, etudid, formsemestre_id, ue_id, REQUEST=None):
|
||||
"""Incrit l'etudiant de tous les modules de cette UE dans ce semestre.
|
||||
"""
|
||||
"""Incrit l'etudiant de tous les modules de cette UE dans ce semestre."""
|
||||
# Verifie qu'il est bien inscrit au semestre
|
||||
insem = context.do_formsemestre_inscription_list(
|
||||
args={"formsemestre_id": formsemestre_id, "etudid": etudid}
|
||||
|
Loading…
Reference in New Issue
Block a user