From 2b941cb30ff2c67482c138047fc8835854fd08ab Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sun, 11 Feb 2024 18:43:23 +0100 Subject: [PATCH] Rearrange base template with separated contents, add sidebar Signed-off-by: Emmy D'Anello --- .../templates/participation/team_list.html | 2 +- .../participation/tournament_list.html | 2 +- tfjm/templates/about.html | 2 +- tfjm/templates/base.html | 225 ++---------------- tfjm/templates/footer.html | 50 ++++ tfjm/templates/messages.html | 8 + tfjm/templates/navbar.html | 124 ++++++++++ tfjm/templates/registration/login.html | 2 +- tfjm/templates/sidebar.html | 13 + 9 files changed, 224 insertions(+), 204 deletions(-) create mode 100644 tfjm/templates/footer.html create mode 100644 tfjm/templates/messages.html create mode 100644 tfjm/templates/navbar.html create mode 100644 tfjm/templates/sidebar.html diff --git a/participation/templates/participation/team_list.html b/participation/templates/participation/team_list.html index 17006a5..7f8dc3a 100644 --- a/participation/templates/participation/team_list.html +++ b/participation/templates/participation/team_list.html @@ -2,7 +2,7 @@ {% load django_tables2 i18n %} -{% block contenttitle %} +{% block content-title %}

{% trans "All teams" %}

{% endblock %} diff --git a/participation/templates/participation/tournament_list.html b/participation/templates/participation/tournament_list.html index 3af9359..1ee5972 100644 --- a/participation/templates/participation/tournament_list.html +++ b/participation/templates/participation/tournament_list.html @@ -2,7 +2,7 @@ {% load django_tables2 i18n %} -{% block contenttitle %} +{% block content-title %}

{% trans "All tournaments" %}

{% endblock %} diff --git a/tfjm/templates/about.html b/tfjm/templates/about.html index 6fcc662..255328c 100644 --- a/tfjm/templates/about.html +++ b/tfjm/templates/about.html @@ -1,6 +1,6 @@ {% extends "base.html" %} -{% block contenttitle %} +{% block content-title %}

À propos

{% endblock %} diff --git a/tfjm/templates/base.html b/tfjm/templates/base.html index ec4f0c4..383edbe 100644 --- a/tfjm/templates/base.html +++ b/tfjm/templates/base.html @@ -1,15 +1,15 @@ -{% load static i18n static %} +{% load i18n static %} {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %} - + {% block title %}{{ title }}{% endblock title %} - Plateforme du TFJM² - + {# Favicon #} @@ -25,7 +25,7 @@ {# Bootstrap JavaScript #} - {# bootstrap-select for beautyful selects and JQuery dependency #} + {# bootstrap-select for beautiful selects and JQuery dependency #} @@ -38,206 +38,31 @@ {% block extracss %}{% endblock %} - -
- {% block fullcontent %} -
- {% block contenttitle %}

{{ title }}

{% endblock %} - {% if user.is_authenticated and not user.registration.email_confirmed %} - - {% endif %} -
- {% for message in messages %} - - {% endfor %} -
-
- {% block content %} -

Default content...

- {% endblock content %} -
-
- {% endblock %} -
+{% include "navbar.html" %} -
-
-
- -
-
- {% csrf_token %} -   - -
-
-
+
+ - {% trans "About" %}   —   - - - -
-
- - - +
+
+ {% block content-title %}

{{ title }}

{% endblock %} + + {% include "messages.html" %} + +
+ {% block content %} +

Default content...

+ {% endblock content %}
-
-
+ + + + + +{% include "footer.html" %} {% trans "All tournaments" as modal_title %} {% include "base_modal.html" with modal_id="tournamentList" modal_additional_class="modal-lg" %} diff --git a/tfjm/templates/footer.html b/tfjm/templates/footer.html new file mode 100644 index 0000000..f119d0f --- /dev/null +++ b/tfjm/templates/footer.html @@ -0,0 +1,50 @@ +{% load i18n static %} +{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %} + +
+
+
+ +
+
+ {% csrf_token %} +   + +
+
+
+ + {% trans "About" %}   —   + + + +
+
+ + + +
+
+
+
\ No newline at end of file diff --git a/tfjm/templates/messages.html b/tfjm/templates/messages.html new file mode 100644 index 0000000..172f4d8 --- /dev/null +++ b/tfjm/templates/messages.html @@ -0,0 +1,8 @@ +
+ {% for message in messages %} + + {% endfor %} +
diff --git a/tfjm/templates/navbar.html b/tfjm/templates/navbar.html new file mode 100644 index 0000000..00a0127 --- /dev/null +++ b/tfjm/templates/navbar.html @@ -0,0 +1,124 @@ +{% load i18n static %} + + \ No newline at end of file diff --git a/tfjm/templates/registration/login.html b/tfjm/templates/registration/login.html index 09c4703..f033a0b 100644 --- a/tfjm/templates/registration/login.html +++ b/tfjm/templates/registration/login.html @@ -5,7 +5,7 @@ SPDX-License-Identifier: GPL-2.0-or-later {% load i18n crispy_forms_filters %} {% block title %}{% trans "Log in" %}{% endblock %} -{% block contenttitle %}

{% trans "Log in" %}

{% endblock %} +{% block content-title %}

{% trans "Log in" %}

{% endblock %} {% block content %} {% if user.is_authenticated %} diff --git a/tfjm/templates/sidebar.html b/tfjm/templates/sidebar.html new file mode 100644 index 0000000..b44e4e0 --- /dev/null +++ b/tfjm/templates/sidebar.html @@ -0,0 +1,13 @@ +{% load i18n %} + +
+ {% if user.is_authenticated and not user.registration.email_confirmed %} + + {% endif %} +