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
Loading items

Target

Select target project
  • pi/pi-cms
  • mail1/pi-cms
2 results
Select Git revision
Loading items
Show changes
Showing
with 706 additions and 152 deletions
<li>
<a
href="{% if self.url %}{{ self.url }}{% else %}{{ self.file.url }}{% endif %}"
target="_blank"
>
<h3 class="font-serif leading-4">
{{ self.name }}
</h3>
{% if self.date_added %}
<small class="font-serif">Přidáno {{ self.date_added }}</small>
{% endif %}
</a>
</li>
<a href="{{ self.url }}" target="_blank">
<li class="flex flex-col">
{% if self.date or self.location %}
<small class="text-pii-cyan uppercase">
{% if self.date %}
{{ self.date.day }}. {{ self.date.month }}. {{ self.date.year }}
{% endif %}
{% if self.location %}
{% if self.date %}
&nbsp;|&nbsp;
{% endif %}
{{ self.location }}
{% endif %}
</small>
{% endif %}
<span
class="font-bold font-serif text-xl"
>{{ self.name }}</span>
</li>
</a>
<li>
<div class="flex gap-2">
<div class="flex gap-2">
<a href="{{ page.url }}">
{% if page.position %}
<strong>{{ page.full_name }}</strong>
{% else %}
{{ page.full_name }}
{% endif %}
</a>
{% if page.email %}
<a href="mailto:{{ page.email }}">
<div class="flex items-center">
<i class="ico--at text-xl text-pii-cyan"></i>
</div>
</a>
{% endif %}
</div>
</div>
{% if page.position %}
<p class="leading-4 whitespace-pre-line">{{ page.position }}</p>
{% endif %}
</li>
{% load wagtailcore_tags %}
<p>{{ item.perex }}</p>
{{ item.content|richtext }}
{% 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="flex gap-2">
<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>
<div>{{ page.date }}</div>
{% if page.author %}
<div>| {{ page.author }}</div>
</div>
{% 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 %}
</small>
</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 %}
{% 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">
<ul class="flex gap-4 lg:h-96 lg:flex-nowrap flex-wrap">
{% for article in page.articles %}
<li class="bg-pii-cyan text-white p-7 lg:w-80">
<a
class="flex flex-col gap-2 h-full"
href="{{ article.url }}"
<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 }}
</div>
{% endif %}
<ul class="flex gap-4 flex-wrap">
{% 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 %}
{% 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>
<div class="mt-5 prose max-w-screen-md font-serif">
{{ page.content|richtext }}
</div>
<div class="mt-4">
<a
class="text-lg font-bold flex gap-2 items-center"
href="{{ page.document.url }}"
target="_blank"
>
<i class="ico--download"></i>
<div class="underline">Stáhnout</div>
</a>
</div>
</div>
</main>
{% endblock %}
{% 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 mb-4">{{ page.title }}</h1>
{% if page.content %}
<div class="prose font-serif mb-3">
{{ page.content|richtext }}
</div>
{% endif %}
<ul class="flex flex-col gap-2 list-disc ml-3 font-serif">
{% for document in page.documents %}
<li>
<a
class="underline"
href="{{ document.url }}"
>
{{ document.title }}
</a>
</li>
{% endfor %}
</ul>
</div>
</main>
{% endblock %}
{% 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.location %}
<div class="flex gap-2 items-center">
<i class="ico--location"></i>
<div>{{ page.location }}</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>
<div class="mt-5 prose max-w-screen-md font-serif">
{{ page.content|richtext }}
</div>
</div>
</main>
{% endblock %}
{% 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 mb-4">{{ page.title }}</h1>
{% if page.content %}
<div class="prose font-serif mb-3">
{{ page.content|richtext }}
</div>
{% endif %}
<ul class="flex flex-col gap-2 list-disc ml-3 font-serif">
{% for event in page.events %}
<li class="text-gray-500">
<a
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 %}
</div>
</a>
</li>
{% endfor %}
</ul>
</div>
</main>
{% endblock %}
{% 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">
......@@ -15,7 +15,7 @@
</small>
</figcaption>
</figure>
<section class="prose font-leadingserif -6 text-black w-full max-w-full lg:max-w-prose" id="uvod">
<section class="prose font-serif leading-6 text-black w-full max-w-full lg:max-w-prose" id="uvod">
{{ page.heading_text|richtext }}
</section>
</div>
......@@ -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 %}
......@@ -56,7 +69,7 @@
href="{{ page.articles_page.url }}"
>
<i class="ico--chevron-right"></i>
<div>Načíst další články</div>
<div>Další články</div>
</a>
</div>
</div>
......@@ -67,36 +80,107 @@
<ul class="flex gap-14">
<div class="flex flex-col gap-3">
{% for block in page.events|slice:"0:4" %}
{% include_block block %}
{% for event in page.latest_events|slice:"0:4" %}
<a href="{{ event.url }}" target="_blank">
<li class="flex flex-col">
{% if event.date or event.location %}
<small class="text-pii-cyan uppercase">
{% if event.date %}
{{ event.date.day }}. {{ event.date.month }}. {{ event.date.year }}
{% endif %}
{% if event.location %}
{% if event.date %}
&nbsp;|&nbsp;
{% endif %}
{{ event.location }}
{% endif %}
</small>
{% endif %}
<span
class="font-bold font-serif text-xl"
>{{ event.title }}</span>
</li>
</a>
{% endfor %}
</div>
<div class="hidden lg:block">
{% if page.events|length > 4 %}
{% if page.latest_events|length > 4 %}
<div class="flex flex-col gap-3 border-l-2 pl-14 border-pii-cyan">
{% for block in page.events|slice:"4:8" %}
{% include_block block %}
{% for event in page.latest_events|slice:"4:8" %}
<a href="{{ event.url }}" target="_blank">
<li class="flex flex-col">
{% if event.date or event.location %}
<small class="text-pii-cyan uppercase">
{% if event.date %}
{{ event.date.day }}. {{ event.date.month }}. {{ event.date.year }}
{% endif %}
{% if event.location %}
{% if event.date %}
&nbsp;|&nbsp;
{% endif %}
{{ event.location }}
{% endif %}
</small>
{% endif %}
<span
class="font-bold font-serif text-xl"
>{{ event.title }}</span>
</li>
</a>
{% endfor %}
</div>
{% endif %}
</div>
</ul>
<a
class="flex gap-2 font-bebas text-2xl uppercase mt-4"
href="{{ page.events_page.url }}"
>
<i class="ico--chevron-right"></i>
<div>Další akce</div>
</a>
</section>
<section class="flex justify-center bg-grey-50 p-10 w-full lg:flex-nowrap flex-wrap" id="dokumenty">
<div class="container flex flex-col gap-3">
<div class="container">
<div class="flex flex-col gap-3">
<h2 class="font-bebas text-3xl uppercase leading-7">Dokumenty</h2>
<ul class="flex flex-col lg:grid lg:grid-cols-3 lg:grid-rows-2 gap-y-3 gap-x-6 grid-flow-col">
{% for block in page.documents %}
{% include_block block %}
{% for document in page.latest_documents %}
<li>
<a
href="{{ document.url }}"
target="_blank"
>
<h3 class="font-serif leading-4">
{{ document.title }}
</h3>
{% if document.date %}
<small class="font-serif">Přidáno {{ document.date }}</small>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div>
<a
class="flex gap-2 font-bebas text-2xl uppercase mt-4"
href="{{ page.documents_page.url }}"
>
<i class="ico--chevron-right"></i>
<div>Další dokumenty</div>
</a>
</div>
</section>
<section class="container flex flex-col gap-3" id="dary">
<h2 class="font-bebas text-3xl uppercase leading-7">Dary</h2>
<section class="container flex flex-col gap-3">
<span class="invisible relative top-[-8rem]" id="finance"></span>
<h2 class="font-bebas text-3xl uppercase leading-7">Finance</h2>
<div>
<h3 class="font-serif text-2xl font-bold">Podpořte institut π</h3>
......@@ -107,7 +191,9 @@
</div>
</section>
<section class="flex justify-center bg-grey-50 p-10 w-full" id="kontakty">
<section class="flex justify-center bg-grey-50 p-10 w-full">
<span class="invisible relative top-[-8rem]" id="kontakty"></span>
<div class="container flex flex-col gap-3">
<h2 class="font-bebas text-3xl uppercase leading-7">Kontakty</h2>
......@@ -141,67 +227,79 @@
</div>
</section>
<section class="container flex flex-col gap-3" id="lide">
<section class="container flex flex-col gap-3">
<span class="invisible relative top-[-8rem]" id="lide"></span>
<h2 class="font-bebas text-3xl uppercase leading-7">Lidé</h2>
<div class="flex flex-col lg:grid lg:grid-cols-3 gap-20 min-h-screen">
<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>
Ředitel je statutárním orgánem ústavu,
řídí jeho činnost, jedná jeho jménem
a rozhoduje ve všech záležitostech, které
nespadají do pravomoci jiných orgánů.
</p>
<div>
{{ page.director_description|richtext }}
</div>
<ul>
<ul class="flex flex-col gap-3">
{% for block in page.director %}
{% if block.block_type == "person" %}
{% include_block block %}
{% else %}
{% include "home/blocks/person_page_block.html" with page=block.value %}
{% endif %}
{% endfor %}
</ul>
</section>
<section class="flex flex-col gap-4">
<h3 class="text-2xl font-bold">Akademická rada</h3>
<p>
Akademická rada je poradním orgánem
ústavu a v rámci své činnosti zejména
poskytuje správní radě stanoviska
k ideovému směřování, strategickým
materiálům, rozpočtu a plánu činností
ústavu. Dále vykonává akademická rada
dohled nad ideovou a odbornou kvalitou
výstupů ústavu.
</p>
<div>
{{ page.academic_council_description|richtext }}
</div>
<ul class="flex flex-col gap-3">
{% for block in page.academic_council %}
{% if block.block_type == "person" %}
{% include_block block %}
{% else %}
{% include "home/blocks/person_page_block.html" with page=block.value %}
{% endif %}
{% endfor %}
</ul>
</section>
</div>
<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>
Kontrolor je kontrolním orgánem ústavu.
</p>
<div>
{{ page.controller_description|richtext }}
</div>
<ul>
<ul class="flex flex-col gap-3">
{% for block in page.controller %}
{% if block.block_type == "person" %}
{% include_block block %}
{% else %}
{% include "home/blocks/person_page_block.html" with page=block.value %}
{% endif %}
{% endfor %}
</ul>
</section>
</div>
<div class="font-serif">
<section class="flex flex-col gap-4">
<h3 class="text-2xl font-bold">Správní rada</h3>
<p>
Správní rada dbá o zachování účelu, pro
nějž byl ústav založen, a dohlíží na řádné
hospodaření s jeho majetkem.
</p>
<div>
{{ page.council_members_description|richtext }}
</div>
<ul class="flex flex-col gap-3">
{% for block in page.council_members %}
{% if block.block_type == "person" %}
{% include_block block %}
{% else %}
{% include "home/blocks/person_page_block.html" with page=block.value %}
{% endif %}
{% endfor %}
</ul>
</section>
......@@ -209,20 +307,19 @@
<div class="font-serif">
<section class="flex flex-col gap-4">
<h3 class="text-2xl font-bold">Dobrovolnický kruh</h3>
<p>
Dobrovolnický kruh je participační orgán
ústavu. Účelem dobrovolnického kruhu je
sdružovat osoby, které se chtějí dobrovolně
podílet na činnostech ústavu, a navrhovat
správní radě projekty pro realizaci ústavem
v souladu s účelem ústavu.
</p>
<div>
{{ page.volunteers_description|richtext }}
</div>
<h4>
<strong>Členové dobrovolnického kruhu</strong>
</h4>
<ul class="flex flex-col leading-5">
{% for block in page.volunteers %}
{% if block.block_type == "person" %}
{% include_block block %}
{% else %}
{% include "home/blocks/person_page_block.html" with page=block.value %}
{% endif %}
{% endfor %}
</ul>
</section>
......@@ -233,17 +330,19 @@
<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">
Zaměstnanci poskytují administrativní,<br>
organizační a expertní podporu pro<br>
vykonávání činností ústavu.
</p>
<div class="leading-5">
{{ page.employees_description|richtext }}
</div>
{% for block in page.employees %}
{% if block.block_type == "person" %}
{% include_block block %}
{% else %}
{% include "home/blocks/person_page_block.html" with page=block.value %}
{% endif %}
{% endfor %}
</ul>
</section>
</section>
</main>
{% endblock content %}
{% endblock %}
{% 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 mb-4">{{ page.title }}</h1>
{% if page.content %}
<div class="prose font-serif mb-3">
{{ page.content|richtext }}
</div>
{% endif %}
<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.full_name }}</a>
{% if person.position %}
<span class="text-gray-500">{{ person.inline_position }}</span>
{% endif %}
</div>
</li>
{% endfor %}
</ul>
</div>
</main>
{% endblock %}
{% extends "base.html" %}
{% load static wagtailcore_tags wagtailimages_tags %}
{% block content %}
<main class="flex justify-center pt-14">
<div class="container flex flex-col gap-5">
<div class="flex gap-3">
{% if page.image %}
{% image page.image max-400x400 as profile_image %}
<img
class="rounded-full w-40 h-40"
src="{{ profile_image.url }}"
alt="Profilový obrázek osoby {{ page.full_name }}"
>
{% endif %}
<div class="flex flex-col">
<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>
{% endif %}
{% if page.email %}
<hr class="my-2">
<a class="flex gap-2 font-serif text-gray-500" href="mailto:{{ page.email }}">
<div class="flex items-center">
<i class="ico--at text-xl"></i>
</div>
<span>{{ page.email }}</span>
</a>
{% endif %}
</div>
</div>
{% if page.description %}
<div class="prose max-w-screen-md font-serif">
{{ page.description|richtext }}
</div>
{% endif %}
</div>
</main>
{% endblock %}
{% 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 %}
{% 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 %}
{% 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 %}
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))
This diff is collapsed.
This diff is collapsed.