Skip to content
Snippets Groups Projects
Commit 05f481cd authored by Tomáš Valenta's avatar Tomáš Valenta
Browse files

add button to uniweb, fix PDF page

parent 6e27be3c
No related branches found
No related tags found
2 merge requests!930release,!924add button to uniweb, fix PDF page
Pipeline #16761 passed
# Generated by Django 4.1.10 on 2024-02-09 13:34
from django.db import migrations
import main.blocks
import wagtail.blocks
import wagtail.fields
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
('main', '0072_mainarticlepage_show_initial_image'),
]
operations = [
migrations.AlterField(
model_name='mainhomepage',
name='content',
field=wagtail.fields.StreamField([('carousel', wagtail.blocks.StructBlock([('desktop_line_1', wagtail.blocks.TextBlock(label='Desktop první řádek')), ('desktop_line_2', wagtail.blocks.TextBlock(label='Desktop druhý řádek')), ('mobile_line_1', wagtail.blocks.TextBlock(label='První mobilní řádek')), ('mobile_line_2', wagtail.blocks.TextBlock(label='Druhý mobilní řádek')), ('mobile_line_3', wagtail.blocks.TextBlock(label='Třetí mobilní řádek')), ('desktop_image', wagtail.images.blocks.ImageChooserBlock(label='Obrázek nahrazující animaci (desktop)', required=False)), ('mobile_image', wagtail.images.blocks.ImageChooserBlock(label='Obrázek nahrazující animaci (mobil / tablet)', required=False)), ('button_url', wagtail.blocks.URLBlock(help_text='Bez odkazu tlačítko nebude viditelné.', label='Odkaz tlačítka', required=False)), ('button_text', wagtail.blocks.CharBlock(label='Text tlačítka', required=False))])), ('news', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Nejnovější články se načtou automaticky', label='Titulek')), ('description', wagtail.blocks.TextBlock(label='Popis'))], template='styleguide2/includes/organisms/articles/articles_section.html')), ('people', wagtail.blocks.StructBlock([('title_line_1', wagtail.blocks.CharBlock(label='První řádek titulku')), ('title_line_2', wagtail.blocks.CharBlock(label='Druhý řádek titulku')), ('description', wagtail.blocks.TextBlock(label='Popis')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky'))])), ('regions', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(help_text='Články pro regiony se načtou automaticky', label='Titulek'))])), ('boxes', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(label='Nadpis')), ('list', wagtail.blocks.ListBlock(main.blocks.BoxBlock, label='Boxíky')), ('image', wagtail.images.blocks.ImageChooserBlock(label='Obrázek pozadí', required=False))]))], blank=True, use_json_field=True, verbose_name='Hlavní obsah'),
),
]
...@@ -62,7 +62,7 @@ class MainHomePage(MainHomePageMixin): ...@@ -62,7 +62,7 @@ class MainHomePage(MainHomePageMixin):
template="styleguide2/includes/organisms/articles/articles_section.html" template="styleguide2/includes/organisms/articles/articles_section.html"
), ),
), ),
("europarl_news", blocks.EuroparlNewsBlock()), # ("europarl_news", blocks.EuroparlNewsBlock()),
("people", blocks.PeopleOverviewBlock()), ("people", blocks.PeopleOverviewBlock()),
("regions", blocks.RegionsBlock()), ("regions", blocks.RegionsBlock()),
("boxes", blocks.BoxesBlock()), ("boxes", blocks.BoxesBlock()),
......
...@@ -768,8 +768,6 @@ class ChartRedmineIssueDataset(blocks.StructBlock): ...@@ -768,8 +768,6 @@ class ChartRedmineIssueDataset(blocks.StructBlock):
is_first = False is_first = False
print(url)
return url return url
def _get_parsed_issues(self, value, labels, issues_url) -> tuple: def _get_parsed_issues(self, value, labels, issues_url) -> tuple:
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
const context = canvas.getContext("2d"); const context = canvas.getContext("2d");
canvas.height = viewport.height; canvas.height = viewport.height;
canvas.width = viewport.width; canvas.width = viewport.width;
canvas.style.width = "100%"
// Render PDF page into canvas context // Render PDF page into canvas context
await page.render({ await page.render({
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
" "
> >
<a href="{{ article.url }}"> <a href="{{ article.url }}">
{% image article.image width-512 as image %} {% image article.image width-1024 as image %}
<img <img
src="{{ image.url }}" src="{{ image.url }}"
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
" "
> >
{% for article in article_data_list %} {% for article in article_data_list %}
{% image article.image max-500x500 as article_image %} {% image article.image max-1024x1024 as article_image %}
{% include 'styleguide2/includes/molecules/boxes/card_box.html' with url=article.url image=article_image date=article.date header=article.title content=article.perex|shorten_perex %} {% include 'styleguide2/includes/molecules/boxes/card_box.html' with url=article.url image=article_image date=article.date header=article.title content=article.perex|shorten_perex %}
{% endfor %} {% endfor %}
......
This diff is collapsed.
This diff is collapsed.
...@@ -248,6 +248,28 @@ class CalendarAgendaBlock(blocks.StructBlock): ...@@ -248,6 +248,28 @@ class CalendarAgendaBlock(blocks.StructBlock):
return context return context
class ButtonBlock(blocks.StructBlock):
text = blocks.CharBlock(label="Nadpis")
url = blocks.URLBlock(
label="Odkaz",
help_text="Pokud je odkaz vyplněný, není nutno vyplňovat stránku.",
required=False,
)
page = blocks.PageChooserBlock(
label="Stránka",
help_text="Pokud je stránka vyplněná, není nutno vyplňovat odkaz.",
required=False,
)
class Meta:
label = "Tlačítko"
icon = "link-external"
group = "ostatní"
template = "uniweb/blocks/button.html"
CONTENT_STREAM_BLOCKS = [ CONTENT_STREAM_BLOCKS = [
( (
"title", "title",
...@@ -293,6 +315,7 @@ CONTENT_STREAM_BLOCKS = [ ...@@ -293,6 +315,7 @@ CONTENT_STREAM_BLOCKS = [
), ),
("articles", ArticlesBlock()), ("articles", ArticlesBlock()),
("calendar_agenda", CalendarAgendaBlock()), ("calendar_agenda", CalendarAgendaBlock()),
("button", ButtonBlock()),
("chart", ChartBlock(template="uniweb/blocks/chart.html")), ("chart", ChartBlock(template="uniweb/blocks/chart.html")),
] ]
......
{% load wagtailcore_tags %}
{% firstof self.url self.page as target %}
<div class="flex justify-center items-center">
<a
class="btn"
href="{{ target }}"
>
<div
class="btn__body text-black font-bold font-alt text-3xl px-5 py-4"
style="background-color:#fec900!important"
>{{ self.text }}</div>
</a>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment