|
8 | 8 | {# Set how many replies there is to this hearing #} |
9 | 9 | {% set repliesCount = hearing_helper.getNumberOfReplies(node) %} |
10 | 10 |
|
11 | | -{# Set date for next meeting #} |
| 11 | +{# Set startdate for hearing #} |
12 | 12 | {% set startdate = hearing_helper.getStartDate(node) %} |
13 | 13 |
|
| 14 | +{# Set deadlinedate for hearing #} |
| 15 | +{% set deadlinedate = hearing_helper.getDeadlineDate(node) %} |
| 16 | + |
| 17 | +{# Set is deadlinepassed #} |
| 18 | +{% set deadlinepassed = hearing_helper.isDeadlinePassed(node) %} |
| 19 | + |
14 | 20 | {# Show a date splash on the card #} |
15 | 21 | {% block card_date %} |
16 | 22 | {# If we have a date then show a date splash on the card #} |
17 | | - {% if (startdate) %} |
| 23 | + {% if (content_state in ['upcoming', 'active']) %} |
18 | 24 | {# Show the date #} |
19 | | - <div class="fw-semibold">{{ startdate|format_date('hoeringsportal_day_only') }}</div> |
20 | | - <div class="small">{{ startdate|format_date('hoeringsportal_month_short') }}</div> |
| 25 | + <div class="fw-semibold">{{ deadlinedate|format_date('hoeringsportal_day_only') }}</div> |
| 26 | + <div class="small">{{ deadlinedate|format_date('hoeringsportal_month_short') }}</div> |
| 27 | + {% elseif (content_state in ['finished']) %} |
| 28 | + <div><strong>{{ 'Ended'|t }}</strong></div> |
| 29 | + {% elseif (content_state in ['canceled']) %} |
| 30 | + <div>{{ 'Canceled'|t }}</div> |
21 | 31 | {% endif %} |
22 | 32 | {% endblock %} |
23 | 33 |
|
|
29 | 39 | {# Collect data for information lines on card #} |
30 | 40 | {% set items = |
31 | 41 | [ |
32 | | - {icon: 'fa-calendar-day', value: startdate|format_date('hoeringsportal_date_long')|capitalize}, |
| 42 | + {icon: 'fa-calendar-day', value: deadlinepassed ? 'Hearing has ended'|t : deadlinedate|format_date('hoeringsportal_date_long')|capitalize}, |
33 | 43 | {icon: 'fa-comments', value: repliesCount ~ ' ' ~ 'replies'|t}, |
34 | 44 | {icon: 'fa-location-dot', value: content.field_area} |
35 | 45 | ] |
36 | 46 | %} |
37 | 47 |
|
38 | 48 | {# Show card information #} |
39 | 49 | {% block card_type_information %} |
40 | | - |
41 | 50 | {# Show details for next Hearing #} |
42 | | - {% if (content_state in ['upcoming', 'active']) %} |
43 | | - {% for item in items %} |
44 | | - <div class="d-flex gap-3 justify-items-center {% if not loop.last %} border-bottom {% endif %}"> |
45 | | - <i class="fa-solid fa-fw fa-lg {{ item.icon }} text-hearing"></i> |
46 | | - <p class="small">{{ item.value }}</p> |
47 | | - </div> |
48 | | - {% endfor %} |
49 | | - |
50 | | - {# Show text for finished Hearing #} |
51 | | - {% elseif (content_state == 'finished') %} |
52 | | - <p>{{ 'Hearing has ended'|t }}</p> |
53 | | - |
| 51 | + {% if (content_state in ['upcoming', 'active', 'finished']) %} |
| 52 | + {% for item in items %} |
| 53 | + <div class="d-flex gap-3 justify-items-center {% if not loop.last %} border-bottom {% endif %}"> |
| 54 | + <i class="fa-solid fa-fw fa-lg {{ item.icon }} text-hearing"></i> |
| 55 | + <p class="small">{{ item.value }}</p> |
| 56 | + </div> |
| 57 | + {% endfor %} |
54 | 58 | {# Show text for canceled Hearing #} |
55 | 59 | {% elseif (content_state == 'canceled') %} |
56 | 60 | <p>{{ 'Hearing has been canceled'|t }}</p> |
|
0 commit comments