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.mo b/loko/common/locale/en/LC_MESSAGES/django.mo index a64342f..b0c1c16 100644 Binary files a/loko/common/locale/en/LC_MESSAGES/django.mo and b/loko/common/locale/en/LC_MESSAGES/django.mo differ diff --git a/loko/common/locale/en/LC_MESSAGES/django.po b/loko/common/locale/en/LC_MESSAGES/django.po index 5c1f710..8264b88 100644 --- a/loko/common/locale/en/LC_MESSAGES/django.po +++ b/loko/common/locale/en/LC_MESSAGES/django.po @@ -240,16 +240,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 "Getting started with %(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 "Key concepts of %(product_name)s" #: common/templates/common/components/help_panel.html:56 msgid "" diff --git a/loko/common/locale/fr/LC_MESSAGES/django.mo b/loko/common/locale/fr/LC_MESSAGES/django.mo index 94e12ae..6d41700 100644 Binary files a/loko/common/locale/fr/LC_MESSAGES/django.mo and b/loko/common/locale/fr/LC_MESSAGES/django.mo differ 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 d8192e4..55ed8b0 100644 Binary files a/loko/common/locale/nl/LC_MESSAGES/django.mo and b/loko/common/locale/nl/LC_MESSAGES/django.mo differ 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'])