feat: add navigation context processor and update header template
All checks were successful
Build and Push Docker Image / build (push) Successful in 27s
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:
2
santehray/context_processors.py
Normal file
2
santehray/context_processors.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
def navigation(request):
|
||||||
|
return {"active": ""}
|
||||||
@@ -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
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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 %}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user