From 819f2e315f702a2ce025e51d559d30fa6cf43a11 Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Mon, 29 Sep 2025 20:06:04 +0200 Subject: [PATCH] =?UTF-8?q?Affichage=20du=20num=C3=A9ro=20de=20version=20e?= =?UTF-8?q?t=20lien=20vers=20changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + pyproject.toml | 2 +- src/app.py | 21 ++++++++++++++++++++- src/assets/style.css | 30 +++++++++++++++++++++++++----- 4 files changed, 47 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4428ef8..ee53ae6 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ python run.py - Formulaire de contact ([#48](https://github.com/ColinMaudry/decp.info/issues/48)) 📨 - Nom de colonnes plus_agréables ([#33](https://github.com/ColinMaudry/decp.info/issues/33)) 💅 - Définition des colonnes quand vous passez votre souris sur les en-têtes ([#33](https://github.com/ColinMaudry/decp.info/issues/33)) 📖 +- Affichage du numéro de version près du logo et lien vers ici 🤓 - Variables globales uniquement en lecture (😁) ##### 2.0.1 (23 septembre 2025) diff --git a/pyproject.toml b/pyproject.toml index e533afa..9b7f6ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "decp.info" description = "" -version = "2.0.1" +version = "2.1.0" requires-python = ">= 3.10" authors = [ { name = "Colin Maudry", email = "colin+decp@maudry.com" } diff --git a/src/app.py b/src/app.py index c8ecc2f..32b659a 100644 --- a/src/app.py +++ b/src/app.py @@ -1,6 +1,7 @@ import logging import dash_bootstrap_components as dbc +import tomllib from dash import Dash, dcc, html, page_container, page_registry from dotenv import load_dotenv from flask import send_from_directory @@ -32,6 +33,11 @@ logging.basicConfig( datefmt="%Y-%m-%d %H:%M:%S", ) +with open("./pyproject.toml", "rb") as f: + pyproject = tomllib.load(f) + version = "v" + pyproject["project"]["version"] + + app.index_string = """ @@ -70,7 +76,20 @@ app.layout = html.Div( [ html.Div( [ - html.H1("decp.info"), + html.Div( + [ + html.A(children=html.H1("decp.info"), href="/"), + html.P( + children=html.A( + version, + href="https://github.com/ColinMaudry/decp.info?tab=readme-ov-file#notes-de-version", + target="_blank", + ), + className="version", + ), + ], + className="logo", + ), html.Div( [ dcc.Link( diff --git a/src/assets/style.css b/src/assets/style.css index 00f20a0..66f426a 100644 --- a/src/assets/style.css +++ b/src/assets/style.css @@ -26,6 +26,31 @@ details > div { padding-top: 24px; } +/* Logo et version */ + +div.logo { + width: 230px; +} + +p.version { + float: left; + margin-top: 21px; + margin-left: 12px; +} + +p.version > a { + text-decoration: none; +} + +div.logo h1 { + float: left; +} + +div.logo > a { + text-decoration: none; + color: black; +} + /* Réduire la taille du texte de la colonne Objet */ td[data-dash-column="objet"] { @@ -133,11 +158,6 @@ a.nav { font-size: 120%; } -.navbar.h1 { - float: left; - width: 50%; -} - h3 { margin: 36px 0 24px 0; }