diff --git a/district/migrations/0041_auto_20220309_1109.py b/district/migrations/0041_auto_20220309_1109.py new file mode 100644 index 0000000000000000000000000000000000000000..6dc9d4140c72278f9e5d548a80414807e941c196 --- /dev/null +++ b/district/migrations/0041_auto_20220309_1109.py @@ -0,0 +1,42 @@ +# Generated by Django 3.2.11 on 2022-03-09 10:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("district", "0040_districthomepage_menu"), + ] + + operations = [ + migrations.AddField( + model_name="districtpersonpage", + name="custom_web_url", + field=models.URLField( + blank=True, null=True, verbose_name="Odkaz na vlastní web" + ), + ), + migrations.AlterField( + model_name="districtpersonpage", + name="job", + field=models.CharField( + blank=True, + help_text="Např. 'Informatik'", + max_length=128, + null=True, + verbose_name="Povolání", + ), + ), + migrations.AlterField( + model_name="districtpersonpage", + name="job_function", + field=models.CharField( + blank=True, + help_text="Např. 'Předseda'", + max_length=128, + null=True, + verbose_name="Funkce", + ), + ), + ] diff --git a/district/models.py b/district/models.py index 539bc68a47c17421494f5ebd76a29236f2f6eebc..905e64badf54565269215acfa707e427d3796fd6 100644 --- a/district/models.py +++ b/district/models.py @@ -438,10 +438,14 @@ class DistrictPersonPage(SubpageMixin, MetadataPageMixin, Page): ### FIELDS job = models.CharField( - "Povolání", max_length=64, blank=True, null=True, help_text="Např. 'Informatik'" + "Povolání", + max_length=128, + blank=True, + null=True, + help_text="Např. 'Informatik'", ) job_function = models.CharField( - "Funkce", max_length=64, blank=True, null=True, help_text="Např. 'Předseda'" + "Funkce", max_length=128, blank=True, null=True, help_text="Např. 'Předseda'" ) background_photo = models.ForeignKey( "wagtailimages.Image", @@ -472,6 +476,7 @@ class DistrictPersonPage(SubpageMixin, MetadataPageMixin, Page): twitter_url = models.URLField("Odkaz na Twitter", blank=True, null=True) youtube_url = models.URLField("Odkaz na Youtube kanál", blank=True, null=True) flickr_url = models.URLField("Odkaz na Flickr", blank=True, null=True) + custom_web_url = models.URLField("Odkaz na vlastní web", blank=True, null=True) other_urls = StreamField( [("other_url", blocks.PersonUrlBlock())], verbose_name="Další odkaz", @@ -513,6 +518,7 @@ class DistrictPersonPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("twitter_url"), FieldPanel("youtube_url"), FieldPanel("flickr_url"), + FieldPanel("custom_web_url"), StreamFieldPanel("other_urls"), ], "Sociální sítě", diff --git a/district/templates/district/district_person_page.html b/district/templates/district/district_person_page.html index 79a75a9e1d19e4e3bb30c3690a21afd6613b9721..d9a36d3afbb0e79a3a74fcdea3c8a1dbfa68c83e 100644 --- a/district/templates/district/district_person_page.html +++ b/district/templates/district/district_person_page.html @@ -62,6 +62,11 @@ <i class="ico--flickr"></i> </a> {% endif %} + {% if page.custom_web_url %} + <a href="{{ page.custom_web_url }}" target="_blank" class="social-icon" rel="noreferrer noopener"> + <i class="ico--globe"></i> + </a> + {% endif %} {% for person_link_block in page.other_urls %} <a href="{{ person_link_block.value.url }}" diff --git a/region/migrations/0016_auto_20220309_1109.py b/region/migrations/0016_auto_20220309_1109.py new file mode 100644 index 0000000000000000000000000000000000000000..635a6e34c20554c0b797e3af3375ade994ae3ae7 --- /dev/null +++ b/region/migrations/0016_auto_20220309_1109.py @@ -0,0 +1,42 @@ +# Generated by Django 3.2.11 on 2022-03-09 10:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("region", "0015_regionhomepage_menu"), + ] + + operations = [ + migrations.AddField( + model_name="regionpersonpage", + name="custom_web_url", + field=models.URLField( + blank=True, null=True, verbose_name="Odkaz na vlastní web" + ), + ), + migrations.AlterField( + model_name="regionpersonpage", + name="job", + field=models.CharField( + blank=True, + help_text="Např. 'Informatik'", + max_length=128, + null=True, + verbose_name="Povolání", + ), + ), + migrations.AlterField( + model_name="regionpersonpage", + name="job_function", + field=models.CharField( + blank=True, + help_text="Např. 'Předseda'", + max_length=128, + null=True, + verbose_name="Funkce", + ), + ), + ] diff --git a/region/models.py b/region/models.py index b3d86dccb892f0368d109c8ba4e196c803ab0179..f661c87f7360418c52424bb7145cd8977de71b94 100644 --- a/region/models.py +++ b/region/models.py @@ -431,10 +431,14 @@ class RegionPersonPage(SubpageMixin, MetadataPageMixin, Page): ### FIELDS job = models.CharField( - "Povolání", max_length=64, blank=True, null=True, help_text="Např. 'Informatik'" + "Povolání", + max_length=128, + blank=True, + null=True, + help_text="Např. 'Informatik'", ) job_function = models.CharField( - "Funkce", max_length=64, blank=True, null=True, help_text="Např. 'Předseda'" + "Funkce", max_length=128, blank=True, null=True, help_text="Např. 'Předseda'" ) background_photo = models.ForeignKey( "wagtailimages.Image", @@ -465,6 +469,7 @@ class RegionPersonPage(SubpageMixin, MetadataPageMixin, Page): twitter_url = models.URLField("Odkaz na Twitter", blank=True, null=True) youtube_url = models.URLField("Odkaz na Youtube kanál", blank=True, null=True) flickr_url = models.URLField("Odkaz na Flickr", blank=True, null=True) + custom_web_url = models.URLField("Odkaz na vlastní web", blank=True, null=True) other_urls = StreamField( [("other_url", blocks.PersonUrlBlock())], verbose_name="Další odkaz", @@ -506,6 +511,7 @@ class RegionPersonPage(SubpageMixin, MetadataPageMixin, Page): FieldPanel("twitter_url"), FieldPanel("youtube_url"), FieldPanel("flickr_url"), + FieldPanel("custom_web_url"), ], "Sociální sítě", ), diff --git a/region/templates/region/region_person_page.html b/region/templates/region/region_person_page.html index 95d287d83cd532c948c71b2c7e3006b31ca14e27..b09c579ef592e06caf24a073806ff5626e56c022 100644 --- a/region/templates/region/region_person_page.html +++ b/region/templates/region/region_person_page.html @@ -62,6 +62,16 @@ <i class="ico--flickr"></i> </a> {% endif %} + {% if page.flickr_url %} + <a href="{{ page.flickr_url }}" target="_blank" class="social-icon" rel="noreferrer noopener"> + <i class="ico--flickr"></i> + </a> + {% endif %} + {% if page.custom_web_url %} + <a href="{{ page.custom_web_url }}" target="_blank" class="social-icon" rel="noreferrer noopener"> + <i class="ico--globe"></i> + </a> + {% endif %} {% for person_link_block in page.other_urls %} <a href="{{ person_link_block.value.url }}"