Skip to content
Snippets Groups Projects
Commit d9e9458d authored by OndraPetrzilka's avatar OndraPetrzilka
Browse files

twocolumntextblock, contact_page template

parent b2b0fd0c
No related branches found
No related tags found
3 merge requests!607Pirati.cz,!589Feature/pirati cz ondra,!575Feature/pirati cz
Pipeline #9421 passed
...@@ -6,6 +6,7 @@ from wagtail.core.blocks import ( ...@@ -6,6 +6,7 @@ from wagtail.core.blocks import (
StructBlock, StructBlock,
TextBlock, TextBlock,
URLBlock, URLBlock,
RichTextBlock
) )
from wagtail.documents.blocks import DocumentChooserBlock from wagtail.documents.blocks import DocumentChooserBlock
from wagtail.images.blocks import ImageChooserBlock from wagtail.images.blocks import ImageChooserBlock
...@@ -174,4 +175,13 @@ class ArticleDownloadBlock(StructBlock): ...@@ -174,4 +175,13 @@ class ArticleDownloadBlock(StructBlock):
template = "main/blocks/article_download_block.html" template = "main/blocks/article_download_block.html"
class TwoTextColumnBlock(StructBlock):
text_column_1 = RichTextBlock(label="První sloupec textu")
text_column_2 = RichTextBlock(label="Druhý sloupec textu")
class Meta:
icon = "text"
label = "Text ve dvou sloupcích"
# TwitterCarouselBlock # TwitterCarouselBlock
# Generated by Django 4.0.7 on 2022-08-24 19:58
from django.db import migrations
import wagtail.blocks
import wagtail.fields
class Migration(migrations.Migration):
dependencies = [
('main', '0017_remove_mainarticlespage_timeline'),
]
operations = [
migrations.AlterField(
model_name='maincontactpage',
name='contact_boxes',
field=wagtail.fields.StreamField([('item', wagtail.blocks.StructBlock([('button_link', wagtail.blocks.URLBlock(label='Odkaz tlačítka')), ('button_text', wagtail.blocks.CharBlock(label='Text tlačítka')), ('title', wagtail.blocks.CharBlock(label='Titulek')), ('subtitle', wagtail.blocks.CharBlock(label='Podtitulek'))]))], blank=True, use_json_field=None, verbose_name='Kontaktní boxy'),
),
]
# Generated by Django 4.0.7 on 2022-08-24 20:25
from django.db import migrations
import wagtail.blocks
import wagtail.fields
class Migration(migrations.Migration):
dependencies = [
('main', '0018_alter_maincontactpage_contact_boxes'),
]
operations = [
migrations.AlterField(
model_name='maincontactpage',
name='text',
field=wagtail.fields.StreamField([('two_columns_text', wagtail.blocks.StructBlock([('text_column_1', wagtail.blocks.RichTextBlock(label='První sloupec textu')), ('text_column_2', wagtail.blocks.RichTextBlock(label='Druhý sloupec textu'))]))], blank=True, use_json_field=None, verbose_name='Kontaktní informace'),
),
]
...@@ -46,7 +46,6 @@ class ARTICLE_TYPES(models.IntegerChoices): ...@@ -46,7 +46,6 @@ class ARTICLE_TYPES(models.IntegerChoices):
class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin, Page): class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin, Page):
# header # header
contact_newcomers = models.URLField( contact_newcomers = models.URLField(
...@@ -295,7 +294,6 @@ class MainArticleTag(TaggedItemBase): ...@@ -295,7 +294,6 @@ class MainArticleTag(TaggedItemBase):
class MainArticlePage( class MainArticlePage(
ArticleMixin, ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page ArticleMixin, ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page
): ):
### FIELDS ### FIELDS
article_type = models.PositiveSmallIntegerField( article_type = models.PositiveSmallIntegerField(
"Typ článku", choices=ARTICLE_TYPES.choices, default=ARTICLE_TYPES.PRESS_RELEASE "Typ článku", choices=ARTICLE_TYPES.choices, default=ARTICLE_TYPES.PRESS_RELEASE
...@@ -364,7 +362,6 @@ class MainArticlePage( ...@@ -364,7 +362,6 @@ class MainArticlePage(
class MainProgramPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page): class MainProgramPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page):
### FIELDS ### FIELDS
perex = models.TextField() perex = models.TextField()
...@@ -394,7 +391,6 @@ class MainProgramPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin ...@@ -394,7 +391,6 @@ class MainProgramPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin
class MainPeoplePage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page): class MainPeoplePage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page):
### FIELDS ### FIELDS
perex = models.TextField() perex = models.TextField()
...@@ -424,7 +420,6 @@ class MainPeoplePage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, ...@@ -424,7 +420,6 @@ class MainPeoplePage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin,
class MainPersonPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page): class MainPersonPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page):
### FIELDS ### FIELDS
main_image = models.ForeignKey( main_image = models.ForeignKey(
"wagtailimages.Image", "wagtailimages.Image",
...@@ -531,7 +526,6 @@ class MainPersonPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, ...@@ -531,7 +526,6 @@ class MainPersonPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin,
class MainContactPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page): class MainContactPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin, Page):
### FIELDS ### FIELDS
contact_people = StreamField( contact_people = StreamField(
...@@ -540,18 +534,22 @@ class MainContactPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin ...@@ -540,18 +534,22 @@ class MainContactPage(ExtendedMetadataPageMixin, SubpageMixin, MetadataPageMixin
blank=True, blank=True,
) )
contact_boxes = StreamField( contact_boxes = StreamField(
[("item", blocks.PersonContactBlock())], [("item", blocks.PersonContactBoxBlock())],
verbose_name="Kontaktní boxy", verbose_name="Kontaktní boxy",
blank=True, blank=True,
) )
text = RichTextField("Text", blank=True, features=RICH_TEXT_DEFAULT_FEATURES) text = StreamField(
[("two_columns_text", blocks.TwoTextColumnBlock())],
verbose_name="Kontaktní informace",
blank=True
)
### PANELS ### PANELS
content_panels = Page.content_panels + [ content_panels = Page.content_panels + [
FieldPanel("text"),
FieldPanel("contact_people"), FieldPanel("contact_people"),
FieldPanel("contact_boxes"), FieldPanel("contact_boxes"),
FieldPanel("text"),
] ]
promote_panels = make_promote_panels() promote_panels = make_promote_panels()
......
{% load wagtailimages_tags %}
<div class="flex mb-8 person-box-big max-w-md xl:max-w-xl flex-col xl:flex-row xl:mb-16"> <div class="flex mb-8 person-box-big max-w-md xl:max-w-xl flex-col xl:flex-row xl:mb-16">
<div class="shrink-0 mr-2"> <div class="shrink-0 mr-2">
{% image person_page.profile_image fill-350x350 as profile_image %}
<img <img
class="rounded-full shadow-sm w-30 xl:w-60 mb-2" class="rounded-full shadow-sm w-30 xl:w-60 mb-2"
src="https://randomuser.me/api/portraits/women/26.jpg" src="{{ profile_image.url }}"
alt=" {{ name }}" alt=" {{ person_page.title }}"
> >
</div> </div>
<div class="flex flex-col justify-between py-4"> <div class="flex flex-col justify-between py-4">
......
...@@ -11,48 +11,16 @@ ...@@ -11,48 +11,16 @@
<h2 class="font-alt text-3xl sm:text-4xl mb-5"> <h2 class="font-alt text-3xl sm:text-4xl mb-5">
Kontakty pro veřejnost Kontakty pro veřejnost
</h2> </h2>
{% for text_block in page.text %}
<div class="flex flex-wrap justify-between"> <div class="flex flex-wrap justify-between">
<div class="leading-5 w-1/2"> <div class="leading-5 w-1/2">
<span class="font-bold">Informační linka:</span><br/> {{ text_block.value.text_column_1|richtext }}
+420 703 681 682<br/>
+420 608 963 111<br/>
<br/>
<span class="font-bold">Provozní doba:</span><br/>
Po, St, Pá: 8-16:30<br/>
Út, Čt: 11-19:30<br/>
<br/>
<span class="font-bold">E-mail:</span><br>
<a href="mailto:info@pirati.cz" class="text-turquoise-500 underline">
info@pirati.cz
</a><br>
<br>
<span class="font-bold">International Department</span><br>
<a href="mailto:international@pirati.cz" class="text-turquoise-500 underline">
international@pirati.cz
</a><br>
<br>
</div> </div>
<div class="leading-5 w-5/6 sm:w-5/12"> <div class="leading-5 w-5/6 sm:w-5/12">
<span class="font-bold">Informační linka:</span><br/> {{ text_block.value.text_column_2|richtext }}
+420 703 681 682<br/>
+420 608 963 111<br/>
<br/>
<span class="font-bold">Provozní doba:</span><br/>
Po, St, Pá: 8-16:30<br/>
Út, Čt: 11-19:30<br/>
<br/>
<span class="font-bold">E-mail:</span><br>
<a href="mailto:info@pirati.cz" class="text-turquoise-500 underline">
info@pirati.cz
</a><br>
<br>
<span class="font-bold">Transparentní účet</span><br>
24190421219/3190 (Fio banka)<br>
<a href="" class="text-turquoise-500 underline">
další transparentní účty
</a><br>
</div> </div>
</div> </div>
{% endfor %}
</div> </div>
<div class="w-full max-w-2xl"> <div class="w-full max-w-2xl">
<h2 class="font-alt text-4xl mb-5"> <h2 class="font-alt text-4xl mb-5">
...@@ -78,18 +46,18 @@ ...@@ -78,18 +46,18 @@
hm, image... hm, image...
</div> </div>
<h3 class="font-alt mb-3 text-xl"> <h3 class="font-alt mb-3 text-xl">
Adresář {{ contact_block.value.title }}
</h3> </h3>
<p> <p>
Další osoby naleznete na stránce pirati.cz {{ contact_block.value.subtitle }}
</p> </p>
</div> </div>
<a href="" class="btn btn__slide__wrap"> <a href="{{ contact_block.value.button_link }}" class="btn btn__slide__wrap">
<span class="btn bg-black text-white w-32"> <span class="btn bg-black text-white w-32">
Lidé {{ contact_block.value.button_text }}
</span> </span>
<span class="btn bg-blue-300 text-white w-32"> <span class="btn bg-blue-300 text-white w-32">
Lidé {{ contact_block.value.button_text }}
</span> </span>
</a> </a>
</div> </div>
...@@ -107,7 +75,8 @@ ...@@ -107,7 +75,8 @@
{% for contact_person_box in page.contact_people %} {% for contact_person_box in page.contact_people %}
<div class="flex person-box mb-4 mr-4"> <div class="flex person-box mb-4 mr-4">
<div class="mr-7"> <div class="mr-7">
<img class="rounded-full shadow-sm w-20 sm:w-40" src="https://randomuser.me/api/portraits/women/26.jpg" {% image contact_person_box.value.person.profile_image fill-250x250 as profile_image %}
<img class="rounded-full shadow-sm w-20 sm:w-40" src="{{ profile_image.url }}"
alt="user image"> alt="user image">
</div> </div>
<div class="flex flex-col py-4"> <div class="flex flex-col py-4">
...@@ -127,7 +96,6 @@ ...@@ -127,7 +96,6 @@
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
</div>
</section> </section>
</div> </div>
</main> </main>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment