Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
Showing only changes of commit f09d9bb3fc - Show all commits

View File

@ -228,6 +228,7 @@ class RowAssiJusti(tb.Row):
)
def ajouter_colonnes(self, lien_redirection: str = None):
"Ajoute colonnes actions, étudiant, type, dates..."
# Ajout colonne actions
if self.table.options.show_actions:
self._actions()
@ -241,10 +242,15 @@ class RowAssiJusti(tb.Row):
self._type()
# Date de début
multi_days = self.ligne["date_debut"].date() != self.ligne["date_fin"].date()
# En excel, on export les "vraes dates".
# En HTML, on écrit en français (on laisse les dates pour le tri)
self.add_cell(
"date_debut",
"Date de début",
self.ligne["date_debut"].strftime("%d/%m/%y à %H:%M"),
self.ligne["date_debut"].strftime("%d/%m/%y")
if multi_days
else self.ligne["date_debut"].strftime("%d/%m/%y de %H:%M"),
data={"order": self.ligne["date_debut"]},
raw_content=self.ligne["date_debut"],
column_classes={"date", "date-debut"},
@ -253,8 +259,10 @@ class RowAssiJusti(tb.Row):
self.add_cell(
"date_fin",
"Date de fin",
self.ligne["date_fin"].strftime("%d/%m/%y à %H:%M"),
raw_content=self.ligne["date_fin"],
self.ligne["date_fin"].strftime("%d/%m/%y")
if multi_days
else self.ligne["date_fin"].strftime("à %H:%M"),
raw_content=self.ligne["date_fin"], # Pour excel
data={"order": self.ligne["date_fin"]},
column_classes={"date", "date-fin"},
)