Commit dce4c3f1 authored by hynek's avatar hynek 🤤
Browse files

feat(contacts-page): add url, view and nav link for contact page

uses the `TextPage` model and the `text_page` template from `pages`

closes #189
parent 7138bd9a
......@@ -11,6 +11,7 @@ from wagtail.core import urls as wagtail_urls
from discuss_data.core.views import (
landing_page,
about_page,
contacts_page,
)
from discuss_data.ddusers.views import following_act_feed
......@@ -42,6 +43,7 @@ urlpatterns = [
path("shib/", include("shibboleth.urls", namespace="shibboleth")),
path("", landing_page, name="core.landing_page"),
path("about/", about_page, name="core.about_page"),
path("contacts/", contacts_page, name="core.contacts_page"),
path("dashboard/", following_act_feed, name="ddusers.dashboard_page"),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
......
......@@ -20,7 +20,7 @@ from discuss_data.core.documents import (
from discuss_data.core.models import KeywordTagged
from discuss_data.dddatasets.models import Category
from discuss_data.ddusers.models import Country
from discuss_data.pages.models import LandingPage, ManualPage
from discuss_data.pages.models import LandingPage, ManualPage, TextPage
logger = logging.getLogger(__name__)
......@@ -244,6 +244,14 @@ def about_page(request):
return render(request, "about.html", {"page": page},)
def contacts_page(request):
"""
Platform contacts page
"""
page = get_object_or_404(TextPage, slug="contacts")
return render(request, "pages/text_page.html", {"page": page},)
def check_perms(permission, user, dd_obj):
try:
if dd_obj.owner == user:
......
......@@ -20,7 +20,7 @@
<a class="nav-link" href="{% url 'core.about_page' %}">{% trans "About" %}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% slugurl 'contact' %}">{% trans "Contact" %}</a>
<a class="nav-link" href="{% url 'core.contacts_page' %}">{% trans "Contact" %}</a>
</li>
{% if request.user.is_authenticated %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment