diff --git a/main/__init__.py b/main/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/main/apps.py b/main/apps.py new file mode 100644 index 0000000000000000000000000000000000000000..d6512d13dcbd6109836bd5386bacf865b3c5e33a --- /dev/null +++ b/main/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class DistrictConfig(AppConfig): + name = "main" diff --git a/main/blocks.py b/main/blocks.py new file mode 100644 index 0000000000000000000000000000000000000000..9ed29dac22c2026feaba0c54e3e586306581937d --- /dev/null +++ b/main/blocks.py @@ -0,0 +1,12 @@ +# HomePageCarouselBlock +# RecentWork/TweetsBlock +# NewsBlock +# PeopleOverviewBlock +# RegionOverviewBlock +# LinkBoxBlock (mozna hardcoded do homepage?) +# WorkTimelineBlock +# ArticleLinkBlock +# ProgramBlock +# PersonBlock +# TwitterCarouselBlock +# ContactBlock diff --git a/main/migrations/__init__.py b/main/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/main/models.py b/main/models.py new file mode 100644 index 0000000000000000000000000000000000000000..2cd88595878892db5f17ca75424b58feaf80efa7 --- /dev/null +++ b/main/models.py @@ -0,0 +1,58 @@ +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 diff --git a/main/templates/main/404.html b/main/templates/main/404.html new file mode 100644 index 0000000000000000000000000000000000000000..0f44987612ed00288f55161bc44d1ce1c6c0e431 --- /dev/null +++ b/main/templates/main/404.html @@ -0,0 +1,22 @@ +{% 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> diff --git a/main/templates/main/base.html b/main/templates/main/base.html new file mode 100644 index 0000000000000000000000000000000000000000..13356618a615ae6ed34cda956f29dea271cb8d70 --- /dev/null +++ b/main/templates/main/base.html @@ -0,0 +1,30 @@ +{% 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> diff --git a/main/templates/main/includes/newsletter_block.html b/main/templates/main/includes/newsletter_block.html new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391