Fix détails sur tables recap avec nouvelle version de datatables.

This commit is contained in:
Emmanuel Viennet 2024-07-29 21:43:34 +02:00
parent ad8bb5aace
commit 3cecfbb697
6 changed files with 31 additions and 7 deletions

View File

@ -46,4 +46,14 @@ table.dataTable tr.gt_lastrow th {
table.dataTable td.etudinfo, table.dataTable td.etudinfo,
table.dataTable td.group { table.dataTable td.group {
text-align: left; text-align: left;
}
div.dt-container div.dt-search {
display: inline-block;
margin-left: 16px;
margin-top: 4px;
}
div.dt-container div.dt-search input {
margin-left: 0.5em;
} }

View File

@ -4367,7 +4367,7 @@ div.table_recap {
} }
.table_recap .but_on { .table_recap .but_on {
background-color: rgb(177, 238, 162); background-color: rgb(177, 238, 162) !important;
font-weight: bold; font-weight: bold;
} }
@ -4381,17 +4381,17 @@ button.unselect {
.table_recap div.but_on:hover:not(.disabled), .table_recap div.but_on:hover:not(.disabled),
.table_recap a.but_on:hover:not(.disabled), .table_recap a.but_on:hover:not(.disabled),
.table_recap input.but_on:hover:not(.disabled) { .table_recap input.but_on:hover:not(.disabled) {
background: linear-gradient(to bottom, lightgray 0%, rgb(51, 255, 0) 100%); background: linear-gradient(to bottom, lightgray 0%, rgb(255, 0, 0) 100%) !important;
} }
.table_recap button.but_off:hover:not(.disabled), .table_recap button.but_off:hover:not(.disabled),
.table_recap div.but_off:hover:not(.disabled), .table_recap div.but_off:hover:not(.disabled),
.table_recap a.but_off:hover:not(.disabled), .table_recap a.but_off:hover:not(.disabled),
.table_recap input.but_off:hover:not(.disabled) { .table_recap input.but_off:hover:not(.disabled) {
background: linear-gradient(to bottom, rgb(51, 255, 0) 0%, lightgray 100%); background: linear-gradient(to bottom, rgb(51, 255, 0) 0%, lightgray 100%) !important;
} }
/* Non supproté par les navigateurs (en Fev. 2023) /* Non supporpar les navigateurs (en Fev. 2023)
.table_recap button:has(span a.clearreaload) { .table_recap button:has(span a.clearreaload) {
} }
*/ */

View File

@ -206,11 +206,22 @@ $(function () {
fixedColumns: { // fige les 3 colonnes de gauche fixedColumns: { // fige les 3 colonnes de gauche
start: 3 start: 3
}, },
initComplete: function (settings, json) {
// fixe la largeur de la table (évite décalages colonnes)
document.getElementById("DataTables_Table_0").style.width =
document.querySelector(
"#DataTables_Table_0_wrapper .dt-scroll-head .dt-scroll-headInner"
).style.width;
// déplace champ recherche à côté des boutons
let div_search = document.querySelector('div.dt-search');
let div_buttons = document.querySelector('div.dt-buttons');
div_buttons.appendChild(div_search);
},
fixedHeader: { // fige les lignes de titre fixedHeader: { // fige les lignes de titre
header: true, header: true,
footer: false, footer: false,
}, },
orderCellsTop: true, // cellules ligne 1 pour tri ordering: true, // bouton tri
aaSorting: [], // Prevent initial sorting aaSorting: [], // Prevent initial sorting
colReorder: true, colReorder: true,
stateSave: true, // enregistre état de la table (tris, ...) stateSave: true, // enregistre état de la table (tris, ...)

View File

@ -565,6 +565,8 @@ class RowGroupsHeader(Row):
): ):
idx += 1 idx += 1
colspan += 1 colspan += 1
elements.append(f"""<th colspan="{colspan}">{group_title or ""}</th>""") elements.append(
f"""<th data-dt-order="disable" colspan="{colspan}">{group_title or ""}</th>"""
)
return "\n".join(elements) if len(elements) > 1 else "" return "\n".join(elements) if len(elements) > 1 else ""

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.7.R000" SCOVERSION = "9.7.R001"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"

View File

@ -386,6 +386,7 @@ def user_role(username, dept_acronym=None, add_role_name=None, remove_role_name=
if user_role: if user_role:
db.session.delete(user_role) db.session.delete(user_role)
db.session.commit() db.session.commit()
return 0
@app.cli.command() @app.cli.command()