Style, ordre des années #65

This commit is contained in:
Colin Maudry
2026-03-21 12:09:00 +01:00
parent eecd75ac42
commit 7b78e0a0ea
3 changed files with 58 additions and 27 deletions
+2 -2
View File
@@ -176,8 +176,8 @@ p.version > a {
/* --- Dashboard inputs --- */
.Select--multi .Select-value {
color: var(--primary-color);
background-color: rgba(255, 240, 240, 0.4);
color: var(--primary-color) !important;
background-color: rgba(255, 240, 240, 0.4) !important;
}
#filters .row > * {
+40 -9
View File
@@ -53,10 +53,13 @@ register_page(
image_url=meta_content["image_url"],
order=3,
)
options_years = {}
options_years = []
for year in reversed(range(2017, datetime.now().year + 1)):
year = str(year)
options_years[year] = year
option_year = {
"label": str(year),
"value": year,
}
options_years.append(option_year)
options_departements = []
for code in departements.keys():
@@ -403,8 +406,12 @@ Alors, on fait comment ?
),
),
dbc.Row(
[dbc.Col([
dcc.Download(id="download-observatoire"),
[
dbc.Col(
[
dcc.Download(
id="download-observatoire"
),
dbc.Button(
"Prévisualiser les données",
id="btn-observatoire-preview",
@@ -416,10 +423,20 @@ dbc.Row(
id="observatoire-share-url",
readOnly=True,
style={"display": "none"},
)], lg=12, xl=7)]),
),
],
lg=12,
xl=7,
)
]
),
dbc.Row(
dbc.Col(
html.Div(id="observatoire-copy-container"), lg=12, xl=5))
html.Div(id="observatoire-copy-container"),
lg=12,
xl=5,
)
),
],
),
dbc.Col(
@@ -585,8 +602,7 @@ def restore_filters(search, _pathname, stored_filters):
Output("observatoire-share-url", "value"),
Output("observatoire-copy-container", "children"),
*[Input(fp[0], "value") for fp in FILTER_PARAMS],
State("dashboard_url", "href"),
prevent_initial_call=True,
Input("dashboard_url", "href"),
)
def sync_observatoire_share_url(*args):
# Last arg is href (State), rest are filter values
@@ -625,6 +641,7 @@ def sync_observatoire_share_url(*args):
children=[
dbc.Button(
"Partager cette vue",
id="btn-copy-observatoire",
className="btn btn-primary mt-2",
title="Copier l'adresse de cette vue filtrée pour la partager.",
)
@@ -634,6 +651,20 @@ def sync_observatoire_share_url(*args):
return full_url, copy_button
@callback(
Output("observatoire-copy-container", "children", allow_duplicate=True),
Input("btn-copy-observatoire", "n_clicks", allow_optional=True),
prevent_initial_call=True,
)
def show_confirmation(n_clicks):
if n_clicks:
return html.Span(
"Adresse de la vue copiée",
style={"color": "green", "fontWeight": "bold", "marginLeft": "10px"},
)
return no_update
@callback(
Output("cards", "children"),
Input("dashboard_year", "value"),
+2 -2
View File
@@ -28,9 +28,9 @@ from src.utils import (
invert_columns,
logger,
meta_content,
prepare_table_data,
schema,
sort_table_data,
prepare_table_data,
)
update_date_timestamp = os.path.getmtime(os.getenv("DATA_FILE_PARQUET_PATH"))
@@ -439,7 +439,7 @@ def sync_url_and_reset_button(filter_query, sort_by, hidden_columns, href):
className="fa fa-link",
children=[
dbc.Button(
"Partager",
"Partager la vue",
className="btn btn-primary",
title="Copier l'adresse de cette vue (filtres, tris, choix de colonnes) pour la partager.",
)