Skip to content
Snippets Groups Projects
Commit 1d2da4a0 authored by OndraRehounek's avatar OndraRehounek
Browse files

main: Init

parent 6e29d558
No related branches found
No related tags found
2 merge requests!607Pirati.cz,!575Feature/pirati cz
Pipeline #9072 passed
from django.apps import AppConfig
class DistrictConfig(AppConfig):
name = "main"
# HomePageCarouselBlock
# RecentWork/TweetsBlock
# NewsBlock
# PeopleOverviewBlock
# RegionOverviewBlock
# LinkBoxBlock (mozna hardcoded do homepage?)
# WorkTimelineBlock
# ArticleLinkBlock
# ProgramBlock
# PersonBlock
# TwitterCarouselBlock
# ContactBlock
from django.db import models
from django.shortcuts import render
from wagtail.admin.edit_handlers import FieldPanel, ObjectList, TabbedInterface
from wagtail.core.models import Page
from wagtailmetadata.models import MetadataPageMixin
from shared.models import ( # ArticleMixin,; ExtendedMetadataPageMixin,; SubpageMixin,
ExtendedMetadataHomePageMixin,
MenuMixin,
)
# from . import blocks
class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin, Page):
# settings
matomo_id = models.IntegerField(
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
)
# header - fb, twitter, insta, youtube, dary, nalodeni
# footer - stream field loadovany pres page.root_page?
settings_panels = [FieldPanel("matomo_id")]
### EDIT HANDLERS
edit_handler = TabbedInterface(
[
ObjectList(settings_panels, heading="Nastavení"),
ObjectList(MenuMixin.menu_panels, heading="Menu"),
]
)
### RELATIONS
subpage_types = [
# MainWorkTimelinePage
# MainArticlePage
# MainProgramPage
# MainPeoplePage
# MainPersonPage
# MainContactPage
]
### OTHERS
class Meta:
verbose_name = "HomePage pirati.cz"
@staticmethod
def get_404_response(request):
return render(request, "main/404.html", status=404)
@property
def root_page(self):
return self
{% load static %}
<html lang="cs">
<head>
<link rel="stylesheet" href="{% static 'styleguide234/assets/css/styles.css' %}">{# TODO some custom 404 in future #}
<title>404</title>
</head>
<body>
<div class="flex flex-col my-40 items-center">
<h1 class="head-alt-lg mb-8">
404
</h1>
<img src="{% static 'shared/img/logo_black.svg' %}" alt class="mb-8"/>
<h1 class="head-alt-md mb-8">
Narazili jsme na mělčinu...
</h1>
<a href="/">
Zpět do přístavu
</a>
</div>
</body>
</html>
{% load static wagtailcore_tags wagtailimages_tags wagtailmetadata_tags %}
<!doctype html>
<html lang="cs">
<head>
<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width" />
{% meta_tags %}
{% if settings.MAJAK_ENV == "test" %}
<meta name="robots" content="noindex, nofollow">
{% endif %}
<!-- Favicon -->
{% include "shared/favicon_snippet.html" %}
<!-- Styles -->
<script src="https://cdn.tailwindcss.com"></script>
{% block styles %}{% endblock styles %}
{% if page.root_page.matomo_id %}
{% include "shared/matomo_snippet.html" with matomo_id=page.root_page.matomo_id %}
{% endif %}
</head>
<body>
{% block content %}{% endblock content %}
{% block scripts %}{% endblock scripts %}
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment