-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1091 from City-of-Helsinki/UHF-10259-curated-even…
…t-list UHF-10259: Curated event list
- Loading branch information
Showing
10 changed files
with
205 additions
and
6 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
@import 'tags'; | ||
@import 'throbber'; | ||
@import 'editorially'; | ||
@import 'linkedevents-event'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// @todo: Move these styles to generice teaser file | ||
// https://helsinkisolutionoffice.atlassian.net/browse/UHF-10868 | ||
.linkedevents-event { | ||
display: flex; | ||
height: 100%; | ||
|
||
@include breakpoint($breakpoint-m) { | ||
flex-direction: column; | ||
padding-bottom: 0; | ||
} | ||
} | ||
|
||
.linkedevents-event__title { | ||
@include font(h5); | ||
margin-bottom: $spacing-half; | ||
margin-top: 0; | ||
|
||
@include breakpoint($breakpoint-l) { | ||
@include font(h4); | ||
} | ||
} | ||
|
||
.linkedevents-event__title a::after { | ||
bottom: 0; | ||
content: ''; | ||
left: 0; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
} | ||
|
||
.linkedevents-event__text-container { | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
padding-inline-start: $spacing; | ||
width: 60%; | ||
|
||
@include breakpoint($breakpoint-m) { | ||
padding: $spacing 0 0 0; | ||
width: unset; | ||
} | ||
|
||
[dir='rtl'] & { | ||
padding-left: 0; | ||
padding-right: $spacing; | ||
|
||
@include breakpoint($breakpoint-m) { | ||
padding-left: 0; | ||
padding-right: 0; | ||
} | ||
} | ||
} | ||
|
||
.linkedevents-event__img { | ||
position: relative; | ||
width: 40%; | ||
|
||
@include breakpoint($breakpoint-m) { | ||
width: unset; | ||
} | ||
|
||
img { | ||
display: block; | ||
height: auto; | ||
width: 100%; | ||
} | ||
} | ||
|
||
.linkedevents-event__date-container { | ||
@include font(small); | ||
color: $color-black-60 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/scss/06_components/paragraphs/_curated-event-list.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.curated-event-list__events { | ||
display: grid; | ||
gap: 0; | ||
list-style: none; | ||
padding-left: 0; | ||
|
||
@include breakpoint($breakpoint-m) { | ||
column-gap: $spacing-and-half; | ||
grid-template-columns: repeat(3, 1fr); | ||
} | ||
} | ||
|
||
.curated-event-list__event + .curated-event-list__event { | ||
margin-top: $spacing-double; | ||
|
||
@include breakpoint($breakpoint-m) { | ||
margin-top: 0; | ||
} | ||
} | ||
|
||
.curated-event-list__empty-message__container { | ||
margin-bottom: $spacing-and-half; | ||
} | ||
|
||
.curated-event-list__empty-message { | ||
@include font(h4); | ||
} | ||
|
||
.curated-event-list__event { | ||
position: relative; | ||
} |
43 changes: 43 additions & 0 deletions
43
templates/content/external-entity--linkedevents-event.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{# @todo Use a general component to create the card-teaser html #} | ||
{# https://helsinkisolutionoffice.atlassian.net/browse/UHF-10868 #} | ||
<div class="linkedevents-event"> | ||
<div class="linkedevents-event__img"> | ||
{{ content.main_image }} | ||
</div> | ||
<div class="linkedevents-event__text-container"> | ||
<h3 class="linkedevents-event__title"> | ||
{{ content.external_link }} | ||
</h3> | ||
<div class="linkedevents-event__date-container"> | ||
{% set is_multidate = start_timestamp|date('Y-m-d') != end_timestamp|date('Y-m-d') %} | ||
{% set same_year = start_timestamp|date('Y') == end_timestamp|date('Y') %} | ||
{% set html_start = start_timestamp|format_date('custom', 'Y-m-d') ~ 'T' ~ start_timestamp|format_date('custom', 'H:i') %} | ||
{% set html_end = end_timestamp|format_date('custom', 'Y-m-d') ~ 'T' ~ end_timestamp|format_date('custom', 'H:i') %} | ||
{% if is_multidate and not same_year %} | ||
<time datetime="{{ html_start }}"> | ||
{{ start_timestamp|date('d.m.Y') }} | ||
</time> | ||
– | ||
<time datetime="{{ html_end }}"> | ||
{{ end_timestamp|date('d.m.Y') }} | ||
</time> | ||
{% elseif is_multidate %} | ||
<time datetime="{{ html_start }}"> | ||
{{ start_timestamp|date('d.m.') }} | ||
</time> | ||
– | ||
<time datetime="{{ html_end }}"> | ||
{{ end_timestamp|date('d.m.Y') }} | ||
</time> | ||
{% else %} | ||
<time datetime="{{ html_start }}"> | ||
{{ start_timestamp|format_date('publication_date_format') }} | ||
</time> | ||
– | ||
<time datetime="{{ html_end }}"> | ||
{{ end_timestamp|format_date('custom', 'H:i') }} | ||
</time> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> |
2 changes: 2 additions & 0 deletions
2
templates/module/helfi-news-item/node--news-item--card-teaser.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
templates/paragraphs/paragraph--curated-event-list.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% block paragraph %} | ||
{% embed "@hdbt/misc/component.twig" with | ||
{ | ||
component_classes: [ | ||
'component--full-width', | ||
'component--curated-event-list', | ||
], | ||
component_title_level: 'h2', | ||
component_title: 'Recommended events'|trans({}, {'context': 'Curated event list title'}), | ||
} | ||
%} | ||
{% block component_content %} | ||
<div class="curated-event-list"> | ||
{% if content.future_or_ongoing is empty %} | ||
<div class="curated-event-list__empty-message__container"> | ||
<span class="curated-event-list__empty-message"> | ||
{{ 'Recommended events were not found'|t({}, {'context': 'Curated events list empty message'}) }} | ||
</span> | ||
</div> | ||
{% else %} | ||
<ul class="curated-event-list__events"> | ||
{% for event in content.future_or_ongoing %} | ||
<li class="curated-event-list__event"> | ||
{{ event }} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% include '@hdbt/navigation/link-button.html.twig' with { | ||
label: content.field_all_events_link.0['#title'], | ||
open_in_a_new_window: content.field_all_events_link.0.options.target_new, | ||
type: 'primary', | ||
url: content.field_all_events_link.0['#url'], | ||
} %} | ||
</div> | ||
{% endblock %} | ||
{% endembed %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters