Fix sidebar
It is not entirely fixed, but it's at least generated from django data now. Should make it fairly easier to make it behave better.
This commit is contained in:
parent
3455ffa89f
commit
8752197c2c
2 changed files with 38 additions and 24 deletions
|
@ -22,23 +22,14 @@
|
|||
<body onload="init()">
|
||||
{# NAVBAR #}
|
||||
<section class="navbar" id="nav">
|
||||
{% for path in paths %}
|
||||
<a href="{{ path.href }}">
|
||||
<div class="navbar-block">
|
||||
{{ path.name }}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
<a href="/">
|
||||
<div class="navbar-block">
|
||||
Home
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<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()"
|
||||
>
|
||||
|
|
|
@ -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})
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue