Created a stupid flatpage view and urlpattern.

This commit is contained in:
Marcus Scholz 2020-09-07 22:16:09 +02:00
parent f98c952d9b
commit f2b6c3e102
4 changed files with 8 additions and 8 deletions

View File

@ -48,7 +48,7 @@
<nav class="LP-Menu LP-Menu--sidebar"> <nav class="LP-Menu LP-Menu--sidebar">
<ul class="LP-Menu__List"> <ul class="LP-Menu__List">
<li class="LP-Menu__Item"><a href="/" class="LP-Link"><span class="LP-Link__Text">Home</span></a></li> <li class="LP-Menu__Item"><a href="/" class="LP-Link"><span class="LP-Link__Text">Home</span></a></li>
<li class="LP-Menu__Item"><a href="{% url 'codex' %}" class="LP-Link"><span class="LP-Link__Text">UrBex codex</span></a></li> <li class="LP-Menu__Item"><a href="{% url 'flatpage' slug='codex' %}" class="LP-Link"><span class="LP-Link__Text">UrBex codex</span></a></li>
{% block additional_menu_items %} {% block additional_menu_items %}
{% endblock additional_menu_items %} {% endblock additional_menu_items %}

View File

@ -64,9 +64,9 @@
and <a href="https://www.commander1024.de" class="LP-Footer__GenericAnchor">Commander1024.</a></span> and <a href="https://www.commander1024.de" class="LP-Footer__GenericAnchor">Commander1024.</a></span>
</div> </div>
<div class="LP-Footer__BottomWrapper"> <div class="LP-Footer__BottomWrapper">
<a href='flat/privacy-policy/' class="LP-Footer__GenericAnchor">Privacy Policy</a> <a href='{% url 'flatpage' slug='privacy-policy' %}' class="LP-Footer__GenericAnchor">Privacy Policy</a>
| |
<a href='flat/impress/' class="LP-Footer__GenericAnchor">Impress</a> <a href='{% url 'flatpage' slug='impress' %}' class="LP-Footer__GenericAnchor">Impress</a>
</div> </div>
</section> </section>
</footer> </footer>

View File

@ -9,7 +9,7 @@ from .views import (
PlaceDeleteView, PlaceDeleteView,
PhotoAlbumCreateView, PhotoAlbumCreateView,
PhotoAlbumDeleteView, PhotoAlbumDeleteView,
CodexView FlatView
) )
urlpatterns = [ urlpatterns = [
@ -22,5 +22,5 @@ urlpatterns = [
path('place/update/<int:pk>/', PlaceUpdateView.as_view(), name='place_edit'), path('place/update/<int:pk>/', PlaceUpdateView.as_view(), name='place_edit'),
path('place/delete/<int:pk>/', PlaceDeleteView.as_view(), name='place_delete'), path('place/delete/<int:pk>/', PlaceDeleteView.as_view(), name='place_delete'),
path('place/', PlaceListView.as_view(), name='place_list'), path('place/', PlaceListView.as_view(), name='place_list'),
path('codex/', CodexView, name='codex'), path('flat/<slug:slug>/', FlatView, name='flatpage')
] ]

View File

@ -4,7 +4,7 @@ from django.views.generic.edit import CreateView
from django.contrib.messages.views import SuccessMessageMixin from django.contrib.messages.views import SuccessMessageMixin
from django.contrib import messages from django.contrib import messages
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.shortcuts import render, redirect from django.shortcuts import render, redirect, get_object_or_404
from lostplaces_app.forms import ExplorerCreationForm from lostplaces_app.forms import ExplorerCreationForm
from lostplaces_app.models import Place, PhotoAlbum from lostplaces_app.models import Place, PhotoAlbum
@ -49,5 +49,5 @@ class PhotoAlbumDeleteView(PlaceAssetDeleteView):
success_message = 'Photo Album deleted' success_message = 'Photo Album deleted'
permission_denied_messsage = 'You do not have permissions to alter this photo album' permission_denied_messsage = 'You do not have permissions to alter this photo album'
def CodexView(request): def FlatView(request, slug):
return render(request, 'flat/codex.html') return render(request, 'flat/' + slug + '.html')