feat: Add onpagers for imprint, privacy and terms of service
This commit is contained in:
parent
3d7780e0ba
commit
b53095ae17
@ -24,6 +24,30 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="column">
|
||||||
|
<h4 class="bd-footer-title title is-4 has-text-justify">
|
||||||
|
{% translate 'Über uns' %}
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
<a class="bd-footer-link" href="{% url "about-bulma" %}">
|
||||||
|
{% translate 'Das Notfellchen Projekt' %}
|
||||||
|
</a>
|
||||||
|
<br/>
|
||||||
|
<a class="bd-footer-link" href="{% url "terms-of-service" %}">
|
||||||
|
{% translate 'Nutzungsbedingungen' %}
|
||||||
|
</a>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<a class="bd-footer-link" href="{% url "privacy" %}">
|
||||||
|
{% translate 'Datenschutz' %}
|
||||||
|
</a>
|
||||||
|
<br/>
|
||||||
|
<a class="bd-footer-link" href="{% url "imprint" %}">
|
||||||
|
{% translate 'Impressum' %}
|
||||||
|
</a>
|
||||||
|
<br/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
<h4 class="bd-footer-title title is-4 has-text-justify">
|
<h4 class="bd-footer-title title is-4 has-text-justify">
|
||||||
Technisches
|
Technisches
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
{% extends "fellchensammlung/base_bulma.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% load custom_tags %}
|
||||||
|
|
||||||
|
{% block title %}<title>{{ text.title }}</title>{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="block">
|
||||||
|
<h1 class="title is-1">{{ text.title }}</h1>
|
||||||
|
<div class="content">
|
||||||
|
{{ text.content | render_markdown }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -3,6 +3,13 @@ from django.utils import translation
|
|||||||
from fellchensammlung.models import Language, Text
|
from fellchensammlung.models import Language, Text
|
||||||
|
|
||||||
|
|
||||||
|
def get_text_by_language(text_code, lang=None):
|
||||||
|
if lang is None:
|
||||||
|
language_code = translation.get_language()
|
||||||
|
lang = Language.objects.get(languagecode=language_code)
|
||||||
|
return Text.objects.get(text_code=text_code, language=lang, )
|
||||||
|
|
||||||
|
|
||||||
def get_texts_by_language(text_codes):
|
def get_texts_by_language(text_codes):
|
||||||
language_code = translation.get_language()
|
language_code = translation.get_language()
|
||||||
lang = Language.objects.get(languagecode=language_code)
|
lang = Language.objects.get(languagecode=language_code)
|
||||||
@ -10,7 +17,7 @@ def get_texts_by_language(text_codes):
|
|||||||
texts = {}
|
texts = {}
|
||||||
for text_code in text_codes:
|
for text_code in text_codes:
|
||||||
try:
|
try:
|
||||||
texts[text_code] = Text.objects.get(text_code=text_code, language=lang, )
|
texts[text_code] = get_text_by_language(text_code, lang)
|
||||||
except Text.DoesNotExist:
|
except Text.DoesNotExist:
|
||||||
texts[text_code] = None
|
texts[text_code] = None
|
||||||
return texts
|
return texts
|
||||||
|
@ -56,6 +56,9 @@ urlpatterns = [
|
|||||||
|
|
||||||
path("ueber-uns/", views.about, name="about"),
|
path("ueber-uns/", views.about, name="about"),
|
||||||
path("bulma/ueber-uns/", views.about_bulma, name="about-bulma"),
|
path("bulma/ueber-uns/", views.about_bulma, name="about-bulma"),
|
||||||
|
path("impressum/", views.imprint, name="imprint"),
|
||||||
|
path("terms-of-service/", views.terms_of_service, name="terms-of-service"),
|
||||||
|
path("datenschutz/", views.privacy, name="privacy"),
|
||||||
|
|
||||||
################
|
################
|
||||||
## Moderation ##
|
## Moderation ##
|
||||||
|
@ -439,6 +439,31 @@ def about_bulma(request):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def render_text(request, text):
|
||||||
|
context = {"text": text}
|
||||||
|
|
||||||
|
return render(
|
||||||
|
request,
|
||||||
|
"fellchensammlung/bulma-one-text.html",
|
||||||
|
context=context
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def imprint(request):
|
||||||
|
text = i18n.get_text_by_language("imprint")
|
||||||
|
return render_text(request, text)
|
||||||
|
|
||||||
|
|
||||||
|
def privacy(request):
|
||||||
|
text = i18n.get_text_by_language("privacy_statement")
|
||||||
|
return render_text(request, text)
|
||||||
|
|
||||||
|
|
||||||
|
def terms_of_service(request):
|
||||||
|
text = i18n.get_text_by_language("terms_of_service")
|
||||||
|
return render_text(request, text)
|
||||||
|
|
||||||
|
|
||||||
def report_adoption(request, adoption_notice_id):
|
def report_adoption(request, adoption_notice_id):
|
||||||
"""
|
"""
|
||||||
Form to report adoption notices
|
Form to report adoption notices
|
||||||
|
Loading…
x
Reference in New Issue
Block a user