Merge branch 'fix_sidebar'

This commit is contained in:
Marcel Plch 2024-11-30 01:52:24 +01:00
commit 33268ee859
Signed by: dormouse
GPG key ID: 2CA77596BC4BDFFE
2 changed files with 38 additions and 24 deletions

View file

@ -22,23 +22,14 @@
<body onload="init()">
{# NAVBAR #}
<section class="navbar" id="nav">
<a href="/">
{% for path in paths %}
<a href="{{ path.href }}">
<div class="navbar-block">
Home
{{ path.name }}
</div>
</a>
{% endfor %}
<a href="/curriculum-vitae">
<div class="navbar-block">
Curriculum Vitae
</div>
<a href="/ukraine">
<div class="navbar-block">
<img src="{% static "base_app/img/ukraine.png" %}" width="16" style="display:inline">
Ukraine
</div>
</a>
<div class="navbar-button"
onclick="navbar_click()"
>

View file

@ -16,25 +16,48 @@ def get_domains():
# Create your views here.
class IndexView(TemplateView):
class GenericView(TemplateView):
def cx_handle_get(self, request, template, *args, **kwargs):
paths = [
{"href": "/",
"name": "Home"},
{"href": "/curriculum-vitae",
"name": "Curriculum Vitae"},
{"href": "/ukraine",
"name": "Ukraine"},
]
return render(request, template, {"paths" : paths})
class IndexView(GenericView):
def get(self, request, *args, **kwargs):
return render(request, "index.html", {})
paths = [
{"href": "/",
"name": "Home"},
{"href": "/curriculum-vitae",
"name": "Curriculum Vitae"},
{"href": "/ukraine",
"name": "Ukraine"},
class CVView(TemplateView):
]
return self.cx_handle_get(request, "index.html", {"paths" : paths})
class CVView(GenericView):
def get(self, request, *args, **kwargs):
return render(request, "CV.html", {})
return self.cx_handle_get(request, "CV.html", {})
class LoremView(TemplateView):
class LoremView(GenericView):
def get(self, request, *args, **kwargs):
return render(request, "lorem.html", {})
return self.cx_handle_get(request, "lorem.html", {})
class UkraineView(TemplateView):
class UkraineView(GenericView):
def get(self, request, *args, **kwargs):
domains = get_domains()
return render(request, "ukraine.html", {"domains" : domains})
return self.cx_handle_get(request, "ukraine.html", {"domains" : domains})