From 3c09fb494b9a4ef64c7b4807e07de38f07b8d230 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Mon, 29 May 2023 10:42:17 +0000 Subject: [PATCH] Rename layout to base and clean up HTML --- onlylegs/templates/{layout.html => base.html} | 148 ++++------ onlylegs/templates/error.html | 6 +- onlylegs/templates/group.html | 68 ++--- onlylegs/templates/image.html | 270 ++++++++---------- onlylegs/templates/index.html | 51 ++-- onlylegs/templates/list.html | 15 +- onlylegs/templates/profile.html | 31 +- onlylegs/templates/settings.html | 8 +- 8 files changed, 265 insertions(+), 332 deletions(-) rename onlylegs/templates/{layout.html => base.html} (58%) diff --git a/onlylegs/templates/layout.html b/onlylegs/templates/base.html similarity index 58% rename from onlylegs/templates/layout.html rename to onlylegs/templates/base.html index 890c792..59c3b06 100644 --- a/onlylegs/templates/layout.html +++ b/onlylegs/templates/base.html @@ -1,11 +1,11 @@ + + + {{ config.WEBSITE_CONF.name }} - - - @@ -16,8 +16,6 @@ - - @@ -32,26 +30,15 @@ type="image/svg+xml" media="(prefers-color-scheme: dark)"/> - - - {% assets "scripts" %} - - {% endassets %} - - {% assets "styles" %} - - {% endassets %} - + + + {% assets "scripts" %} {% endassets %} + {% assets "styles" %} {% endassets %} {% block head %}{% endblock %}
- - {% if request.path == "/" %}{% endif %}
@@ -61,63 +48,56 @@
-
+ - {% if current_user.is_authenticated %} - - {% endif %} - - - - {% if current_user.is_authenticated %} - - {% if current_user.picture %} - - - - - Profile picture - - - {% else %} - - {% endif %} - Profile - - - - - Settings - - {% else %} - - {% endif %} -
+
{% block header %}{% endblock %}
+
{% if current_user.is_authenticated %}
@@ -142,20 +122,8 @@
{% endif %} -
- {% block content %} - {% endblock %} -
- - - - - {% block script %}{% endblock %} + {% block content %}{% endblock %} +
+ + {% block script %}{% endblock %} \ No newline at end of file diff --git a/onlylegs/templates/error.html b/onlylegs/templates/error.html index 9d76c79..7e9c20c 100644 --- a/onlylegs/templates/error.html +++ b/onlylegs/templates/error.html @@ -1,7 +1,7 @@ -{% extends 'layout.html' %} +{% extends 'base.html' %} {% block content %} - +

{{error}}

{{msg}}

- +
{% endblock %} diff --git a/onlylegs/templates/group.html b/onlylegs/templates/group.html index c7c3827..211c1b5 100644 --- a/onlylegs/templates/group.html +++ b/onlylegs/templates/group.html @@ -1,5 +1,7 @@ -{% extends 'layout.html' %} +{% extends 'base.html' %} +{% from 'macros/image.html' import gallery_item %} {% block nav_groups %}selected{% endblock %} + {% block head %} {% if images %} @@ -170,16 +172,21 @@ {% endblock %} -{% block content %} + +{% block header %} {% if images %} {% endif %} +{% endblock %} +{% block content %} {% if images %} {% else %}
diff --git a/onlylegs/templates/image.html b/onlylegs/templates/image.html index e8b0f8b..b747708 100644 --- a/onlylegs/templates/image.html +++ b/onlylegs/templates/image.html @@ -1,6 +1,7 @@ -{% extends 'layout.html' %} +{% extends 'base.html' %} {% block page_index %} {% if return_page %}?page={{ return_page }}{% endif %}{% endblock %} + {% block head %} @@ -10,14 +11,16 @@ {% endblock %} -{% block content %} -
- - - - {{ image.alt }} - - -
-
-
-
- - - - {{ image.alt }} - -
+ +{% block header %} + {% endblock %} {% block script %} {% endblock %} \ No newline at end of file diff --git a/onlylegs/templates/index.html b/onlylegs/templates/index.html index e85cafb..eead3a8 100644 --- a/onlylegs/templates/index.html +++ b/onlylegs/templates/index.html @@ -1,16 +1,17 @@ -{% extends 'layout.html' %} +{% extends 'base.html' %} +{% from 'macros/image.html' import gallery_item %} {% block head %} {% endblock %} -{% block nav_home %}selected{% endblock %} -{% block content %} + +{% block header %} +{% endblock %} +{% block nav_home %}selected{% endblock %} +{% block content %} {% if images %} -