From 5563ff49f8d5631ba46d5e1ff8d55a5e2b700282 Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Mon, 21 Apr 2025 23:43:29 +0200 Subject: [PATCH] Couleurs chaudes, placeholder pour les filtres --- run.py | 2 +- src/assets/style.css | 8 ++++++-- src/pages/home.py | 8 +++----- src/utils.py | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/run.py b/run.py index 435d1e9..0c750a9 100644 --- a/run.py +++ b/run.py @@ -6,4 +6,4 @@ server = app.server # To use `python run.py` (dev) if __name__ == "__main__": - app.run_server(debug=True) + app.run(debug=True) diff --git a/src/assets/style.css b/src/assets/style.css index aed2e2e..bedd3c8 100644 --- a/src/assets/style.css +++ b/src/assets/style.css @@ -22,7 +22,7 @@ td[data-dash-column="objet"] { .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-header { - background-color: #666986; + background-color: #b33821; color: white; } @@ -30,7 +30,11 @@ td[data-dash-column="objet"] { .dash-spreadsheet-container .dash-spreadsheet-inner th.dash-filter { - background-color: #d0d2e6; + background-color: #f0afa3; +} + +#table tr:nth-child(even) td { + background-color: #feeeee; } #header > *, diff --git a/src/pages/home.py b/src/pages/home.py index ee49545..3fba171 100644 --- a/src/pages/home.py +++ b/src/pages/home.py @@ -18,10 +18,8 @@ datatable = dash_table.DataTable( page_current=0, page_action="custom", filter_action="custom", - # filter_options={"case": "insensitive", "placeholder_text": "Filtrer..."}, - columns=[ - {"name": i, "id": i, "deletable": True, "selectable": False} for i in df.columns - ], + filter_options={"case": "insensitive", "placeholder_text": "Filtrer..."}, + columns=[{"name": i, "id": i} for i in df.collect_schema().names()], selected_columns=[], selected_rows=[], # sort_action="native", @@ -32,7 +30,7 @@ datatable = dash_table.DataTable( style_cell_conditional=[ { "if": {"column_id": "objet"}, - "minWidth": "300px", + "minWidth": "350px", "textAlign": "left", "overflow": "hidden", "lineHeight": "14px", diff --git a/src/utils.py b/src/utils.py index cb47448..d422ada 100644 --- a/src/utils.py +++ b/src/utils.py @@ -1,7 +1,7 @@ operators = [ ["s<", "<"], ["s>", ">"], - ["scontains", "contains"], + ["icontains", "contains"], ]