feat: add navigation context processor and update header template
All checks were successful
Build and Push Docker Image / build (push) Successful in 27s

- Created `navigation` context processor to manage `active` context
- Integrated the processor into Django settings
- Simplified `header.html` by removing `{% with %}` for `active` management
This commit is contained in:
2026-04-21 17:27:12 +02:00
parent fba29b7a6c
commit c4eb40f265
3 changed files with 3 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
def navigation(request):
return {"active": ""}

View File

@@ -205,6 +205,7 @@ TEMPLATES = [
'django.template.context_processors.request', 'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth', 'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages', 'django.contrib.messages.context_processors.messages',
'santehray.context_processors.navigation',
], ],
'debug': DEBUG 'debug': DEBUG
}, },

View File

@@ -1,5 +1,4 @@
<!-- HEADER FRAGMENT --> <!-- HEADER FRAGMENT -->
{% with active=active|default:'' %}
<header> <header>
<div class="container"> <div class="container">
<div class="header-top"> <div class="header-top">
@@ -73,4 +72,3 @@
</nav> </nav>
</div> </div>
</header> </header>
{% endwith %}