Skip to content

Commit afe3373

Browse files
committed
Merge pull request #534 from itk-dev/hotfix/4.10.3
5121: Fixed handling of missing dates
1 parent fe29268 commit afe3373

5 files changed

Lines changed: 58 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ Versioning](https://semver.org/spec/v2.0.0.html).
3131
* Enabled multiple pretix dates on public meetings
3232
* Updated fixtures with multipe date examples (and pretix orders)
3333

34+
## [4.10.3] - 2025-08-13
35+
36+
* [PR-534](https://github.com/itk-dev/deltag.aarhus.dk/pull/534)
37+
* Fixed handling of empty dates. Updated npm package (security).
38+
* Use teaser image instead of full image. Supportticket: 373
39+
3440
## [4.10.2] - 2025-07-03
3541

3642
* [PR-529](https://github.com/itk-dev/hoeringsportal/pull/529)
@@ -513,6 +519,8 @@ Initial release
513519

514520
[Unreleased]: https://github.com/itk-dev/hoeringsportal/compare/4.11.0...HEAD
515521
[4.11.0]: https://github.com/itk-dev/hoeringsportal/compare/4.10.1...4.11.0
522+
[4.10.3]: https://github.com/itk-dev/hoeringsportal/compare/4.10.2...4.10.3
523+
[4.10.2]: https://github.com/itk-dev/hoeringsportal/compare/4.10.1...4.10.2
516524
[4.10.1]: https://github.com/itk-dev/hoeringsportal/compare/4.10.0...4.10.1
517525
[4.10.0]: https://github.com/itk-dev/hoeringsportal/compare/4.9.3...4.10.0
518526
[4.9.3]: https://github.com/itk-dev/hoeringsportal/compare/4.9.2...4.9.3

web/themes/custom/hoeringsportal/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/themes/custom/hoeringsportal/templates/components/base-card.html.twig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@
4040
{# Show a header with image if there is a image present for the node/teaser #}
4141
{% if image %}
4242
{# Get the url and alt text for the image #}
43-
{% set image_url = file_url(image.field_itk_media_image_upload.entity.uri.value) %}
44-
{% set image_alt = file_url(image.field_itk_media_image_upload.entity.entity.alt) %}
43+
{% set image_url = file_url(image.field_itk_media_image_upload.entity.uri.value|image_style('responsive_small_teaser')) %}
44+
{% set image_alt = image.field_itk_media_image_upload.alt %}
45+
4546
<div class="card-header position-relative p-0 w-100 activity-teaser-image overflow-hidden">
4647
<img class="object-fit-cover" src="{{ image_url }}" alt="{{ image_alt|default('') }}">
4748

web/themes/custom/hoeringsportal/templates/content/node--hearing--teaser.html.twig

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
{% block card_date %}
2222
{# If we have a date then show a date splash on the card #}
2323
{% if (content_state in ['upcoming', 'active']) %}
24-
{# Show the date #}
24+
{% if deadlinedate %}
25+
{# Show the date #}
2526
<div class="fw-semibold">{{ deadlinedate|format_date('hoeringsportal_day_only') }}</div>
2627
<div class="small">{{ deadlinedate|format_date('hoeringsportal_month_short') }}</div>
28+
{% endif %}
2729
{% elseif (content_state in ['finished']) %}
2830
<div><strong>{{ 'Ended'|t }}</strong></div>
2931
{% elseif (content_state in ['canceled']) %}
@@ -37,12 +39,25 @@
3739
{% endblock %}
3840

3941
{# Collect data for information lines on card #}
40-
{% set items =
41-
[
42-
{icon: 'fa-calendar-day', value: deadlinepassed ? 'Hearing has ended'|t : deadlinedate|format_date('hoeringsportal_date_long')|capitalize},
42+
{% set items = [] %}
43+
{% if deadlinepassed %}
44+
{%
45+
set items = items|merge([
46+
{icon: 'fa-calendar-day', value: 'Hearing has ended'|t },
47+
])
48+
%}
49+
{% elseif deadlinedate %}
50+
{%
51+
set items = items|merge([
52+
{icon: 'fa-calendar-day', value: deadlinedate|format_date('hoeringsportal_date_long')|capitalize},
53+
])
54+
%}
55+
{% endif %}
56+
{%
57+
set items = items|merge([
4358
{icon: 'fa-comments', value: repliesCount ~ ' ' ~ 'replies'|t},
44-
{icon: 'fa-location-dot', value: content.field_area}
45-
]
59+
{icon: 'fa-location-dot', value: content.field_area},
60+
])
4661
%}
4762

4863
{# Show card information #}

web/themes/custom/hoeringsportal/templates/content/node--public-meeting--teaser.html.twig

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
{% block card_date %}
2323
{# When deadline field exists show date. #}
2424
{% if (content_state != 'finished') %}
25-
<div class="fw-semibold">{{ meetingDateStartTime|date('U')|format_date('hoeringsportal_day_only') }}</div>
26-
<div class="small">{{ meetingDateStartTime|date('U')|format_date('hoeringsportal_month_short') }}</div>
25+
{% if meetingDateStartTime %}
26+
<div class="fw-semibold">{{ meetingDateStartTime|date('U')|format_date('hoeringsportal_day_only') }}</div>
27+
<div class="small">{{ meetingDateStartTime|date('U')|format_date('hoeringsportal_month_short') }}</div>
28+
{% endif %}
2729
{% else %}
2830
{{ 'Finished'|t }}
2931
{% endif %}
@@ -35,12 +37,25 @@
3537
{% endblock %}
3638

3739
{# Collect data for information lines on card #}
38-
{% set items =
39-
[
40-
{icon: 'fa-calendar-day', value: meetingDateStartTime|date('U')|format_date('hoeringsportal_date_long')|capitalize},
41-
{icon: 'fa-clock', value: meetingDateStartTime|date('U')|format_date('hoeringsportal_time') ~ ' - ' ~ meetingDateEndTime|date('U')|format_date('hoeringsportal_time')},
42-
{icon: 'fa-location-dot', value: content.field_area}
43-
]
40+
{% set items = [] %}
41+
{% if meetingDateStartTime %}
42+
{%
43+
set items = items|merge([
44+
{icon: 'fa-calendar-day', value: meetingDateStartTime|date('U')|format_date('hoeringsportal_date_long')|capitalize},
45+
])
46+
%}
47+
{% if meetingDateEndTime %}
48+
{%
49+
set items = items|merge([
50+
{icon: 'fa-clock', value: meetingDateStartTime|date('U')|format_date('hoeringsportal_time') ~ ' - ' ~ meetingDateEndTime|date('U')|format_date('hoeringsportal_time')},
51+
])
52+
%}
53+
{% endif %}
54+
{% endif %}
55+
{%
56+
set items = items|merge([
57+
{icon: 'fa-location-dot', value: content.field_area},
58+
])
4459
%}
4560

4661
{# Show card information #}

0 commit comments

Comments
 (0)