feat: Add about page
This commit is contained in:
parent
ded1aa77cf
commit
ee5638d97c
@ -31,7 +31,8 @@ dependencies = [
|
|||||||
"gunicorn",
|
"gunicorn",
|
||||||
"fontawesomefree",
|
"fontawesomefree",
|
||||||
"whitenoise",
|
"whitenoise",
|
||||||
"model_bakery"
|
"model_bakery",
|
||||||
|
"markdown",
|
||||||
]
|
]
|
||||||
dynamic = ["version", "readme"]
|
dynamic = ["version", "readme"]
|
||||||
|
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
{% extends "fellchensammlung/base_generic.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>{{ markdown_content.title }}</h1>
|
||||||
|
<p>{{ markdown_content.content|safe }}</p>
|
||||||
|
{% endblock %}
|
@ -9,8 +9,8 @@
|
|||||||
<nav id="nav" class="nav justify-content-center">
|
<nav id="nav" class="nav justify-content-center">
|
||||||
<a class="nav-link nav-link-active" href="/"><i data-feather="home"></i> Home</a>
|
<a class="nav-link nav-link-active" href="/"><i data-feather="home"></i> Home</a>
|
||||||
<a class="nav-link " href="{% url "search" %}"><i class="fas fa-search"></i> Suchen</a>
|
<a class="nav-link " href="{% url "search" %}"><i class="fas fa-search"></i> Suchen</a>
|
||||||
<a class="nav-link " href="/vermitteln/"><i class="fas fa-"></i> Vermitteln</a>
|
<a class="nav-link " href="{% url "add-adoption" %}"><i class="fas fa-"></i> Vermitteln</a>
|
||||||
<a class="nav-link " href="/ueber-uns/"><i class="fas fa-info"></i> Über uns</a>
|
<a class="nav-link " href="{% url "about" %}"><i class="fas fa-info"></i> Über uns</a>
|
||||||
<a class="nav-link " href=""><i class="fas fa-feather"></i> RSS</a>
|
<a class="nav-link " href=""><i class="fas fa-feather"></i> RSS</a>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -13,4 +13,5 @@ urlpatterns = [
|
|||||||
path("suchen/", views.search, name="search"),
|
path("suchen/", views.search, name="search"),
|
||||||
# ex: /vermitteln/
|
# ex: /vermitteln/
|
||||||
path("vermitteln/", views.add_adoption, name="add-adoption"),
|
path("vermitteln/", views.add_adoption, name="add-adoption"),
|
||||||
|
path("ueber-uns/", views.about, name="about"),
|
||||||
]
|
]
|
@ -1,7 +1,8 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
import markdown
|
||||||
|
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from fellchensammlung.models import AdoptionNotice
|
from fellchensammlung.models import AdoptionNotice, MarkdownContent
|
||||||
|
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
@ -25,3 +26,14 @@ def search(request):
|
|||||||
def add_adoption(request):
|
def add_adoption(request):
|
||||||
return render(request, 'fellchensammlung/add_adoption.html')
|
return render(request, 'fellchensammlung/add_adoption.html')
|
||||||
|
|
||||||
|
def about(request):
|
||||||
|
md = markdown.Markdown(extensions=["fenced_code"])
|
||||||
|
markdown_content = MarkdownContent.objects.first()
|
||||||
|
markdown_content.content = md.convert(markdown_content.content)
|
||||||
|
context = {"markdown_content": markdown_content}
|
||||||
|
return render(
|
||||||
|
request,
|
||||||
|
"fellchensammlung/about.html",
|
||||||
|
context=context
|
||||||
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user