From 213f30925ecc423d349dbf0c0628b42981f8590a Mon Sep 17 00:00:00 2001
From: Thomas NOEL <tnoel@entrouvert.com>
Date: Mon, 29 Aug 2022 18:01:51 +0200
Subject: [PATCH] templates: create a base public template (#65381)

---
 .../manager/templates/lingo/manager_base.html | 11 +++++--
 .../templates/lingo/manager_homepage.html     |  2 +-
 lingo/templates/lingo/base.html               |  9 -----
 lingo/templates/lingo/homepage.html           | 33 ++++++++++++++++++-
 .../templates/lingo/mellon_base_template.html |  6 ++++
 lingo/templates/registration/login.html       |  2 +-
 lingo/urls.py                                 |  2 +-
 7 files changed, 50 insertions(+), 15 deletions(-)
 delete mode 100644 lingo/templates/lingo/base.html
 create mode 100644 lingo/templates/lingo/mellon_base_template.html

diff --git a/lingo/manager/templates/lingo/manager_base.html b/lingo/manager/templates/lingo/manager_base.html
index c0835b3..5ceaada 100644
--- a/lingo/manager/templates/lingo/manager_base.html
+++ b/lingo/manager/templates/lingo/manager_base.html
@@ -1,5 +1,9 @@
-{% extends "lingo/base.html" %}
-{% load i18n static %}
+{% extends "gadjo/base.html" %}
+{% load i18n static gadjo %}
+{% block page-title %}Lingo{% endblock %}
+{% block site-title %}Lingo{% endblock %}
+
+{% block logout-url %}{% url "auth_logout" %}{% endblock %}
 
 {% block extrascripts %}
 {{ block.super }}
@@ -10,3 +14,6 @@
 {{ block.super }}
 <a href="{% url 'lingo-manager-homepage' %}">{% trans "Payments" %}</a>
 {% endblock %}
+
+{% block content %}
+{% endblock %}
diff --git a/lingo/manager/templates/lingo/manager_homepage.html b/lingo/manager/templates/lingo/manager_homepage.html
index 8490e01..322c304 100644
--- a/lingo/manager/templates/lingo/manager_homepage.html
+++ b/lingo/manager/templates/lingo/manager_homepage.html
@@ -1,4 +1,4 @@
-{% extends "lingo/base.html" %}
+{% extends "lingo/manager_base.html" %}
 {% load i18n %}
 
 {% block appbar %}
diff --git a/lingo/templates/lingo/base.html b/lingo/templates/lingo/base.html
deleted file mode 100644
index 636aeda..0000000
--- a/lingo/templates/lingo/base.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "gadjo/base.html" %}
-{% load i18n static gadjo %}
-{% block page-title %}Lingo{% endblock %}
-{% block site-title %}Lingo{% endblock %}
-
-{% block logout-url %}{% url "auth_logout" %}{% endblock %}
-
-{% block content %}
-{% endblock %}
diff --git a/lingo/templates/lingo/homepage.html b/lingo/templates/lingo/homepage.html
index 985ec62..69f6007 100644
--- a/lingo/templates/lingo/homepage.html
+++ b/lingo/templates/lingo/homepage.html
@@ -1 +1,32 @@
-{% extends "lingo/base.html" %}
+{% load static gadjo i18n %}<!DOCTYPE html>
+<html>
+ <head>
+  <meta charset="utf-8"/>
+  <title>Lingo - {% trans "Payments" %}</title>
+ </head>
+ <body>
+ <div id="title"><h1>{% trans "Payments" %}</h1></div>
+ <div id="content">
+
+  {% block messages %}
+    {% if messages %}
+    <div id="messages">
+      <ul class="messages">
+        {% for message in messages %}
+        <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
+        {% endfor %}
+      </ul>
+    </div>
+    {% endif %}
+  {% endblock %}
+
+  {% block lingo-content %}
+  {% endblock %}
+ </div>
+ <div id="footer">
+  {% block footer %}
+    <span style="display: none">{% now "Y-m-d H:i:s" %}</span> {# generation time #}
+  {% endblock %}
+ </div>
+ </body>
+</html>
diff --git a/lingo/templates/lingo/mellon_base_template.html b/lingo/templates/lingo/mellon_base_template.html
new file mode 100644
index 0000000..b8ecabb
--- /dev/null
+++ b/lingo/templates/lingo/mellon_base_template.html
@@ -0,0 +1,6 @@
+{% extends "lingo/homepage.html" %}
+
+{% block lingo-content %}
+{% block mellon_content %}
+{% endblock %}
+{% endblock %}
diff --git a/lingo/templates/registration/login.html b/lingo/templates/registration/login.html
index e4fc477..9e3ced3 100644
--- a/lingo/templates/registration/login.html
+++ b/lingo/templates/registration/login.html
@@ -1,4 +1,4 @@
-{% extends "lingo/base.html" %}
+{% extends "lingo/manager_base.html" %}
 {% load i18n %}
 
 {% block content %}
diff --git a/lingo/urls.py b/lingo/urls.py
index 1e18323..af273a2 100644
--- a/lingo/urls.py
+++ b/lingo/urls.py
@@ -40,7 +40,7 @@ if 'mellon' in settings.INSTALLED_APPS:
             r'^accounts/mellon/',
             include('mellon.urls'),
             kwargs={
-                'template_base': 'lingo/base.html',
+                'template_base': 'lingo/mellon_base_template.html',
             },
         )
     )
-- 
2.35.1

