From 2435061423337c9f6ee8bc15dc1b3af556823bb2 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Wed, 27 May 2026 23:59:59 +0545 Subject: [PATCH] feat(templates): modernize base layout with Tailwind, HTMX, Alpine and authenticated UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace Django default templates with Tailwind‑styled layout, add reusable sidebar/topbar, integrate Alpine.js and HTMX for interactivity, include Chart.js placeholder, and streamline markup for authenticated views. New Features - Introduce Tailwind CSS via django‑tailwind‑cli for consistent styling - Add Alpine.js and HTMX for client‑side behavior - Add Chart.js script for future visualisation - Create reusable sidebar and topbar components for authenticated templates Enhancements - Refactor base.html to reduce duplication and improve maintainability - Add dynamic title block and extra_head/slots for extensibility - Adopt responsive layout with min‑h-screen and fixed navigation Bug Fixes- Remove stale static CSS reference that caused layout issues - Fix missing user role display and related styling - Correct viewport meta tag and charset handling --- templates/base.html | 26 ++++--------- templates/base_authenticated.html | 17 +++++++++ templates/components/sidebar.html | 61 +++++++++++++++++++++++++++++++ templates/components/topbar.html | 33 +++++++++++++++++ 4 files changed, 118 insertions(+), 19 deletions(-) create mode 100644 templates/base_authenticated.html create mode 100644 templates/components/sidebar.html create mode 100644 templates/components/topbar.html diff --git a/templates/base.html b/templates/base.html index 3607b06..aede00f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -3,30 +3,18 @@ - {% block title %}Project Management{% endblock %} + {% block title %}ProMan{% endblock %} - {% load static %} - + + {% load static tailwind_cli %} + {% tailwind_css %} + {% block extra_head %}{% endblock %} - - {% if user.is_authenticated %} - {% include "components/navbar.html" %} - {% endif %} -
- {% if messages %} -
- {% for message in messages %} -
- {{ message }} -
- {% endfor %} -
- {% endif %} - {% block content %}{% endblock %} -
+ + {% block content %}{% endblock %} {% block extra_scripts %}{% endblock %} diff --git a/templates/base_authenticated.html b/templates/base_authenticated.html new file mode 100644 index 0000000..b870d38 --- /dev/null +++ b/templates/base_authenticated.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% block content %} + {% include "components/topbar.html" %} +
+ {% include "components/sidebar.html" %} +
+ {% if messages %} + {% for message in messages %} +
+ {{ message }} +
+ {% endfor %} + {% endif %} + {% block content_inner %}{% endblock %} +
+
+{% endblock %} diff --git a/templates/components/sidebar.html b/templates/components/sidebar.html new file mode 100644 index 0000000..e80108e --- /dev/null +++ b/templates/components/sidebar.html @@ -0,0 +1,61 @@ + +
diff --git a/templates/components/topbar.html b/templates/components/topbar.html new file mode 100644 index 0000000..67e4df2 --- /dev/null +++ b/templates/components/topbar.html @@ -0,0 +1,33 @@ +