From 26bdd3211a296aafe140bd001896c76a7d527f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com> Date: Mon, 17 May 2021 17:28:34 +0200 Subject: [PATCH] elections2021: Programm app textxs update --- ..._elections2021programapppage_info_title.py | 23 +++++++++++++++++++ elections2021/models.py | 8 ++++++- .../elections2021_home_page.html | 1 - .../elections2021_program_app_page.html | 10 ++++---- 4 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 elections2021/migrations/0025_elections2021programapppage_info_title.py diff --git a/elections2021/migrations/0025_elections2021programapppage_info_title.py b/elections2021/migrations/0025_elections2021programapppage_info_title.py new file mode 100644 index 00000000..14557b9e --- /dev/null +++ b/elections2021/migrations/0025_elections2021programapppage_info_title.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.2 on 2021-05-17 15:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("elections2021", "0024_elections2021programpage_head_title"), + ] + + operations = [ + migrations.AddField( + model_name="elections2021programapppage", + name="info_title", + field=models.CharField( + blank=True, + max_length=255, + null=True, + verbose_name="titulek k informacím", + ), + ), + ] diff --git a/elections2021/models.py b/elections2021/models.py index 4ac16689..c7e1f371 100644 --- a/elections2021/models.py +++ b/elections2021/models.py @@ -1719,13 +1719,19 @@ class Elections2021QuestionsPage(SubpageMixin, MetadataPageMixin, Page): class Elections2021ProgramAppPage(SubpageMixin, MetadataPageMixin, Page): ### FIELDS + info_title = models.CharField( + "titulek k informacím", blank=True, null=True, max_length=255 + ) info_text = RichTextField( "základní informace", blank=True, null=True, features=RESTRICTED_FEATURES ) ### PANELS - content_panels = Page.content_panels + [FieldPanel("info_text")] + content_panels = Page.content_panels + [ + FieldPanel("info_title"), + FieldPanel("info_text"), + ] promote_panels = [ MultiFieldPanel( diff --git a/elections2021/templates/elections2021/elections2021_home_page.html b/elections2021/templates/elections2021/elections2021_home_page.html index aed0ff8b..dc0b7c40 100644 --- a/elections2021/templates/elections2021/elections2021_home_page.html +++ b/elections2021/templates/elections2021/elections2021_home_page.html @@ -64,7 +64,6 @@ </div> </div> </a> - <p class="mt-5 text-white">Aplikace vám vyselektuje programové <br>body vám na míru</p> </div> </div> </div> diff --git a/elections2021/templates/elections2021/elections2021_program_app_page.html b/elections2021/templates/elections2021/elections2021_program_app_page.html index 631055cd..02a7cbb0 100644 --- a/elections2021/templates/elections2021/elections2021_program_app_page.html +++ b/elections2021/templates/elections2021/elections2021_program_app_page.html @@ -13,13 +13,13 @@ <form method="post"> {% csrf_token %} - {% if page.info_text %} - <div class="grid grid-cols-4 mb-20 md:mb-40"> + {% if page.info_title %} + <div class="grid grid-cols-4 mb-20"> <div class="col-span-4 md:col-span-1"> - <p class="head-xs font-bold">Základní informace</p> + <p class="head-xs font-bold">{{ page.info_title }}</p> </div> - <div class="col-span-4 md:col-span-3 md:pl-16 mt-5 md:mt-0"> - <p class="para">{{ page.info_text|richtext }}</p> + <div class="content-block col-span-4 md:col-span-3 md:pl-16 mt-5 md:mt-0"> + {{ page.info_text|richtext }} </div> </div> {% endif %} -- GitLab