From e8c8815b2434ea9c0a923915af5f4750a697683d Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 27 Jun 2022 19:47:41 +0200 Subject: [PATCH] Jury BUT: cosmetic tableau jury (v2) --- app/scodoc/sco_groups.py | 12 +++++++----- app/static/css/scodoc.css | 12 ++++++++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/scodoc/sco_groups.py b/app/scodoc/sco_groups.py index 7d758a6c..5ea56ad5 100644 --- a/app/scodoc/sco_groups.py +++ b/app/scodoc/sco_groups.py @@ -270,15 +270,17 @@ def get_group_members(group_id, etat=None): return r + def check_group_name(group_name, partition, raiser=False): """If groupe name exists in partition : if raiser -> Raise ScoValueError else-> return true""" exists = group_name in [g["group_name"] for g in get_partition_groups(partition)] if exists: if raiser: raise ScoValueError("Le nom de groupe existe déjà dans la partition") - else : + else: return True - return False; + return False + # obsolete: sco_groups_view.DisplayedGroupsInfos # def get_groups_members(group_ids, etat=None): @@ -840,14 +842,14 @@ def create_group(partition_id, group_name="", default=False) -> int: raise ValueError("invalid group name: ()") # checkGroupName(group_name) if check_group_name(group_name, partition): - raise ValueError( - "group_name %s already exists in partition" % group_name + raise ScoValueError( + f"group_name {group_name} already exists in partition" ) # XXX FIX: incorrect error handling (in AJAX) cnx = ndb.GetDBConnexion() group_id = groupEditor.create( cnx, {"partition_id": partition_id, "group_name": group_name} ) - log("create_group: created group_id=%s" % group_id) + log("create_group: created group_id={group_id}") # return group_id diff --git a/app/static/css/scodoc.css b/app/static/css/scodoc.css index c94bc629..ef35fcff 100644 --- a/app/static/css/scodoc.css +++ b/app/static/css/scodoc.css @@ -3788,11 +3788,19 @@ table.table_recap.jury .col_rcue { } table.table_recap.jury tr.even td.col_rcue { - background-color: rgb(243, 243, 243); + background-color: #b0d4f8; } table.table_recap.jury tr.odd td.col_rcue { - background-color: #e6eeed; + background-color: #abcdef; +} + +table.table_recap.jury tr.odd td.col_rcues_validables { + background-color: #e1d3c5 !important; +} + +table.table_recap.jury tr.even td.col_rcues_validables { + background-color: #fcebda !important; } table.table_recap .group {