diff --git a/base_app/templates/layout.html b/base_app/templates/layout.html
index 9890218..52397be 100644
--- a/base_app/templates/layout.html
+++ b/base_app/templates/layout.html
@@ -22,23 +22,14 @@
{# NAVBAR #}
+ {% for path in paths %}
+
+
+ {{ path.name }}
+
+
+ {% endfor %}
-
-
- Home
-
-
-
-
-
- Curriculum Vitae
-
-
-
-
- Ukraine
-
-
diff --git a/base_app/views.py b/base_app/views.py
index cecb0d5..cbf7b20 100644
--- a/base_app/views.py
+++ b/base_app/views.py
@@ -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})