From e8df977bedc3769a266bc04d6acd1a3e8aff00e1 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Mon, 5 Jun 2023 18:56:35 +0200 Subject: [PATCH] links page --- gawa/blog/templates/blog/blogpost.html | 2 +- gawa/blog/templates/blog/featured.html | 4 +- gawa/start/admin.py | 9 ++ gawa/start/migrations/0005_link.py | 26 ++++ .../0006_alter_searchable_title_en.py | 18 +++ gawa/start/models.py | 28 ++++- gawa/start/templates/base.html | 2 +- .../blog => start/templates}/nav.html | 34 +++++- gawa/start/templates/start/links.html | 113 ++++++++++++++++++ gawa/start/templates/start/nav.html | 74 ------------ gawa/start/urls.py | 1 + gawa/start/views.py | 10 +- 12 files changed, 237 insertions(+), 84 deletions(-) create mode 100644 gawa/start/migrations/0005_link.py create mode 100644 gawa/start/migrations/0006_alter_searchable_title_en.py rename gawa/{blog/templates/blog => start/templates}/nav.html (62%) create mode 100644 gawa/start/templates/start/links.html delete mode 100644 gawa/start/templates/start/nav.html diff --git a/gawa/blog/templates/blog/blogpost.html b/gawa/blog/templates/blog/blogpost.html index d0ddb4f..da1713b 100644 --- a/gawa/blog/templates/blog/blogpost.html +++ b/gawa/blog/templates/blog/blogpost.html @@ -4,7 +4,7 @@ {% block languagecode %}{{ LANGUAGE_CODE }}{% endblock languagecode %} {% block title %}{% translate "cscherr.de" %} - {% translate "Blog" %}{% endblock title %} {% block nav %} -{% include 'blog/nav.html' %} +{% include 'nav.html' %} {% endblock nav %} {% block headscripts %} - diff --git a/gawa/start/urls.py b/gawa/start/urls.py index 9049a6b..cf2981d 100644 --- a/gawa/start/urls.py +++ b/gawa/start/urls.py @@ -7,6 +7,7 @@ urlpatterns = [ path("", views.Index.as_view(), name="index"), path("search/", views.MainSearch.as_view(), name="search"), path("legal/", views.LegalInfo.as_view(), name="legal"), + path("links/", views.Links.as_view(), name="links"), path("professional/", views.LegalInfo.as_view(), name="professional"), path('language/activate//', views.ActivateLanguage.as_view(), name='activate_language'), ] diff --git a/gawa/start/views.py b/gawa/start/views.py index a0fd0bc..696de0e 100644 --- a/gawa/start/views.py +++ b/gawa/start/views.py @@ -15,7 +15,7 @@ from django.views.generic.list import QuerySet from django.db.models import Q from .forms import MainSearchForm -from .models import Searchable +from .models import Link, Searchable from abc import ABC @@ -94,3 +94,11 @@ class MainSearch(ListView): if not form.is_valid(): return render(request, "errors/bad_request.html") return super().get(request, *args, **kwargs) + +class Links(ListView): + """ + This View contains links to various interesting sites. + """ + model = Link + context_object_name = "links" + template_name = "start/links.html"