From b8e64cdeddae07bc7558cbc593b33e1059243615 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Thu, 31 Jul 2025 19:21:24 +0200 Subject: [PATCH] Improved loading of custom logos for the frontend. --- doc/configuration.rst | 14 ++++++++++- frontend/public/config.json | 4 +--- frontend/src/components/shared/NavBar.vue | 23 ++++++++++++++++++- .../src/components/tools/CreationForm.vue | 17 +++++++++----- .../management/commands/load_initial_data.py | 10 +------- 5 files changed, 48 insertions(+), 20 deletions(-) diff --git a/doc/configuration.rst b/doc/configuration.rst index 2caff6679..b45ef47e3 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -193,7 +193,7 @@ Custom logo =========== You have the possibility to use a custom logo instead of the default -one on the login page. +one on the login page and inside generated PDF documents. To do so, open the :file:`settings.py` file and add a ``MODOBOA_CUSTOM_LOGO`` variable. This variable must contain the @@ -204,6 +204,18 @@ relative URL of your logo under ``MEDIA_URL``. For example:: Then copy your logo file into the directory indicated by ``MEDIA_ROOT``. +You can also customize the logo(s) used in the frontend application +(left menu and creation forms). + +To do so, copy the corresponding files inside the frontend directory +directly (defaults to ``/srv/modoboa/instance/frontend``). + +Then, edit the :file:`config.json` file located in this very same +directory and add the following variables:: + + "MENU_LOGO_PATH": "/cusrtom_logo.png", + "CREATION_FORM_LOGO_PATH": "/custom_logo2.png" + ****************** Host configuration ****************** diff --git a/frontend/public/config.json b/frontend/public/config.json index 752b63e3a..105af1242 100644 --- a/frontend/public/config.json +++ b/frontend/public/config.json @@ -5,7 +5,5 @@ "OAUTH_CLIENT_ID": "LVQbfIIX3khWR3nDvix1u9yEGHZUxcx53bhJ7FlD", "OAUTH_REDIRECT_URI": "/login/logged", "OAUTH_POST_REDIRECT_URI": "/", - "HTML_PAGE_TITLE": "Test title", - "MENU_LOGO_PATH": "/src/assets/Modoboa_RVB-BLANC-SANS.png", - "CREATION_FORM_LOGO_PATH": "/src/assets/Modoboa_RVB-BLEU-SANS.png" + "HTML_PAGE_TITLE": "Test title" } diff --git a/frontend/src/components/shared/NavBar.vue b/frontend/src/components/shared/NavBar.vue index a238a9f0c..3e5115691 100644 --- a/frontend/src/components/shared/NavBar.vue +++ b/frontend/src/components/shared/NavBar.vue @@ -8,7 +8,7 @@ >