From 7d071ebc2eb4b59b6a7815ccde6787da78f6396f Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Wed, 11 Oct 2023 20:28:00 +0200 Subject: [PATCH] clean: refactor templates to use a common head section This commit introduces a refactoring in various page templates to use a central, common 'head' section, stored under utilsHead.html. This head section contains common metadata, styles, and scripts. This change enhances code reusability and standardizes the head section across different pages for consistent user experience and ease of future potential changes. Also, some minimal adjustments were made in the navigation and link routing for more user-friendly URL paths. Lastly, the server's listening interface was updated to only listen on the localhost. --- .../web/templates/componentNavbar.html | 2 +- .../gateways/web/templates/home.html | 11 ++--------- .../gateways/web/templates/login.html | 8 +------- .../gateways/web/templates/postEdit.html | 8 +------- .../gateways/web/templates/posts.html | 8 +------- .../gateways/web/templates/setup1.html | 8 +------- .../gateways/web/templates/setup2.html | 8 +------- .../gateways/web/templates/utilsHead.html | 7 +++++++ api/page.go | 19 ++++++++++++------- api/pageHome.go | 1 + api/pageLogin.go | 6 +++++- api/pagePostEdit.go | 15 +++++++++++++++ api/pagePosts.go | 1 + api/pageRegister.go | 7 ++++++- api/pageRegisterConfirm.go | 4 +++- main/server/server.go | 2 +- 16 files changed, 59 insertions(+), 56 deletions(-) create mode 100644 adapters/secondary/gateways/web/templates/utilsHead.html create mode 100644 api/pagePostEdit.go diff --git a/adapters/secondary/gateways/web/templates/componentNavbar.html b/adapters/secondary/gateways/web/templates/componentNavbar.html index 1b0f56f..192b662 100644 --- a/adapters/secondary/gateways/web/templates/componentNavbar.html +++ b/adapters/secondary/gateways/web/templates/componentNavbar.html @@ -16,7 +16,7 @@ Accueil