From e4d182596b0b89f2c48267d1cf3f087df558e70d Mon Sep 17 00:00:00 2001 From: kdeterme Date: Mon, 12 Oct 2026 14:20:59 +0200 Subject: [PATCH] fix(help): use dynamic PRODUCT_NAME instead of hardcoded StreetUp in help panel and docs --- loko/common/help_docs/fr/concepts.md | 6 +-- loko/common/help_docs/fr/creer_controle.md | 2 +- loko/common/help_docs/fr/prise_en_main.md | 4 +- .../help_docs/fr/statuts_intervention.md | 2 +- loko/common/help_docs/nl/concepts.md | 6 +-- loko/common/help_docs/nl/creer_controle.md | 2 +- loko/common/help_docs/nl/prise_en_main.md | 4 +- .../help_docs/nl/statuts_intervention.md | 2 +- loko/common/locale/en/LC_MESSAGES/django.mo | Bin 7601 -> 7716 bytes loko/common/locale/en/LC_MESSAGES/django.po | 10 +++-- loko/common/locale/fr/LC_MESSAGES/django.mo | Bin 9513 -> 9545 bytes loko/common/locale/fr/LC_MESSAGES/django.po | 10 +++-- loko/common/locale/nl/LC_MESSAGES/django.mo | Bin 7095 -> 7302 bytes loko/common/locale/nl/LC_MESSAGES/django.po | 10 +++-- .../common/components/help_panel.html | 4 +- loko/common/tests.py | 41 ++++++++++++++++++ loko/common/views.py | 11 +++++ 17 files changed, 86 insertions(+), 28 deletions(-) diff --git a/loko/common/help_docs/fr/concepts.md b/loko/common/help_docs/fr/concepts.md index 11ec9e2..4b31fe2 100644 --- a/loko/common/help_docs/fr/concepts.md +++ b/loko/common/help_docs/fr/concepts.md @@ -1,12 +1,12 @@ -# Concepts clés de StreetUp +# Concepts clés de {product_name} -StreetUp organise la gestion du patrimoine et des opérations terrain autour de plusieurs notions fondamentales. Comprendre leurs rôles et leurs distinctions permet d'optimiser l'utilisation de la plateforme. +{product_name} organise la gestion du patrimoine et des opérations terrain autour de plusieurs notions fondamentales. Comprendre leurs rôles et leurs distinctions permet d'optimiser l'utilisation de la plateforme. --- ## 1. Vue d'ensemble du cycle de vie -L'écosystème StreetUp s'articule autour du cycle suivant : +L'écosystème {product_name} s'articule autour du cycle suivant : 1. **Patrimoine** (`Asset`) : Les équipements physiques présents sur le terrain. 2. **Constat & Diagnostic** (`Observation` / `Inspection`) : Ce que l'on signale à chaud ou ce que l'on contrôle de manière formelle. 3. **Travaux & Maintenance** (`Intervention` / `Projet`) : L'action corrective ou préventive menée sur le terrain. diff --git a/loko/common/help_docs/fr/creer_controle.md b/loko/common/help_docs/fr/creer_controle.md index c899361..fb06d76 100644 --- a/loko/common/help_docs/fr/creer_controle.md +++ b/loko/common/help_docs/fr/creer_controle.md @@ -34,7 +34,7 @@ Une fois le contrôle créé, vous pouvez y ajouter des remarques spécifiques p 5. Cliquez sur **Enregistrer** pour lier ces remarques au rapport de contrôle. ## 4. Réaliser des contrôles sur le terrain (Application Hors-ligne) -Pour faciliter les contrôles directement sur site, StreetUp dispose d'une application mobile dédiée (PWA) : +Pour faciliter les contrôles directement sur site, {product_name} dispose d'une application mobile dédiée (PWA) : - **Installation** : Lors de votre connexion sur mobile ou tablette, l'application vous propose d'ajouter le raccourci "Contrôles" sur votre écran d'accueil. - **Fonctionnement hors-ligne** : Vous pouvez réaliser l'ensemble de votre contrôle, noter vos remarques de conformité et prendre des photos, même dans les zones sans couverture réseau (4G/Wi-Fi). - **Synchronisation automatique** : Dès que votre appareil retrouve une connexion Internet, vos rapports de contrôles et photos sont synchronisés de manière transparente avec le serveur central. diff --git a/loko/common/help_docs/fr/prise_en_main.md b/loko/common/help_docs/fr/prise_en_main.md index 80a76ec..8055555 100644 --- a/loko/common/help_docs/fr/prise_en_main.md +++ b/loko/common/help_docs/fr/prise_en_main.md @@ -1,6 +1,6 @@ -# Prise en main de StreetUp +# Prise en main de {product_name} -Bienvenue dans StreetUp ! Ce guide rapide va vous présenter les bases de la navigation et de l'utilisation de l'application. +Bienvenue dans {product_name} ! Ce guide rapide va vous présenter les bases de la navigation et de l'utilisation de l'application. ## 1. La barre de navigation principale (Header) En haut de votre écran, vous trouverez la barre d'outils contenant : diff --git a/loko/common/help_docs/fr/statuts_intervention.md b/loko/common/help_docs/fr/statuts_intervention.md index 815a62a..4bd00bb 100644 --- a/loko/common/help_docs/fr/statuts_intervention.md +++ b/loko/common/help_docs/fr/statuts_intervention.md @@ -1,6 +1,6 @@ # Statuts des interventions -Le cycle de vie d'une intervention dans StreetUp est jalonné par 15 statuts successifs. Chaque statut correspond à une étape précise de planification, de réalisation ou de validation administrative. +Le cycle de vie d'une intervention dans {product_name} est jalonné par 15 statuts successifs. Chaque statut correspond à une étape précise de planification, de réalisation ou de validation administrative. Voici l'explication détaillée de chaque étape : diff --git a/loko/common/help_docs/nl/concepts.md b/loko/common/help_docs/nl/concepts.md index 7bb7a50..5dd664f 100644 --- a/loko/common/help_docs/nl/concepts.md +++ b/loko/common/help_docs/nl/concepts.md @@ -1,12 +1,12 @@ -# Sleutelbegrippen in StreetUp +# Sleutelbegrippen in {product_name} -StreetUp organiseert het beheer van de openbare ruimte en terreinoperaties rond verschillende fundamentele begrippen. Het begrijpen van hun rol en onderlinge verschillen helpt om het platform optimaal te gebruiken. +{product_name} organiseert het beheer van de openbare ruimte en terreinoperaties rond verschillende fundamentele begrippen. Het begrijpen van hun rol en onderlinge verschillen helpt om het platform optimaal te gebruiken. --- ## 1. Overzicht van de levenscyclus -Het StreetUp-ecosysteem is opgebouwd rond de volgende cyclus: +Het {product_name}-ecosysteem is opgebouwd rond de volgende cyclus: 1. **Patrimonium** (`Asset`): Fysieke uitrustingen op het terrein. 2. **Vaststelling & Diagnose** (`Observatie` / `Inspectie`): Meldingen ter plaatse of formele controles. 3. **Werken & Onderhoud** (`Interventie` / `Project`): Correctieve of preventieve acties op het terrein. diff --git a/loko/common/help_docs/nl/creer_controle.md b/loko/common/help_docs/nl/creer_controle.md index 307e325..eadaf16 100644 --- a/loko/common/help_docs/nl/creer_controle.md +++ b/loko/common/help_docs/nl/creer_controle.md @@ -34,7 +34,7 @@ Nadat de controle is aangemaakt, kunt u specifieke opmerkingen toevoegen om uw v 5. Klik op **Opslaan** om deze opmerkingen aan het controlerapport te koppelen. ## 4. Controles uitvoeren op het terrein (Offline applicatie) -Om controles rechtstreeks op het terrein te vergemakkelijken, heeft StreetUp een speciale mobiele applicatie (PWA): +Om controles rechtstreeks op het terrein te vergemakkelijken, heeft {product_name} een speciale mobiele applicatie (PWA): - **Installatie**: Wanneer u inlogt op een mobiel apparaat of tablet, stelt de applicatie voor om de snelkoppeling "Controles" aan uw startscherm toe te voegen. - **Offline werking**: U kunt uw volledige controle uitvoeren, uw opmerkingen over de conformiteit noteren en foto's maken, zelfs in zones zonder netwerkbereik (4G/Wi-Fi). - **Automatische synchronisatie**: Zodra uw apparaat weer verbinding heeft met internet, worden uw controlerapporten en foto's naadloos gesynchroniseerd met de centrale server. diff --git a/loko/common/help_docs/nl/prise_en_main.md b/loko/common/help_docs/nl/prise_en_main.md index 15004db..4e8b262 100644 --- a/loko/common/help_docs/nl/prise_en_main.md +++ b/loko/common/help_docs/nl/prise_en_main.md @@ -1,6 +1,6 @@ -# Aan de slag met StreetUp +# Aan de slag met {product_name} -Welkom bij StreetUp! Deze snelle handleiding toont u de basisprincipes van navigatie en gebruik van de applicatie. +Welkom bij {product_name}! Deze snelle handleiding toont u de basisprincipes van navigatie en gebruik van de applicatie. ## 1. De hoofdnavigatiebalk (Header) Bovenaan uw scherm vindt u de knoppenbalk met: diff --git a/loko/common/help_docs/nl/statuts_intervention.md b/loko/common/help_docs/nl/statuts_intervention.md index 754dee4..04d23b4 100644 --- a/loko/common/help_docs/nl/statuts_intervention.md +++ b/loko/common/help_docs/nl/statuts_intervention.md @@ -1,6 +1,6 @@ # Statussen van interventies -De levenscyclus van een interventie in StreetUp wordt gekenmerkt door 15 opeenvolgende statussen. Elke status komt overeen met een specifieke fase van planning, uitvoering of administratieve validatie. +De levenscyclus van een interventie in {product_name} wordt gekenmerkt door 15 opeenvolgende statussen. Elke status komt overeen met een specifieke fase van planning, uitvoering of administratieve validatie. Hier is de gedetailleerde uitleg van elke stap: diff --git a/loko/common/locale/en/LC_MESSAGES/django.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uev@@s3!BFn&@1>8>r@b zfV6`>Lftou+Jbr1R)#Z~=1b+o3t$DPKx$BxtwZ%(qr*U@xr~bF32Nd=RH^4N1HYg$ zi)KGm;v8gKEf3XX6{tWCp`JgE>h=q$1$$6|Uq@A-9~D^LLk4QL7pP3%px)mvSc%`! zgC+c*B?j}M0=SBrs1KFNFzUWJ)KZ*EE%Psi_Pb8_ zd);1FhyS^|+I85U6y|kp8Z8e?4t7_!w>34j*R+n_O)U#qxtfff4PCkV|F?ZXe*lv9 Bx7z>! diff --git a/loko/common/locale/fr/LC_MESSAGES/django.po b/loko/common/locale/fr/LC_MESSAGES/django.po index b125da3..26aab10 100644 --- a/loko/common/locale/fr/LC_MESSAGES/django.po +++ b/loko/common/locale/fr/LC_MESSAGES/django.po @@ -232,16 +232,18 @@ msgid "Rechercher un guide..." msgstr "Rechercher un guide..." #: common/templates/common/components/help_panel.html:46 -msgid "Prise en main de StreetUp" -msgstr "Prise en main de StreetUp" +#, python-format +msgid "Prise en main de %(product_name)s" +msgstr "Prise en main de %(product_name)s" #: common/templates/common/components/help_panel.html:47 msgid "Découvrez les bases de l'application, la navigation et le menu." msgstr "Découvrez les bases de l'application, la navigation et le menu." #: common/templates/common/components/help_panel.html:55 -msgid "Concepts et notions clés de StreetUp" -msgstr "Concepts et notions clés de StreetUp" +#, python-format +msgid "Concepts et notions clés de %(product_name)s" +msgstr "Concepts et notions clés de %(product_name)s" #: common/templates/common/components/help_panel.html:56 msgid "Comprendre la différence entre Assets, Observations, Inspections, Interventions et Contrôles." diff --git a/loko/common/locale/nl/LC_MESSAGES/django.mo b/loko/common/locale/nl/LC_MESSAGES/django.mo index d8192e42442eb717583326d34451cf85ae349aa8..55ed8b0083dd8086a2d6db296b46a6fb0b42d6d1 100644 GIT binary patch delta 2351 zcmZwHe`r-@9LMqR=C*Xx=8x3e$~{+|?y7ThIXA7et-Dsa)Y_WA(sg$|ts8fDce{6? zP+jW}Nw5fFM57!+P#P#?V2U7er64G_j1Wct5<)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!f(KDdBpWE9&m&2;Lq6Ps`oI-oshCQf1ozmE5R zMQ8dq`duyQbD*8bq(e8lB&#r)Ph~3=8`^`_cmnUhPov)>%NTycS$G9~?-rWcYA#%Y zWoUbSI0Hw}j$cDFw-1-#VQj;1s>#12y3P$#_$QjW6bnh)p&YptW}=&`32mqy9Z(is zs$R6iA!O2F1f9SxOyhgF0gq!dUPT95Q$zmku#@52P!1hoKlqK|kDwyc$lU zGdzb5_#*m#F?u6DuVqvYD1&CI1KCa?hwimLbdMx2QL%$J(X~2-j`$4HR=9|EbQx{v z4|L6MqBCru6~AvqzaK!CY6!b=I9?w^J_#q$0e_B6JPAL?8#m(%b>zpjX+byT2INr~ z!A5)?{YP~QP4$oHX}N-S;KKWU9okWAbS*mYJUY;~vC{MZ4i#tk0n$b|gMRn}n!+O5 z!SC^T1rNgM-gbj5Q^@PQlS=JG@wTbZPJw!PB9>QgEGv4R=Z=>=U;Rsg~eZ5KH5=`^eHeM(OuKesiwBYqW|;6XRt)l_!Wb z<2Uee;(`BN-yQ3&x%;mKBnz17(H3W?V}bZq44G`WM{_q1*rf diff --git a/loko/common/locale/nl/LC_MESSAGES/django.po b/loko/common/locale/nl/LC_MESSAGES/django.po index bc848c5..ab11c32 100644 --- a/loko/common/locale/nl/LC_MESSAGES/django.po +++ b/loko/common/locale/nl/LC_MESSAGES/django.po @@ -232,16 +232,18 @@ msgid "Rechercher un guide..." msgstr "" #: common/templates/common/components/help_panel.html:46 -msgid "Prise en main de StreetUp" -msgstr "" +#, python-format +msgid "Prise en main de %(product_name)s" +msgstr "Aan de slag met %(product_name)s" #: common/templates/common/components/help_panel.html:47 msgid "Découvrez les bases de l'application, la navigation et le menu." msgstr "" #: common/templates/common/components/help_panel.html:55 -msgid "Concepts et notions clés de StreetUp" -msgstr "" +#, python-format +msgid "Concepts et notions clés de %(product_name)s" +msgstr "Sleutelbegrippen van %(product_name)s" #: common/templates/common/components/help_panel.html:56 msgid "Comprendre la différence entre Assets, Observations, Inspections, Interventions et Contrôles." diff --git a/loko/common/templates/common/components/help_panel.html b/loko/common/templates/common/components/help_panel.html index 18c7b75..a5756d7 100644 --- a/loko/common/templates/common/components/help_panel.html +++ b/loko/common/templates/common/components/help_panel.html @@ -43,7 +43,7 @@
- +
@@ -52,7 +52,7 @@
- +
diff --git a/loko/common/tests.py b/loko/common/tests.py index 48fbb8e..296cc2f 100644 --- a/loko/common/tests.py +++ b/loko/common/tests.py @@ -627,3 +627,44 @@ class TerritoryTests(TestCase): self.assertEqual(boundary_feature["geometry"]["type"], "MultiPolygon") +class HelpDocumentTests(TestCase): + def setUp(self): + self.user = User.objects.create_user(username="help_user", password="password123") + self.config = UserConfig.objects.create(user=self.user) + + def test_get_help_document_replaces_product_name(self): + self.client.force_login(self.user) + with self.settings(PRODUCT_NAME="LokoCustom"): + response = self.client.get(reverse("common:get_help_document", kwargs={"doc_name": "prise_en_main"})) + self.assertEqual(response.status_code, 200) + data = response.json() + self.assertIn("html", data) + self.assertIn("LokoCustom", data["html"]) + self.assertNotIn("StreetUp", data["html"]) + + def test_help_panel_template_renders_product_name(self): + from django.template.loader import render_to_string + from django.utils import translation + + with translation.override("fr"): + rendered_fr = render_to_string("common/components/help_panel.html", { + "product_name": "LokoTest", + "user": self.user, + }) + self.assertIn("Prise en main de LokoTest", rendered_fr) + self.assertIn("Concepts et notions clés de LokoTest", rendered_fr) + self.assertNotIn("StreetUp", rendered_fr) + + with translation.override("nl"): + rendered_nl = render_to_string("common/components/help_panel.html", { + "product_name": "LokoTest", + "user": self.user, + }) + self.assertIn("Aan de slag met LokoTest", rendered_nl) + self.assertIn("Sleutelbegrippen van LokoTest", rendered_nl) + self.assertNotIn("StreetUp", rendered_nl) + + + + + diff --git a/loko/common/views.py b/loko/common/views.py index c5c7cec..984a718 100644 --- a/loko/common/views.py +++ b/loko/common/views.py @@ -815,6 +815,17 @@ def get_help_document(request, doc_name): except Exception: return JsonResponse({'error': _('Erreur lors de la lecture du document')}, status=500) + # Dynamic variables replacement (e.g. PRODUCT_NAME, ORGANIZATION_NAME) + product_name = getattr(settings, 'PRODUCT_NAME', 'Loko') + organization_name = getattr(settings, 'ORGANIZATION_NAME', 'Loko') + md_content = ( + md_content + .replace('{product_name}', product_name) + .replace('{{ product_name }}', product_name) + .replace('{organization_name}', str(organization_name)) + .replace('{{ organization_name }}', str(organization_name)) + ) + # Convert Markdown to HTML html_content = markdown.markdown(md_content, extensions=['extra', 'nl2br'])