Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
1 result

Target

Select target project
No results found
Select Git revision
  • jw
  • master
2 results
Show changes

Commits on Source 29

56 files
+ 1736
299
Compare changes
  • Side-by-side
  • Inline

Files

+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ build: venv
	${VENV}/bin/python manage.py collectstatic --noinput --settings=${SETTINGS}

run: venv
	${VENV}/bin/python manage.py runserver z1.local:${PORT} --settings=${SETTINGS}
	${VENV}/bin/python manage.py runserver ${PORT} --settings=${SETTINGS}

shell: venv
	${VENV}/bin/python manage.py shell --settings=${SETTINGS}

home/admin.py

0 → 100644
+15 −0
Original line number Diff line number Diff line
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register

from .models import Tag


class TagAdmin(ModelAdmin):
    model = Tag
    menu_label = "Štítky"
    menu_icon = "tag"
    menu_order = 290
    add_to_settings_menu = False
    exclude_from_explorer = False


modeladmin_register(TagAdmin)
Original line number Diff line number Diff line
# Generated by Django 4.2.2 on 2023-08-15 23:51

import wagtail.fields
from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("home", "0023_homepage_academic_council"),
    ]

    operations = [
        migrations.AlterField(
            model_name="homepage",
            name="academic_council_description",
            field=wagtail.fields.RichTextField(verbose_name="Akademická rada - popis"),
        ),
        migrations.AlterField(
            model_name="homepage",
            name="controller_description",
            field=wagtail.fields.RichTextField(verbose_name="Kontrolor - popis"),
        ),
        migrations.AlterField(
            model_name="homepage",
            name="council_members_description",
            field=wagtail.fields.RichTextField(verbose_name="Správní rada - popis"),
        ),
        migrations.AlterField(
            model_name="homepage",
            name="director_description",
            field=wagtail.fields.RichTextField(verbose_name="Ředitel - popis"),
        ),
        migrations.AlterField(
            model_name="homepage",
            name="employees_description",
            field=wagtail.fields.RichTextField(verbose_name="Zaměstnanci - popis"),
        ),
        migrations.AlterField(
            model_name="homepage",
            name="volunteers_description",
            field=wagtail.fields.RichTextField(verbose_name="Dobrovolníci - popis"),
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-19 22:46

from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("home", "0023_homepage_academic_council"),
    ]

    operations = [
        migrations.AddField(
            model_name="homepersonpage",
            name="name_titles",
            field=models.CharField(
                blank=True, max_length=32, null=True, verbose_name="Tituly"
            ),
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-19 23:08

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("wagtailimages", "0025_alter_image_file_alter_rendition_file"),
        ("home", "0024_homepersonpage_name_titles"),
    ]

    operations = [
        migrations.AddField(
            model_name="homearticlepage",
            name="image",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to="wagtailimages.image",
                verbose_name="Obrázek",
            ),
        ),
        migrations.AddField(
            model_name="homearticlepage",
            name="show_image_on_homepage",
            field=models.BooleanField(
                default=False, verbose_name="Zobrazovat obrázek na homepage"
            ),
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-20 14:17

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("wagtailcore", "0083_workflowcontenttype"),
        ("home", "0025_homearticlepage_image_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="SocialMediaSettings",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "mastodon",
                    models.URLField(blank=True, help_text="Mastodon URL", null=True),
                ),
                (
                    "twitter",
                    models.URLField(blank=True, help_text="Twitter URL", null=True),
                ),
                (
                    "linkedin",
                    models.URLField(blank=True, help_text="LinkedIn URL", null=True),
                ),
                (
                    "facebook",
                    models.URLField(blank=True, help_text="Facebook URL", null=True),
                ),
                (
                    "site",
                    models.OneToOneField(
                        editable=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="wagtailcore.site",
                    ),
                ),
            ],
            options={
                "verbose_name": "Sociální sítě",
            },
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-20 15:50

from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("home", "0026_socialmediasettings"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="homedocumentpage",
            name="tags",
        ),
        migrations.RemoveField(
            model_name="homeeventpage",
            name="tags",
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-20 16:06

import django.db.models.deletion
import modelcluster.fields
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("taggit", "0005_auto_20220424_2025"),
        ("home", "0027_remove_homedocumentpage_tags_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="ArticleTag",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.RemoveField(
            model_name="homearticlepage",
            name="tags",
        ),
        migrations.DeleteModel(
            name="Tag",
        ),
        migrations.AddField(
            model_name="articletag",
            name="content_object",
            field=modelcluster.fields.ParentalKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="tagged_items",
                to="home.homearticlepage",
            ),
        ),
        migrations.AddField(
            model_name="articletag",
            name="tag",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="%(app_label)s_%(class)s_items",
                to="taggit.tag",
            ),
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-20 16:06

import modelcluster.contrib.taggit
from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("taggit", "0005_auto_20220424_2025"),
        ("home", "0028_articletag_remove_homearticlepage_tags_delete_tag_and_more"),
    ]

    operations = [
        migrations.AddField(
            model_name="homearticlepage",
            name="tags",
            field=modelcluster.contrib.taggit.ClusterTaggableManager(
                blank=True,
                help_text="A comma-separated list of tags.",
                through="home.ArticleTag",
                to="taggit.Tag",
                verbose_name="Štítky",
            ),
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-20 16:50

import django.db.models.deletion
import django.utils.timezone
import wagtail.contrib.routable_page.models
import wagtail.fields
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("wagtailimages", "0025_alter_image_file_alter_rendition_file"),
        ("wagtailcore", "0083_workflowcontenttype"),
        ("home", "0029_homearticlepage_tags"),
    ]

    operations = [
        migrations.CreateModel(
            name="HomeVideosPage",
            fields=[
                (
                    "page_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="wagtailcore.page",
                    ),
                ),
                (
                    "content",
                    wagtail.fields.RichTextField(
                        blank=True, null=True, verbose_name="Obsah"
                    ),
                ),
            ],
            options={
                "verbose_name": "Rozcestník videí",
            },
            bases=(
                wagtail.contrib.routable_page.models.RoutablePageMixin,
                "wagtailcore.page",
            ),
        ),
        migrations.CreateModel(
            name="HomeVideoPage",
            fields=[
                (
                    "page_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="wagtailcore.page",
                    ),
                ),
                (
                    "author",
                    models.CharField(
                        blank=True,
                        max_length=128,
                        null=True,
                        verbose_name="Jméno autora",
                    ),
                ),
                (
                    "date",
                    models.DateField(
                        default=django.utils.timezone.now,
                        verbose_name="Datum vytvoření",
                    ),
                ),
                ("content", wagtail.fields.RichTextField(verbose_name="Obsah")),
                (
                    "embed_url",
                    models.URLField(
                        help_text="Pro získání adresy zmáčkni tlačítko Sdílet, vyber záložku Embed a zaškrtní zobrazování pouze URL.",
                        verbose_name="URL Embedu",
                    ),
                ),
                (
                    "author_page",
                    models.ForeignKey(
                        blank=True,
                        help_text="Pokud je vybrána stránka, není nutno vyplňovat jméno autora níže.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="home.homepersonpage",
                        verbose_name="Stránka autora",
                    ),
                ),
                (
                    "thumbnail",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to="wagtailimages.image",
                        verbose_name="Náhledový obrázek",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                wagtail.contrib.routable_page.models.RoutablePageMixin,
                "wagtailcore.page",
            ),
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-20 16:53

from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("home", "0030_homevideospage_homevideopage"),
    ]

    operations = [
        migrations.AlterModelOptions(
            name="homevideopage",
            options={"verbose_name": "Video"},
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-20 16:54

import wagtail.fields
from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("home", "0031_alter_homevideopage_options"),
    ]

    operations = [
        migrations.AlterField(
            model_name="homevideopage",
            name="content",
            field=wagtail.fields.RichTextField(
                blank=True, null=True, verbose_name="Obsah"
            ),
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.2 on 2023-08-20 18:44

from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("home", "0024_alter_homepage_academic_council_description_and_more"),
        ("home", "0032_alter_homevideopage_content"),
    ]

    operations = []
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-21 18:21

import django.db.models.deletion
import modelcluster.contrib.taggit
import modelcluster.fields
import wagtail_color_panel.fields
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        ("home", "0033_merge_20230820_1844"),
    ]

    operations = [
        migrations.CreateModel(
            name="Tag",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(max_length=100, unique=True, verbose_name="name"),
                ),
                (
                    "slug",
                    models.SlugField(
                        allow_unicode=True,
                        max_length=100,
                        unique=True,
                        verbose_name="slug",
                    ),
                ),
                (
                    "bg_color",
                    wagtail_color_panel.fields.ColorField(
                        blank=True, max_length=7, null=True, verbose_name="Barva pozadí"
                    ),
                ),
                (
                    "fg_color",
                    wagtail_color_panel.fields.ColorField(
                        blank=True, max_length=7, null=True, verbose_name="Barva textu"
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="TaggedArticle",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "object_id",
                    models.IntegerField(db_index=True, verbose_name="object ID"),
                ),
                (
                    "content_object",
                    modelcluster.fields.ParentalKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="tagged_items",
                        to="home.homearticlepage",
                    ),
                ),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="%(app_label)s_%(class)s_tagged_items",
                        to="contenttypes.contenttype",
                        verbose_name="content type",
                    ),
                ),
                (
                    "tag",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="%(app_label)s_%(class)s_items",
                        to="home.tag",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.DeleteModel(
            name="ArticleTag",
        ),
        migrations.AlterField(
            model_name="homearticlepage",
            name="tags",
            field=modelcluster.contrib.taggit.ClusterTaggableManager(
                blank=True,
                help_text="A comma-separated list of tags.",
                through="home.TaggedArticle",
                to="home.Tag",
                verbose_name="Štítky",
            ),
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-21 18:26

import wagtail_color_panel.fields
from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("home", "0034_tag_taggedarticle_delete_articletag_and_more"),
    ]

    operations = [
        migrations.AlterField(
            model_name="tag",
            name="bg_color",
            field=wagtail_color_panel.fields.ColorField(
                default="#fafafa", max_length=7, verbose_name="Barva pozadí"
            ),
        ),
        migrations.AlterField(
            model_name="tag",
            name="fg_color",
            field=wagtail_color_panel.fields.ColorField(
                default="#000000", max_length=7, verbose_name="Barva textu"
            ),
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-21 18:44

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("home", "0035_alter_tag_bg_color_alter_tag_fg_color"),
    ]

    operations = [
        migrations.AlterField(
            model_name="taggedarticle",
            name="tag",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="article_tags",
                to="home.tag",
            ),
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-21 19:06

from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("home", "0036_alter_taggedarticle_tag"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="homearticlepage",
            name="tags",
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-21 19:06

import modelcluster.contrib.taggit
from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("home", "0037_remove_homearticlepage_tags"),
    ]

    operations = [
        migrations.AddField(
            model_name="homearticlepage",
            name="tags",
            field=modelcluster.contrib.taggit.ClusterTaggableManager(
                blank=True,
                help_text="A comma-separated list of tags.",
                through="home.TaggedArticle",
                to="home.Tag",
                verbose_name="Štítky",
            ),
        ),
    ]
Original line number Diff line number Diff line
# Generated by Django 4.2.4 on 2023-08-21 19:09

from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("home", "0038_homearticlepage_tags"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="taggedarticle",
            name="content_type",
        ),
        migrations.RemoveField(
            model_name="taggedarticle",
            name="object_id",
        ),
    ]
+222 −24
Original line number Diff line number Diff line
from django.db import models
from django.utils import timezone
from modelcluster.contrib.taggit import ClusterTaggableManager
from modelcluster.fields import ParentalKey
from taggit.models import ItemBase, TagBase
from wagtail.admin.panels import (
    FieldPanel,
    InlinePanel,
    MultiFieldPanel,
    ObjectList,
    TabbedInterface,
)
from wagtail.blocks import PageChooserBlock
from wagtail.contrib.routable_page.models import RoutablePageMixin, path
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
from wagtail.documents import get_document_model
from wagtail.fields import RichTextField, StreamField
from wagtail.models import Page
from wagtail_color_panel.edit_handlers import NativeColorPanel
from wagtail_color_panel.fields import ColorField

from .blocks import PersonBlock

# --- BEGIN Tags ---


class Tag(TagBase):
    bg_color = ColorField(verbose_name="Barva pozadí", default="#fafafa")
    fg_color = ColorField(verbose_name="Barva textu", default="#000000")

    panels = [
        FieldPanel("name"),
        FieldPanel("slug"),
        NativeColorPanel("bg_color"),
        NativeColorPanel("fg_color"),
    ]


class TaggedArticle(ItemBase):
    content_object = ParentalKey(
        "home.HomeArticlePage", on_delete=models.CASCADE, related_name="tagged_items"
    )

    tag = models.ForeignKey(Tag, on_delete=models.CASCADE, related_name="article_tags")


# --- END Tags ---


class HomePage(RoutablePageMixin, Page):
    heading_text = RichTextField(verbose_name="Hlavní text stránky")
@@ -46,7 +78,7 @@ class HomePage(RoutablePageMixin, Page):
        blank=True,
        null=True,
    )
    director_description = models.TextField(verbose_name="Ředitel - popis")
    director_description = RichTextField(verbose_name="Ředitel - popis")

    academic_council = StreamField(
        [
@@ -63,9 +95,7 @@ class HomePage(RoutablePageMixin, Page):
        blank=True,
        null=True,
    )
    academic_council_description = models.TextField(
        verbose_name="Akademická rada - popis"
    )
    academic_council_description = RichTextField(verbose_name="Akademická rada - popis")

    controller = StreamField(
        [
@@ -82,7 +112,7 @@ class HomePage(RoutablePageMixin, Page):
        blank=True,
        null=True,
    )
    controller_description = models.TextField(verbose_name="Kontrolor - popis")
    controller_description = RichTextField(verbose_name="Kontrolor - popis")

    council_members = StreamField(
        [
@@ -99,7 +129,7 @@ class HomePage(RoutablePageMixin, Page):
        blank=True,
        null=True,
    )
    council_members_description = models.TextField(verbose_name="Správní rada - popis")
    council_members_description = RichTextField(verbose_name="Správní rada - popis")

    volunteers = StreamField(
        [
@@ -116,7 +146,7 @@ class HomePage(RoutablePageMixin, Page):
        blank=True,
        null=True,
    )
    volunteers_description = models.TextField(verbose_name="Dobrovolníci - popis")
    volunteers_description = RichTextField(verbose_name="Dobrovolníci - popis")

    employees = StreamField(
        [
@@ -133,12 +163,13 @@ class HomePage(RoutablePageMixin, Page):
        blank=True,
        null=True,
    )
    employees_description = models.TextField(verbose_name="Zaměstnanci - popis")
    employees_description = RichTextField(verbose_name="Zaměstnanci - popis")

    subpage_types = [
        "home.HomeArticlesPage",
        "home.HomeEventsPage",
        "home.HomeDocumentsPage",
        "home.HomeVideosPage",
        "home.HomePeoplePage",
    ]

@@ -244,10 +275,10 @@ class HomePage(RoutablePageMixin, Page):
        verbose_name = "Domovská stránka"


# --- BEGIN Articles, events and documents ---
# --- BEGIN Articles, events, videos and documents ---


class HomeArticlesPage(RoutablePageMixin, Page):
class HomeArticlesPage(Page):
    content = RichTextField(verbose_name="Obsah", blank=True, null=True)

    parent_page_type = ["home.HomePage"]
@@ -259,13 +290,27 @@ class HomeArticlesPage(RoutablePageMixin, Page):

    @property
    def articles(self):
        return HomeArticlePage.objects.live().order_by("-date").all()
        return HomeArticlePage.objects.live().order_by("-date")

    def get_context(self, request):
        context = super().get_context(request)
        articles = self.articles

        # Filter by tag
        tag = request.GET.get("tag")
        if tag:
            articles = articles.filter(tags__name=tag)
            context["filtered_tag"] = tag

        context["articles"] = articles

        return context

    class Meta:
        verbose_name = "Rozcestník článků"


class HomeEventsPage(RoutablePageMixin, Page):
class HomeEventsPage(Page):
    content = RichTextField(verbose_name="Obsah", blank=True, null=True)

    parent_page_type = ["home.HomePage"]
@@ -283,7 +328,7 @@ class HomeEventsPage(RoutablePageMixin, Page):
        verbose_name = "Rozcestník akcí"


class HomeDocumentsPage(RoutablePageMixin, Page):
class HomeDocumentsPage(Page):
    content = RichTextField(verbose_name="Obsah", blank=True, null=True)

    parent_page_type = ["home.HomePage"]
@@ -295,15 +340,39 @@ class HomeDocumentsPage(RoutablePageMixin, Page):

    @property
    def documents(self):
        return HomeDocumentPage.objects.child_of(self).live().order_by("-date").all()
        documents = list(
            HomeDocumentPage.objects.child_of(self).order_by("-date").live().all()
        )

        document_directories = list(
            HomeDocumentsPage.objects.child_of(self).live().all()
        )

        return documents + document_directories

    class Meta:
        verbose_name = "Rozcestník dokumentů"


class HomeContentPageMixin(RoutablePageMixin, Page):
    tags = models.ManyToManyField("Tag", verbose_name="Štítky")
class HomeVideosPage(Page):
    content = RichTextField(verbose_name="Obsah", blank=True, null=True)

    parent_page_type = ["home.HomePage"]
    subpage_types = ["home.HomeVideoPage"]

    content_panels = Page.content_panels + [
        FieldPanel("content", icon="pilcrow"),
    ]

    @property
    def videos(self):
        return HomeVideoPage.objects.live().order_by("-date").all()

    class Meta:
        verbose_name = "Rozcestník videí"


class HomeContentPageMixin(Page):
    author_page = models.ForeignKey(
        "home.HomePersonPage",
        on_delete=models.SET_NULL,
@@ -350,6 +419,43 @@ class HomeContentPageMixin(RoutablePageMixin, Page):


class HomeArticlePage(HomeContentPageMixin):
    image = models.ForeignKey(
        "wagtailimages.Image",
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name="+",
        verbose_name="Obrázek",
    )

    content = RichTextField(
        verbose_name="Obsah",
        features=[
            "h2",
            "h3",
            "h4",
            "bold",
            "italic",
            "ol",
            "ul",
            "hr",
            "link",
            "document-link",
            "image",
            "embed",
            "footnotes",
        ],
    )

    show_image_on_homepage = models.BooleanField(
        verbose_name="Zobrazovat obrázek na homepage",
        default=False,
    )

    tags = ClusterTaggableManager(
        through=TaggedArticle, blank=True, verbose_name="Štítky"
    )

    perex = models.TextField(verbose_name="Perex")

    content_panels = Page.content_panels + [
@@ -360,9 +466,18 @@ class HomeArticlePage(HomeContentPageMixin):
            ],
            heading="Autor",
        ),
        MultiFieldPanel(
            [
                FieldPanel("image", icon="image", heading=" "),
                FieldPanel("show_image_on_homepage"),
            ],
            heading="Obrázek",
        ),
        FieldPanel("date", icon="calendar"),
        FieldPanel("perex", icon="pilcrow"),
        FieldPanel("tags", icon="tag"),
        FieldPanel("content", icon="pilcrow"),
        InlinePanel("footnotes", label="Footnotes", icon="pilcrow"),
    ]

    class Meta:
@@ -420,11 +535,46 @@ class HomeDocumentPage(HomeContentPageMixin):
        verbose_name = "Dokument"


# --- END Articles, events and documents ---
class HomeVideoPage(HomeContentPageMixin):
    embed_url = models.URLField(
        verbose_name="URL Embedu",
        help_text="Pro získání adresy zmáčkni tlačítko Sdílet, vyber záložku Embed a zaškrtní zobrazování pouze URL.",
    )

    thumbnail = models.ForeignKey(
        "wagtailimages.Image",
        null=True,
        blank=True,
        on_delete=models.SET_NULL,
        related_name="+",
        verbose_name="Náhledový obrázek",
    )

    content = RichTextField(verbose_name="Obsah", blank=True, null=True)

    content_panels = Page.content_panels + [
        FieldPanel("embed_url", icon="link"),
        FieldPanel("thumbnail", icon="image"),
        MultiFieldPanel(
            [
                FieldPanel("author_page", icon="user"),
                FieldPanel("author", icon="user"),
            ],
            heading="Autor",
        ),
        FieldPanel("date", icon="calendar"),
        FieldPanel("content", icon="pilcrow"),
    ]

    class Meta:
        verbose_name = "Video"


# --- END Articles, events, videos and documents ---
# --- BEGIN People ---


class HomePeoplePage(RoutablePageMixin, Page):
class HomePeoplePage(Page):
    content = RichTextField(verbose_name="Obsah", blank=True, null=True)

    parent_page_type = ["home.HomePage"]
@@ -436,13 +586,13 @@ class HomePeoplePage(RoutablePageMixin, Page):

    @property
    def people(self):
        return HomePersonPage.objects.live().order_by("-title").all()
        return HomePersonPage.objects.live().order_by("title").all()

    class Meta:
        verbose_name = "Rozcestník osob"


class HomePersonPage(RoutablePageMixin, Page):
class HomePersonPage(Page):
    image = models.ForeignKey(
        "wagtailimages.Image",
        null=True,
@@ -452,6 +602,13 @@ class HomePersonPage(RoutablePageMixin, Page):
        verbose_name="Profilový obrázek",
    )

    name_titles = models.CharField(
        max_length=32,
        blank=True,
        null=True,
        verbose_name="Tituly",
    )

    position = models.TextField(verbose_name="Pracovní pozice", blank=True, null=True)

    email = models.EmailField(verbose_name="Emailová adresa", blank=True, null=True)
@@ -459,22 +616,63 @@ class HomePersonPage(RoutablePageMixin, Page):
    description = RichTextField(verbose_name="Popis", blank=True, null=True)

    content_panels = Page.content_panels + [
        FieldPanel("name_titles", icon="pilcrow"),
        FieldPanel("image", icon="image"),
        FieldPanel("position", icon="pilcrow"),
        FieldPanel("email", icon="mail"),
        FieldPanel("description", icon="pilcrow"),
    ]

    @property
    def full_name(self) -> str:
        name = self.title

        if self.name_titles is not None:
            name = f"{self.name_titles} {name}"

        return name

    @property
    def inline_position(self) -> str:
        """Returns this person's position formatted to fit on a single line."""

        if self.position is None:
            return None

        split_positions = self.position.split("\n")
        split_positions = [position.strip() for position in split_positions]

        return ", ".join(split_positions)

    class Meta:
        verbose_name = "Osoba"


# --- END People ---
# --- BEGIN Settings ---


@register_setting
class SocialMediaSettings(BaseSiteSetting):
    mastodon = models.URLField(blank=True, null=True, help_text="Mastodon URL")
    twitter = models.URLField(blank=True, null=True, help_text="Twitter URL")
    linkedin = models.URLField(blank=True, null=True, help_text="LinkedIn URL")
    facebook = models.URLField(blank=True, null=True, help_text="Facebook URL")

class Tag(models.Model):
    name = models.CharField(verbose_name="Jméno", max_length=32)
    panels = [
        MultiFieldPanel(
            [
                FieldPanel("mastodon"),
                FieldPanel("twitter"),
                FieldPanel("linkedin"),
                FieldPanel("facebook"),
            ],
            heading="Nastavení sociálních sítí",
        )
    ]

    class Meta:
        verbose_name = "Štítek"
        verbose_name_plural = "Štítky"
        verbose_name = "Sociální sítě"


# --- END Settings ---
Original line number Diff line number Diff line
@font-face {
    font-family: "pirati-ui";
    src:
        url("./pirati-ui.eot") format("embedded-opentype"),
        url("./pirati-ui.ttf") format("truetype"),
        url("./pirati-ui.woff") format("woff"),
        url("./pirati-ui.svg") format("svg");
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

[class^="ico--"], [class*=" ico--"] {
  /* use !important to prevent issues with browser extensions that change fonts */
  font-family: 'pirati-ui' !important;
  speak: never;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;

  /* Better Font Rendering =========== */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ico--mastodon:before {
  content: "\e973";
}
.ico--helios:before {
  content: "\e96e";
}
.ico--redmine:before {
  content: "\e96f";
}
.ico--zulip:before {
  content: "\e970";
}
.ico--forum:before {
  content: "\e971";
}
.ico--pirati:before {
  content: "\e90d";
}
.ico--jitsi:before {
  content: "\e90f";
}
.ico--open-source:before {
  content: "\e90e";
}
.ico--donation-full:before {
  content: "\e96c";
}
.ico--donation-outline:before {
  content: "\e96d";
}
.ico--strategy:before {
  content: "\e932";
}
.ico--pig:before {
  content: "\e928";
}
.ico--thermometer:before {
  content: "\e90a";
}
.ico--menu:before {
  content: "\e933";
}
.ico--chevron-right:before {
  content: "\e923";
}
.ico--chevron-left:before {
  content: "\e924";
}
.ico--chevron-down:before {
  content: "\e925";
}
.ico--chevron-up:before {
  content: "\e926";
}
.ico--link-horizontal:before {
  content: "\e910";
}
.ico--beer:before {
  content: "\e909";
}
.ico--food:before {
  content: "\e968";
}
.ico--dots-three-vertical:before {
  content: "\e940";
}
.ico--dots-three-horizontal:before {
  content: "\e941";
}
.ico--log-out:before {
  content: "\e942";
}
.ico--envelope:before {
  content: "\e908";
}
.ico--pin:before {
  content: "\e943";
}
.ico--at:before {
  content: "\e905";
}
.ico--glass:before {
  content: "\e967";
}
.ico--checkmark:before {
  content: "\e965";
}
.ico--info:before {
  content: "\e901";
}
.ico--question:before {
  content: "\e904";
}
.ico--warning:before {
  content: "\e93f";
}
.ico--code:before {
  content: "\e94a";
}
.ico--checkbox-unchecked:before {
  content: "\e94e";
}
.ico--star-full:before {
  content: "\e94f";
}
.ico--star-empty:before {
  content: "\e950";
}
.ico--bookmark:before {
  content: "\e951";
}
.ico--cog:before {
  content: "\e952";
}
.ico--key:before {
  content: "\e953";
}
.ico--zoom-in:before {
  content: "\e954";
}
.ico--zoom-out:before {
  content: "\e955";
}
.ico--shrink:before {
  content: "\e956";
}
.ico--printer:before {
  content: "\e957";
}
.ico--file-openoffice:before {
  content: "\e958";
}
.ico--user:before {
  content: "\e959";
}
.ico--file-excel:before {
  content: "\e95a";
}
.ico--file-word:before {
  content: "\e95b";
}
.ico--file-pdf:before {
  content: "\e95c";
}
.ico--file-picture:before {
  content: "\e95d";
}
.ico--file-blank:before {
  content: "\e95e";
}
.ico--folder-upload:before {
  content: "\e95f";
}
.ico--upload:before {
  content: "\e960";
}
.ico--cloud-upload:before {
  content: "\e961";
}
.ico--folder-download:before {
  content: "\e962";
}
.ico--download:before {
  content: "\e963";
}
.ico--cloud-download:before {
  content: "\e964";
}
.ico--alarm:before {
  content: "\e900";
}
.ico--calculator:before {
  content: "\e911";
}
.ico--facebook-full:before {
  content: "\e913";
}
.ico--feed:before {
  content: "\e927";
}
.ico--library:before {
  content: "\e929";
}
.ico--office:before {
  content: "\e92a";
}
.ico--attachment:before {
  content: "\e92b";
}
.ico--enlarge:before {
  content: "\e92c";
}
.ico--eye-off:before {
  content: "\e92e";
}
.ico--eye:before {
  content: "\e92f";
}
.ico--share:before {
  content: "\e931";
}
.ico--search:before {
  content: "\e939";
}
.ico--pencil:before {
  content: "\e93c";
}
.ico--lock-open:before {
  content: "\e947";
}
.ico--lock:before {
  content: "\e948";
}
.ico--equalizer:before {
  content: "\e949";
}
.ico--switch:before {
  content: "\e94b";
}
.ico--loop:before {
  content: "\e94c";
}
.ico--refresh:before {
  content: "\e94d";
}
.ico--bullhorn:before {
  content: "\e944";
}
.ico--bin:before {
  content: "\e945";
}
.ico--cross:before {
  content: "\e937";
}
.ico--checkbox-checked:before {
  content: "\e938";
}
.ico--globe:before {
  content: "\e93a";
}
.ico--wikipedia:before {
  content: "\e93b";
}
.ico--youtube:before {
  content: "\e936";
}
.ico--users:before {
  content: "\e934";
}
.ico--book:before {
  content: "\e935";
}
.ico--bubbles:before {
  content: "\e930";
}
.ico--map:before {
  content: "\e914";
}
.ico--compass:before {
  content: "\e915";
}
.ico--folder-open:before {
  content: "\e916";
}
.ico--folder:before {
  content: "\e917";
}
.ico--drawer:before {
  content: "\e918";
}
.ico--stop:before {
  content: "\e919";
}
.ico--github:before {
  content: "\e91a";
}
.ico--clock:before {
  content: "\e91b";
}
.ico--calendar:before {
  content: "\e91c";
}
.ico--flickr:before {
  content: "\e91d";
}
.ico--instagram:before {
  content: "\e91e";
}
.ico--twitter:before {
  content: "\e91f";
}
.ico--newspaper:before {
  content: "\e920";
}
.ico--cart:before {
  content: "\e921";
}
.ico--home:before {
  content: "\e922";
}
.ico--link:before {
  content: "\e912";
}
.ico--power:before {
  content: "\e90c";
}
.ico--rocket:before {
  content: "\e946";
}
.ico--location:before {
  content: "\e906";
}
.ico--phone:before {
  content: "\e907";
}
.ico--linkedin:before {
  content: "\e903";
}
.ico--facebook:before {
  content: "\e902";
}
.ico--envelop:before {
  content: "\e972";
}
.ico--bed:before {
  content: "\e969";
}
.ico--train:before {
  content: "\e96a";
}
.ico--bus:before {
  content: "\e96b";
}
.ico--wheelchair:before {
  content: "\e966";
}
.ico--thumbs-down:before {
  content: "\e93d";
}
.ico--thumbs-up:before {
  content: "\e93e";
}
.ico--anchor:before {
  content: "\e92d";
}
.ico--paw:before {
  content: "\e90b";
}
Original line number Diff line number Diff line
@@ -3,9 +3,9 @@
        <div class="flex gap-2">
            <a href="{{ page.url }}">
                {% if page.position %}
                    <strong>{{ page.title }}</strong>
                    <strong>{{ page.full_name }}</strong>
                {% else %}
                    {{ page.title }}
                    {{ page.full_name }}
                {% endif %}
            </a>

Original line number Diff line number Diff line
{% extends "base.html" %}
{% load static wagtailcore_tags %}
{% load static wagtailcore_tags wagtailimages_tags footnotes %}

{% block content %}
<main class="flex flex-col items-center gap-10 pt-14">
    <div class="container">
        <h1 class="font-bebas text-4xl">{{ page.title }}</h1>

        <small class="text-pii-cyan uppercase font-bold">
            {% for tag in page.tags.all %}
                <a
                    href="/clanky?tag={{ tag.name }}"
                    class="px-2 py-0.5 rounded-sm"
                    style="background-color:{{ tag.bg_color }};color:{{ tag.fg_color }}"
                >{{ tag.name }}</a>&nbsp;
            {% endfor %}
        </small>

        <div class="flex flex-col gap-1 mt-3 text-gray-700">
            <div class="flex gap-2 items-center">
                <i class="ico--calendar"></i>
@@ -29,10 +39,17 @@
        </div>

        <div class="mt-5 prose max-w-screen-md font-serif">
            {% if page.image %}
                {% image page.image original as article_image %}
                <img src="{{ article_image.url }}">
            {% endif %}

            <p class="mb-3">{{ page.perex }}</p>

            {{ page.content|richtext }}
            {% richtext_footnotes page.content|richtext %}

            {% include "home/includes/footnotes.html" %}
        </div>
    </div>
</main>
{% endblock content %}
{% endblock %}
Original line number Diff line number Diff line
{% extends "base.html" %}
{% load static wagtailcore_tags %}
{% load static wagtailcore_tags wagtailimages_tags %}

{% block content %}
<main class="flex flex-col items-center gap-10 pt-14">
    <div class="container">
        <h1 class="font-bebas text-4xl mb-4">{{ page.title }}</h1>

        {% if filtered_tag %}
            <div class="text-gray-500 mb-5">
                <span>Filtrovaný štítek: <strong>{{ filtered_tag }}</strong></span>
                <br>
                <a href="/clanky">
                    <i class="ico--chevron-left"></i>
                    <span class="underline">Zpět na seznam</span>
                </a>
            </div>
        {% endif %}

        {% if page.content %}
            <div class="prose font-serif mb-3">
                {{ page.content|richtext }}
@@ -13,30 +24,43 @@
        {% endif %}

        <ul class="flex gap-4 flex-wrap">
            {% for article in page.articles %}
                <li class="bg-pii-cyan lg:h-96 text-white p-7 lg:w-80">
                    <a
                        class="flex flex-col gap-2 h-full"
                        href="{{ article.url }}"
            {% for article in articles %}
                <li class="bg-pii-cyan lg:h-96 text-white w-full lg:w-80 drop-shadow-lg">
                    <a href="{{ article.url }}">
                        {% if article.image and article.show_image_on_homepage %}
                            {% image article.image max-400x400 as article_image %}
                            <img
                                class="w-full bg-white max-h-48 object-cover"
                                src="{{ article_image.url }}"
                                alt="Náhledový obrázek článku"
                            >
                        <small class="text-pii-cyan uppercase font-bold">
                        {% endif %}

                        <div class="p-7 flex flex-col gap-2 h-full">
                            <small class="text-white uppercase font-bold">
                                {% for tag in article.tags.all %}
                                {{ tag.name }}
                                    <span
                                        class="px-2 py-0.5 rounded-sm"
                                        style="background-color:{{ tag.bg_color }};color:{{ tag.fg_color }}"
                                    >{{ tag.name }}</span>&nbsp;
                                {% endfor %}
                            </small>
                            <h3 class="font-serif text-xl leading-6 font-bold">{{ article.title }}</h3>

                            {% if not article.image or not article.show_image_on_homepage %}
                                <p class="font-serif leading-5 grow">
                                    {{ article.shortened_perex }}
                                </p>
                            {% endif %}

                            <small class="font-serif">
                                Přidáno {{ article.date }}
                            </small>
                        </div>
                    </a>
                </li>
            {% endfor %}
        </ul>
    </div>
</main>
{% endblock content %}
{% endblock %}
Original line number Diff line number Diff line
@@ -6,6 +6,14 @@
    <div class="container">
        <h1 class="font-bebas text-4xl">{{ page.title }}</h1>

        <div class="flex flex-col gap-1 mt-3 text-gray-700">
            {% if page.date %}
                <div class="flex gap-2 items-center">
                    <i class="ico--calendar"></i>
                    <div>{{ page.date }}</div>
                </div>
            {% endif %}

            {% if page.author_page %}
                <a
                    class="flex gap-2 items-center"
@@ -20,6 +28,7 @@
                    <div>{{ page.author }}</div>
                </div>
            {% endif %}
        </div>

        <div class="mt-5 prose max-w-screen-md font-serif">
            {{ page.content|richtext }}
@@ -37,4 +46,4 @@
        </div>
    </div>
</main>
{% endblock content %}
{% endblock %}
Original line number Diff line number Diff line
@@ -16,13 +16,13 @@
            {% for event in page.events %}
                <li class="text-gray-500">
                    <a
                        class="flex gap-2 flex-wrap"
                        class="flex flex-col flex-wrap"
                        href="{{ event.url }}"
                    >
                        <div class="underline text-black">{{ event.title }}</div>
                        <div>
                            ({{ event.date }}{% if event.location %},
                                {{ event.location }}{% endif %})
                            {{ event.date }}{% if event.location %},
                                {{ event.location }}{% endif %}
                        </div>
                    </a>
                </li>
@@ -30,4 +30,4 @@
        </ul>
    </div>
</main>
{% endblock content %}
{% endblock %}
Original line number Diff line number Diff line
{% extends "base.html" %}
{% load static wagtailcore_tags %}
{% load static wagtailcore_tags wagtailimages_tags %}

{% block content %}
<main class="flex flex-col items-center gap-10 pt-14">
    <div class="container flex gap-10">
        <figure class="w-32 flex-col gap-2 hidden lg:flex">
            <img
                src="{% static 'images/logo_big.png' %}"
                src="{% static 'home/images/logo_big.png' %}"
                alt="Logo"
            >
            <figcaption class="font-sans leading-4">
@@ -26,25 +26,38 @@

            <ul class="flex gap-4 lg:h-96 lg:flex-nowrap flex-wrap">
                {% for article in page.latest_articles %}
                    <li class="bg-white p-7 lg:w-80">
                        <a
                            class="flex flex-col gap-2 h-full"
                            href="{{ article.url }}"
                    <li class="bg-white lg:w-80">
                        <a href="{{ article.url }}">
                            {% if article.image and article.show_image_on_homepage %}
                                {% image article.image max-400x400 as article_image %}
                                <img
                                    class="w-full max-h-48 object-cover"
                                    src="{{ article_image.url }}"
                                    alt="Náhledový obrázek článku"
                                >
                            {% endif %}

                            <div class="p-7 flex flex-col gap-2 h-full">
                                <small class="text-pii-cyan uppercase font-bold">
                                    {% for tag in article.tags.all %}
                                    {{ tag.name }}
                                        <span
                                            class="px-2 py-0.5 rounded-sm"
                                            style="background-color:{{ tag.bg_color }};color:{{ tag.fg_color }}"
                                        >{{ tag.name }}</span>&nbsp;
                                    {% endfor %}
                                </small>
                                <h3 class="font-serif text-xl leading-6 font-bold">{{ article.title }}</h3>

                                {% if not article.image or not article.show_image_on_homepage %}
                                    <p class="font-serif leading-5 grow">
                                        {{ article.shortened_perex }}
                                    </p>
                                {% endif %}

                                <small class="font-serif">
                                    Přidáno {{ article.date }}
                                </small>
                            </div>
                        </a>
                    </li>
                {% endfor %}
@@ -165,9 +178,9 @@
    </section>

    <section class="container flex flex-col gap-3">
        <span class="invisible relative top-[-8rem]" id="dary"></span>
        <span class="invisible relative top-[-8rem]" id="finance"></span>

        <h2 class="font-bebas text-3xl uppercase leading-7">Dary</h2>
        <h2 class="font-bebas text-3xl uppercase leading-7">Finance</h2>

        <div>
            <h3 class="font-serif text-2xl font-bold">Podpořte institut π</h3>
@@ -223,9 +236,9 @@
            <div class="flex flex-col gap-5 font-serif">
                <section class="flex flex-col gap-4">
                    <h3 class="text-2xl font-bold">Ředitel</h3>
                    <p>
                        {{ page.director_description }}
                    </p>
                    <div>
                        {{ page.director_description|richtext }}
                    </div>

                    <ul class="flex flex-col gap-3">
                        {% for block in page.director %}
@@ -240,9 +253,9 @@

                <section class="flex flex-col gap-4">
                    <h3 class="text-2xl font-bold">Akademická rada</h3>
                    <p>
                        {{ page.academic_council_description }}
                    </p>
                    <div>
                        {{ page.academic_council_description|richtext }}
                    </div>

                    <ul class="flex flex-col gap-3">
                        {% for block in page.academic_council %}
@@ -259,9 +272,9 @@
            <div class="flex flex-col gap-5 font-serif">
                <section class="flex flex-col gap-4">
                    <h3 class="text-2xl font-bold">Kontrolor</h3>
                    <p>
                        {{ page.controller_description }}
                    </p>
                    <div>
                        {{ page.controller_description|richtext }}
                    </div>

                    <ul class="flex flex-col gap-3">
                        {% for block in page.controller %}
@@ -276,9 +289,9 @@
                <section class="flex flex-col gap-4">
                    <h3 class="text-2xl font-bold">Správní rada</h3>

                    <p>
                        {{ page.council_members_description }}
                    </p>
                    <div>
                        {{ page.council_members_description|richtext }}
                    </div>

                    <ul class="flex flex-col gap-3">
                        {% for block in page.council_members %}
@@ -294,9 +307,9 @@
            <div class="font-serif">
                <section class="flex flex-col gap-4">
                    <h3 class="text-2xl font-bold">Dobrovolnický kruh</h3>
                    <p>
                        {{ page.volunteers_description }}
                    </p>
                    <div>
                        {{ page.volunteers_description|richtext }}
                    </div>
                    <h4>
                        <strong>Členové dobrovolnického kruhu</strong>
                    </h4>
@@ -317,9 +330,9 @@
            <h3 class="font-bold font-serif text-2xl">Zaměstnanci</h3>

            <ul class="flex flex-col lg:grid lg:grid-cols-3 lg:grid-rows-3 gap-y-2 gap-x-4 grid-flow-col font-serif">
                <p class="leading-5">
                    {{ page.employees_description }}
                </p>
                <div class="leading-5">
                    {{ page.employees_description|richtext }}
                </div>

                {% for block in page.employees %}
                    {% if block.block_type == "person" %}
@@ -332,4 +345,4 @@
        </section>
    </section>
</main>
{% endblock content %}
{% endblock %}
Original line number Diff line number Diff line
@@ -15,15 +15,19 @@
        <ul class="flex flex-col gap-2 list-disc ml-3 font-serif">
            {% for person in page.people %}
                <li>
                    <div class="flex flex-col">
                        <a
                            class="underline"
                            href="{{ person.url }}"
                    >
                        {{ person.title }}
                    </a>
                        >{{ person.full_name }}</a>

                        {% if person.position %}
                            <span class="text-gray-500">{{ person.inline_position }}</span>
                        {% endif %}
                    </div>
                </li>
            {% endfor %}
        </ul>
    </div>
</main>
{% endblock content %}
{% endblock %}
Original line number Diff line number Diff line
@@ -11,11 +11,11 @@
                <img
                    class="rounded-full w-40 h-40"
                    src="{{ profile_image.url }}"
                    alt="Profilový obrázek osoby {{ page.title }}"
                    alt="Profilový obrázek osoby {{ page.full_name }}"
                >
            {% endif %}
            <div class="flex flex-col">
                <h1 class="font-bebas text-4xl">{{ page.title }}</h1>
                <h1 class="font-bebas text-4xl">{{ page.full_name }}</h1>

                {% if page.position %}
                    <div class="text-gray-500 whitespace-pre-line font-serif">{{ page.position }}</div>
@@ -41,4 +41,4 @@
        {% endif %}
    </div>
</main>
{% endblock content %}
{% endblock %}
Original line number Diff line number Diff line
{% extends "base.html" %}
{% load static wagtailcore_tags %}

{% block content %}
<main class="flex flex-col items-center gap-10 pt-14">
    <div class="container">
        <h1 class="font-bebas text-4xl">{{ page.title }}</h1>

        <div class="flex flex-col gap-1 mt-3 text-gray-700">
            {% if page.date %}
                <div class="flex gap-2 items-center">
                    <i class="ico--calendar"></i>
                    <div>{{ page.date }}</div>
                </div>
            {% endif %}

            {% if page.author_page %}
                <a
                    class="flex gap-2 items-center"
                    href="{{ page.author_page.url }}"
                >
                    <i class="ico--user"></i>
                    <div>{{ page.author_page.title }}</div>
                </a>
            {% elif page.author %}
                <div class="flex gap-2 items-center">
                    <i class="ico--user"></i>
                    <div>{{ page.author }}</div>
                </div>
            {% endif %}
        </div>

        {% if page.content %}
            <div class="mt-5 prose max-w-screen-md font-serif">
                {{ page.content|richtext }}
            </div>
        {% endif %}

        <div class="mt-5 lg:mt-7 flex justify-center">
            <iframe
                class="lg:w-[850px] lg:h-[478px] md:w-[600px] md:h-[366px] w-full h-[200px]"
                src="{{ page.embed_url }}"
                frameborder="0"
                allowfullscreen=""
                sandbox="allow-same-origin allow-scripts allow-popups"
            ></iframe>
        </div>
    </div>
</main>
{% endblock %}
Original line number Diff line number Diff line
{% extends "base.html" %}
{% load static wagtailcore_tags wagtailimages_tags %}

{% block content %}
<main class="flex flex-col items-center gap-10 pt-14">
    <div class="container">
        <h1 class="font-bebas text-4xl mb-4">{{ page.title }}</h1>

        {% if page.content %}
            <div class="prose font-serif mb-5">
                {{ page.content|richtext }}
            </div>
        {% endif %}

        <ul class="flex flex-col gap-5 font-serif">
            {% for video in page.videos %}
                <a href="{{ video.url }}">
                    <li class="
                        flex gap-6 md:flex-row flex-col
                        {% if not forloop.last %}
                            border-b border-gray-100 pb-5
                        {% endif %}
                    ">
                        <div class="drop-shadow-lg bg-white">
                            {% image video.thumbnail max-500x500 as thumbnail_image %}
                            <img
                                class="md:h-40 md:w-64 w-full max-h-48 object-cover"
                                src="{{ thumbnail_image.url }}"
                                alt="Náhledový obrázek videa"
                            >
                        </div>
                        <div class="flex flex-col">
                            <h2 class="text-lg font-bold">{{ video.title }}</h2>
                            <span class="text-gray-500">{{ video.date }}</span>
                        </div>
                    </li>
                </a>
            {% endfor %}
        </ul>
    </div>
</main>
{% endblock %}
Original line number Diff line number Diff line
{% load wagtailcore_tags %}

{% if page.footnotes_list %}
    <div class="footnotes" id="footnotes">
        <hr class="my-8">
        <ol>
            {% for footnote in page.footnotes_list %}
                <li id="footnote-{{ forloop.counter }}">
                    <div class="[&>p]:inline">
                        {{ footnote.text|richtext }}
                        &nbsp;<a
                            href="#footnote-source-{{ forloop.counter }}"
                            aria-label="Přeskočit na obsah"
                        ></a>
                    </div>
                </li>
            {% endfor %}
        </ol>
    </div>
{% endif %}
+43 −0
Original line number Diff line number Diff line
import re

from django.template import Library
from django.utils.safestring import mark_safe
from wagtail.models import Page

register = Library()


@register.simple_tag(takes_context=True)
def richtext_footnotes(context, html):
    """
    example: {% richtext_footnotes page.body|richtext %}

    html: already processed richtext field html
    Assumes "page" in context.
    """
    FIND_FOOTNOTE_TAG = re.compile(r'<footnote id="(.*?)">.*?</footnote>')

    if not isinstance(context.get("page"), Page):
        return html

    page = context["page"]
    if not hasattr(page, "footnotes_list"):
        page.footnotes_list = []
    footnotes = {str(footnote.uuid): footnote for footnote in page.footnotes.all()}

    def replace_tag(match):
        try:
            index = process_footnote(match.group(1), page)
        except (KeyError, ValidationError):
            return ""
        else:
            return f'<a href="#footnote-{index}" id="footnote-source-{index}"><sup>[{index}]</sup></a>'

    def process_footnote(footnote_id, page):
        footnote = footnotes[footnote_id]
        if footnote not in page.footnotes_list:
            page.footnotes_list.append(footnote)
        # Add 1 to the index as footnotes are indexed starting at 1 not 0.
        return page.footnotes_list.index(footnote) + 1

    return mark_safe(FIND_FOOTNOTE_TAG.sub(replace_tag, html))
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ INSTALLED_APPS = [
    "wagtail.contrib.forms",
    "wagtail.contrib.redirects",
    "wagtail.contrib.routable_page",
    "wagtail.contrib.settings",
    "wagtail.contrib.modeladmin",
    "wagtail.embeds",
    "wagtail.sites",
    "wagtail.users",
@@ -47,9 +49,11 @@ INSTALLED_APPS = [
    "wagtail.images",
    "wagtail.search",
    "wagtail.admin",
    "wagtail_footnotes",
    "wagtail",
    "modelcluster",
    "taggit",
    "wagtail_color_panel",
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
@@ -84,6 +88,7 @@ TEMPLATES = [
                "django.template.context_processors.request",
                "django.contrib.auth.context_processors.auth",
                "django.contrib.messages.context_processors.messages",
                "wagtail.contrib.settings.context_processors.settings",
            ],
        },
    },
+0 −129
Original line number Diff line number Diff line
@font-face {
  font-family: "pirati-ui";
  src:
    url("./pirati-ui.eot") format("embedded-opentype"),
    url("./pirati-ui.ttf") format("truetype"),
    url("./pirati-ui.woff") format("woff"),
    url("./pirati-ui.svg") format("svg");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

[class^="ico--"], [class*=" ico--"] {
  /* Use !important to prevent issues with browser extensions that change fonts */
  font-family: "pirati-ui" !important;
  speak: never;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;

  /* Better Font Rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ico--dots-three-vertical:before { content: "\e940"; }
.ico--dots-three-horizontal:before { content: "\e941"; }
.ico--log-out:before { content: "\e942"; }
.ico--envelope:before { content: "\e908"; }
.ico--pin:before { content: "\e943"; }
.ico--at:before { content: "\e905"; }
.ico--strategy:before { content: "\e932"; }
.ico--pig:before { content: "\e928"; }
.ico--thermometer:before { content: "\e90a"; }
.ico--menu:before { content: "\e933"; }
.ico--chevron-right:before { content: "\e923"; }
.ico--chevron-left:before { content: "\e924"; }
.ico--chevron-down:before { content: "\e925"; }
.ico--chevron-up:before { content: "\e926"; }
.ico--link-horizontal:before { content: "\e910"; }
.ico--beer:before { content: "\e909"; }
.ico--pirati:before { content: "\e90d"; }
.ico--jitsi:before { content: "\e90f"; }
.ico--open-source:before { content: "\e90e"; }
.ico--thumbs-down:before { content: "\e93d"; }
.ico--thumbs-up:before { content: "\e93e"; }
.ico--anchor:before { content: "\e92d"; }
.ico--paw:before { content: "\e90b"; }
.ico--checkmark:before { content: "\e965"; }
.ico--info:before { content: "\e901"; }
.ico--question:before { content: "\e904"; }
.ico--warning:before { content: "\e93f"; }
.ico--code:before { content: "\e94a"; }
.ico--checkbox-unchecked:before { content: "\e94e"; }
.ico--star-full:before { content: "\e94f"; }
.ico--star-empty:before { content: "\e950"; }
.ico--bookmark:before { content: "\e951"; }
.ico--cog:before { content: "\e952"; }
.ico--key:before { content: "\e953"; }
.ico--zoom-in:before { content: "\e954"; }
.ico--zoom-out:before { content: "\e955"; }
.ico--shrink:before { content: "\e956"; }
.ico--printer:before { content: "\e957"; }
.ico--file-openoffice:before { content: "\e958"; }
.ico--user:before { content: "\e959"; }
.ico--file-excel:before { content: "\e95a"; }
.ico--file-word:before { content: "\e95b"; }
.ico--file-pdf:before { content: "\e95c"; }
.ico--file-picture:before { content: "\e95d"; }
.ico--file-blank:before { content: "\e95e"; }
.ico--folder-upload:before { content: "\e95f"; }
.ico--upload:before { content: "\e960"; }
.ico--cloud-upload:before { content: "\e961"; }
.ico--folder-download:before { content: "\e962"; }
.ico--download:before { content: "\e963"; }
.ico--cloud-download:before { content: "\e964"; }
.ico--alarm:before { content: "\e900"; }
.ico--calculator:before { content: "\e911"; }
.ico--facebook-full:before { content: "\e913"; }
.ico--feed:before { content: "\e927"; }
.ico--library:before { content: "\e929"; }
.ico--office:before { content: "\e92a"; }
.ico--attachment:before { content: "\e92b"; }
.ico--enlarge:before { content: "\e92c"; }
.ico--eye-off:before { content: "\e92e"; }
.ico--eye:before { content: "\e92f"; }
.ico--share:before { content: "\e931"; }
.ico--search:before { content: "\e939"; }
.ico--pencil:before { content: "\e93c"; }
.ico--lock-open:before { content: "\e947"; }
.ico--lock:before { content: "\e948"; }
.ico--equalizer:before { content: "\e949"; }
.ico--switch:before { content: "\e94b"; }
.ico--loop:before { content: "\e94c"; }
.ico--refresh:before { content: "\e94d"; }
.ico--bullhorn:before { content: "\e944"; }
.ico--bin:before { content: "\e945"; }
.ico--cross:before { content: "\e937"; }
.ico--checkbox-checked:before { content: "\e938"; }
.ico--globe:before { content: "\e93a"; }
.ico--wikipedia:before { content: "\e93b"; }
.ico--youtube:before { content: "\e936"; }
.ico--users:before { content: "\e934"; }
.ico--book:before { content: "\e935"; }
.ico--bubbles:before { content: "\e930"; }
.ico--map:before { content: "\e914"; }
.ico--compass:before { content: "\e915"; }
.ico--folder-open:before { content: "\e916"; }
.ico--folder:before { content: "\e917"; }
.ico--drawer:before { content: "\e918"; }
.ico--stop:before { content: "\e919"; }
.ico--github:before { content: "\e91a"; }
.ico--clock:before { content: "\e91b"; }
.ico--calendar:before { content: "\e91c"; }
.ico--flickr:before { content: "\e91d"; }
.ico--instagram:before { content: "\e91e"; }
.ico--twitter:before { content: "\e91f"; }
.ico--newspaper:before { content: "\e920"; }
.ico--cart:before { content: "\e921"; }
.ico--home:before { content: "\e922"; }
.ico--link:before { content: "\e912"; }
.ico--power:before { content: "\e90c"; }
.ico--rocket:before { content: "\e946"; }
.ico--location:before { content: "\e906"; }
.ico--phone:before { content: "\e907"; }
.ico--linkedin:before { content: "\e903"; }
.ico--facebook:before { content: "\e902"; }
Original line number Diff line number Diff line
{% extends "base.html" %}

{% block title %}Page not found{% endblock %}

{% block body_class %}template-404{% endblock %}
{% load static wagtailcore_tags %}

{% block content %}
<h1>Page not found</h1>

<h2>Sorry, this page could not be found.</h2>
<main class="flex flex-col items-center gap-10 pt-14">
    <div class="container">
        <h1 class="font-bebas text-4xl">Stránka nenalezena</h1>

        <p class="prose font-serif">
            Stránka byla smazána, nebo se nacházela na staré verzi webu.<br>
            Nové články můžeš nalézt <a href="/clanky">zde</a>.
        </p>
    </div>
</main>
{% endblock %}
Original line number Diff line number Diff line
<!DOCTYPE html>
<html lang="en" dir="ltr">
    <head>
        <meta charset="utf-8" />
        <title>Internal server error</title>
        <meta name="viewport" content="width=device-width, initial-scale=1" />
    </head>
    <body>
        <h1>Internal server error</h1>
{% extends "base.html" %}
{% load static wagtailcore_tags %}

        <h2>Sorry, there seems to be an error. Please try again soon.</h2>
    </body>
</html>
{% block content %}
<main class="flex flex-col items-center gap-10 pt-14">
    <div class="container">
        <h1 class="font-bebas text-4xl">Chyba serveru</h1>

        <p class="prose font-serif">
            Nastala chyba z naší strany. Pokud přetrvá, kontaktuj prosím správce webu.
        </p>
    </div>
</main>
{% endblock %}
Original line number Diff line number Diff line
@@ -25,17 +25,17 @@

        {# Global stylesheets #}
        <link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}">
        <link rel="stylesheet" type="text/css" href="{% static 'fonts/pirati-ui/style.css' %}">
        <link rel="stylesheet" type="text/css" href="{% static 'home/fonts/pirati-ui/style.css' %}?v=2">
        <link
            rel="stylesheet"
            href="{% static 'fonts/bebas-neue/style.css' %}"
            href="{% static 'home/fonts/bebas-neue/style.css' %}"
        >
        <link
            rel="stylesheet"
            href="{% static 'fonts/source-serif/style.css' %}"
            href="{% static 'home/fonts/source-serif/style.css' %}"
        >

        <link rel="icon" type="image/png" href="{% static 'images/logo_big.png' %}">
        <link rel="icon" type="image/png" href="{% static 'home/images/logo_big.png' %}">

        {% block extra_css %}
        {# Override this in templates to add extra stylesheets #}
@@ -45,14 +45,15 @@
    <body>
        {% wagtailuserbar %}

        <nav class="sticky top-0 drop-shadow-lg bg-grey-800 py-8 flex justify-center">
            <div class="flex gap-7 container text-white items-center">
        <nav class="sticky top-0 drop-shadow-lg bg-grey-800 py-8 flex justify-center z-50">
            <div class="flex justify-between container">
                <div class="flex gap-7 text-white items-center">
                    <a
                        href="/"
                    >
                        <img
                            class="h-9"
                        src="{% static 'images/logo.png' %}"
                            src="{% static 'home/images/logo.png' %}"
                            alt="Logo"
                        >
                    </a>
@@ -63,11 +64,19 @@

                    <div class="gap-4 hidden md:flex">
                        <a class="nav__item" href="/clanky">Články</a>
                        <a class="nav__item" href="/analyzy">Analýzy</a>
                        <a class="nav__item" href="/akce">Akce</a>
                        <a class="nav__item" href="/dokumenty">Dokumenty</a>
                    <a class="nav__item" href="/#dary">Dary</a>
                    <a class="nav__item" href="/#kontakty">Kontakty</a>
                    <a class="nav__item" href="/#lide">Lidé</a>
                        <a class="nav__item" href="/lide">Lidé</a>
                        <a class="nav__item" href="/videa">Videa</a>
                        <a class="nav__item" href="/#finance">Finance</a>
                    </div>
                </div>

                <div class="md:hidden block">
                    <a href="#mobile-menu" class="text-white text-4xl">
                        <i class="ico--menu" aria-label="Otevřít menu"></i>
                    </a>
                </div>
            </div>
        </nav>
@@ -78,13 +87,93 @@

        <div class="flex justify-center bg-gray-100">
            <footer class="container text-gray-500 py-8">
                <a href="/feeds/atom" class="flex gap-2 items-center max-w-max">
                    <i class="ico--feed"></i>
                <div class="flex gap-2 justify-between items-start w-full">
                    <div class="flex flex-col gap-3">
                        <a href="https://creativecommons.org/licenses/by-sa/4.0/">
                            <img
                                class="h-8 opacity-75"
                                src="{% static 'home/images/cc-by-sa.png' %}"
                                alt="Licence CC BY-SA 4.0"
                            >
                        </a>
                        <a href="/#kontakty" class="flex gap-2 items-center max-w-max">
                            <i class="ico--envelope"></i>
                            <span>Kontakty</span>
                        </a>
                    </div>

                    <div class="flex flex-col">
                        {% if settings.home.SocialMediaSettings.mastodon %}
                            <a href="{{ settings.home.SocialMediaSettings.mastodon }}" class="flex gap-2 items-center h-8">
                                <span class="w-6 text-2xl"><i class="ico--mastodon ml-[-0.25rem]"></i></span>
                                <span>Mastodon</span>
                            </a>
                        {% endif %}
                        {% if settings.home.SocialMediaSettings.twitter %}
                            <a href="{{ settings.home.SocialMediaSettings.twitter }}" class="flex gap-2 items-center h-8">
                                <span class="w-6 text-xl font-bold">𝕏<!-- Fuck you, Twitter --></span>
                                <span>Twitter</span>
                            </a>
                        {% endif %}
                        {% if settings.home.SocialMediaSettings.linkedin %}
                            <a href="{{ settings.home.SocialMediaSettings.linkedin }}" class="flex gap-2 items-center h-8">
                                <span class="w-6 text-xl font-bold"><i class="ico--linkedin"></i></span>
                                <span>LinkedIn</span>
                            </a>
                        {% endif %}
                        {% if settings.home.SocialMediaSettings.facebook %}
                            <a href="{{ settings.home.SocialMediaSettings.facebook }}" class="flex gap-2 items-center h-8">
                                <span class="w-6 text-xl font-bold"><i class="ico--facebook"></i></span>
                                <span>Facebook</span>
                            </a>
                        {% endif %}
                        <a href="/feeds/atom" class="flex gap-2 items-center max-w-max h-8">
                            <span class="w-6"><i class="ico--feed"></i></span>
                            <span>RSS</span>
                        </a>
                    </div>
                </div>
            </footer>
        </div>

        <div class="fixed top-0 left-0 p-3 w-full h-full bg-grey-800 z-50 hidden overflow-y-auto target:block text-white" id="mobile-menu">
            <div class="flex flex-col p-3 gap-4">
                <a
                    role="button"
                    href="#"
                    aria-label="Zavřít menu"
                    title="Zavřít menu"
                >
                    <i class="ico--chevron-left text-white text-2xl"></i>
                </a>

                <div class="flex flex-col gap-1 text-2xl">
                    <a class="nav__item" href="/clanky">Články</a>
                    <a class="nav__item" href="/akce">Akce</a>
                    <a class="nav__item" href="/dokumenty">Dokumenty</a>
                    <a class="nav__item" href="/lide">Lidé</a>
                    <a class="nav__item" href="/videa">Videa</a>
                    <a class="nav__item" href="/#finance">Finance</a>
                </div>
            </div>
        </div>

        {% block extra_js %}{% endblock %}

        <!-- Matomo -->
            <script>
                var _paq = window._paq = window._paq || [];
                /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
                _paq.push(['trackPageView']);
                _paq.push(['enableLinkTracking']);
                (function() {
                    var u="//matomo.pii.cz/";
                    _paq.push(['setTrackerUrl', u+'matomo.php']);
                    _paq.push(['setSiteId', '1']);
                    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
                    g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
                })();
            </script>
        <!-- End Matomo Code -->
    </body>
</html>
Original line number Diff line number Diff line
@@ -4,10 +4,12 @@ from django.urls import include, path
from wagtail import urls as wagtail_urls
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.documents import urls as wagtaildocs_urls
from wagtail_footnotes import urls as footnotes_urls

urlpatterns = [
    path("django-admin/", admin.site.urls),
    path("admin/", include(wagtailadmin_urls)),
    path("footnotes/", include(footnotes_urls)),
    path("documents/", include(wagtaildocs_urls)),
]

Original line number Diff line number Diff line
dj-database-url==2.0.0
django-environ==0.9.0
django-taggit==3.1.0
django-modelcluster==6.0
psycopg2-binary==2.9.6
wagtail==5.0.2
wagtail-footnotes==0.10.0
wagtail-color-panel==1.4.1