diff --git a/conf/cmi/core.entity_form_display.node.news_item.default.yml b/conf/cmi/core.entity_form_display.node.news_item.default.yml index d1040d4d5..4acec7c06 100644 --- a/conf/cmi/core.entity_form_display.node.news_item.default.yml +++ b/conf/cmi/core.entity_form_display.node.news_item.default.yml @@ -12,6 +12,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -76,8 +77,23 @@ third_party_settings: open: false description: '' required_fields: true + group_updating_news: + children: + - field_news_item_updating_news + label: 'Updating news' + region: content + parent_name: '' + weight: 17 + format_type: details + format_settings: + classes: '' + show_empty_fields: true + id: '' + open: false + description: "Leave the content region above the updating news blank if you are creating an updating news.
\r\nAdd the latest news update at the end. The system will display updates on the page in reverse order." + required_fields: false _core: - default_config_hash: RHDFf9pvwgV2FvoelXlH7dXXBoWkziCZI1FWuQS94k8 + default_config_hash: dW1Kmx2dOCHZosI85sWLQGupPRXvS8NL-lmM_O44boc id: node.news_item.default targetEntityType: node bundle: news_item @@ -179,6 +195,26 @@ content: match_operator: CONTAINS match_limit: 10 third_party_settings: { } + field_news_item_updating_news: + type: paragraphs + weight: 17 + region: content + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: open + closed_mode: summary + autocollapse: none + closed_mode_threshold: 0 + add_mode: dropdown + form_display_mode: default + default_paragraph_type: _none + features: + add_above: '0' + collapse_edit_all: '0' + convert: '0' + duplicate: '0' + third_party_settings: { } field_news_neighbourhoods: type: select2_entity_reference weight: 27 diff --git a/conf/cmi/core.entity_form_display.paragraph.news_update.default.yml b/conf/cmi/core.entity_form_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..583d33106 --- /dev/null +++ b/conf/cmi/core.entity_form_display.paragraph.news_update.default.yml @@ -0,0 +1,56 @@ +uuid: 01df54cb-c5ac-4cab-bd27-787f2bdc93b1 +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - paragraphs +_core: + default_config_hash: XYIUl3_cuml3-BGICqIzW8RWixphDQihgi01ZCJMBig +id: paragraph.news_update.default +targetEntityType: paragraph +bundle: news_update +mode: default +content: + field_news_update: + type: paragraphs + weight: 2 + region: content + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: open + closed_mode: summary + autocollapse: none + closed_mode_threshold: 0 + add_mode: dropdown + form_display_mode: default + default_paragraph_type: text + features: + add_above: '0' + collapse_edit_all: collapse_edit_all + convert: '0' + duplicate: duplicate + third_party_settings: { } + field_news_update_date: + type: datetime_default + weight: 1 + region: content + settings: { } + third_party_settings: { } + field_news_update_title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } +hidden: + created: true + status: true diff --git a/conf/cmi/core.entity_view_display.node.news_item.card_teaser.yml b/conf/cmi/core.entity_view_display.node.news_item.card_teaser.yml index 5489e36af..6ecfd7913 100644 --- a/conf/cmi/core.entity_view_display.node.news_item.card_teaser.yml +++ b/conf/cmi/core.entity_view_display.node.news_item.card_teaser.yml @@ -13,6 +13,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -22,7 +23,7 @@ dependencies: - media - user _core: - default_config_hash: rw0HQtg75-HvNXykEGQqCuDsOe_-6GcUpKGnrZVOnSs + default_config_hash: Mr1QBPHLSABqi-fUL-8TBc8xRHxfVs5cf0QbTjXomDc id: node.news_item.card_teaser targetEntityType: node bundle: news_item @@ -85,6 +86,7 @@ hidden: field_news_groups: true field_news_item_links_link: true field_news_item_tags: true + field_news_item_updating_news: true field_news_neighbourhoods: true field_radioactivity: true langcode: true diff --git a/conf/cmi/core.entity_view_display.node.news_item.default.yml b/conf/cmi/core.entity_view_display.node.news_item.default.yml index c837f9965..3f50a9806 100644 --- a/conf/cmi/core.entity_view_display.node.news_item.default.yml +++ b/conf/cmi/core.entity_view_display.node.news_item.default.yml @@ -12,6 +12,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -23,7 +24,7 @@ dependencies: - radioactivity - user _core: - default_config_hash: fHNnwg186A981K7d578If1MCkuYBmQqaxabpDSAZwIc + default_config_hash: SfHQKCP8IzTidLziyYN4o4WUK7vzqFrvkFtTa01dQYE id: node.news_item.default targetEntityType: node bundle: news_item @@ -97,6 +98,15 @@ content: third_party_settings: { } weight: 11 region: content + field_news_item_updating_news: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 13 + region: content field_news_neighbourhoods: type: entity_reference_label label: above diff --git a/conf/cmi/core.entity_view_display.node.news_item.medium_teaser.yml b/conf/cmi/core.entity_view_display.node.news_item.medium_teaser.yml index 3961d12e7..60573bc50 100644 --- a/conf/cmi/core.entity_view_display.node.news_item.medium_teaser.yml +++ b/conf/cmi/core.entity_view_display.node.news_item.medium_teaser.yml @@ -13,6 +13,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -20,7 +21,7 @@ dependencies: module: - user _core: - default_config_hash: iOyy_v6RDb2ia9ioF-Q-IJqILz-pPRMc9MgQTbvggIM + default_config_hash: fjYLz2RVZIouftKpPNS0o-JnsSAxBe8YiUDps3NbhSg id: node.news_item.medium_teaser targetEntityType: node bundle: news_item @@ -75,6 +76,7 @@ hidden: field_news_groups: true field_news_item_links_link: true field_news_item_tags: true + field_news_item_updating_news: true field_news_neighbourhoods: true field_radioactivity: true langcode: true diff --git a/conf/cmi/core.entity_view_display.node.news_item.teaser.yml b/conf/cmi/core.entity_view_display.node.news_item.teaser.yml index acf61dff0..bf265b50a 100644 --- a/conf/cmi/core.entity_view_display.node.news_item.teaser.yml +++ b/conf/cmi/core.entity_view_display.node.news_item.teaser.yml @@ -13,6 +13,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -20,7 +21,7 @@ dependencies: module: - user _core: - default_config_hash: y7-XNi5JaI60YIxmANoDIqzZ09lyzAiFwhYNEyO4nDc + default_config_hash: gOi3OpZskrzmvZPMzBgPX5pDCAgJhTEQKkR3Ka66jfY id: node.news_item.teaser targetEntityType: node bundle: news_item @@ -83,6 +84,7 @@ hidden: field_news_groups: true field_news_item_links_link: true field_news_item_tags: true + field_news_item_updating_news: true field_news_neighbourhoods: true field_radioactivity: true langcode: true diff --git a/conf/cmi/core.entity_view_display.node.news_item.tiny_teaser.yml b/conf/cmi/core.entity_view_display.node.news_item.tiny_teaser.yml index 58eba9445..24dc7f638 100644 --- a/conf/cmi/core.entity_view_display.node.news_item.tiny_teaser.yml +++ b/conf/cmi/core.entity_view_display.node.news_item.tiny_teaser.yml @@ -13,6 +13,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -20,7 +21,7 @@ dependencies: module: - user _core: - default_config_hash: k8a-Ho8gCsq1hUA_KlWab29egZov57JPtywUawPbYHU + default_config_hash: GZ4RFPkRq0OjD31t8jG9R5KZvzi7xhjM1-7kONczzrA id: node.news_item.tiny_teaser targetEntityType: node bundle: news_item @@ -71,6 +72,7 @@ hidden: field_news_item_links_link: true field_news_item_links_title: true field_news_item_tags: true + field_news_item_updating_news: true field_news_neighbourhoods: true field_radioactivity: true langcode: true diff --git a/conf/cmi/core.entity_view_display.paragraph.news_update.default.yml b/conf/cmi/core.entity_view_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..f6291b972 --- /dev/null +++ b/conf/cmi/core.entity_view_display.paragraph.news_update.default.yml @@ -0,0 +1,47 @@ +uuid: a0d41678-10a0-4519-be98-d17f3051a687 +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - entity_reference_revisions +_core: + default_config_hash: 4u5e96aoW-RpNubuc3W4Hy-4UbKXdL-iIQU9bINu8X0 +id: paragraph.news_update.default +targetEntityType: paragraph +bundle: news_update +mode: default +content: + field_news_update: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 2 + region: content + field_news_update_date: + type: datetime_default + label: hidden + settings: + timezone_override: '' + format_type: publication_date_format + third_party_settings: { } + weight: 1 + region: content + field_news_update_title: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 0 + region: content +hidden: + search_api_excerpt: true diff --git a/conf/cmi/core.entity_view_display.paragraph.news_update.preview.yml b/conf/cmi/core.entity_view_display.paragraph.news_update.preview.yml new file mode 100644 index 000000000..8de987f3f --- /dev/null +++ b/conf/cmi/core.entity_view_display.paragraph.news_update.preview.yml @@ -0,0 +1,48 @@ +uuid: e6f7408a-1e53-4af0-97eb-5122f611d019 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.paragraph.preview + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - entity_reference_revisions +_core: + default_config_hash: 4u5e96aoW-RpNubuc3W4Hy-4UbKXdL-iIQU9bINu8X0 +id: paragraph.news_update.preview +targetEntityType: paragraph +bundle: news_update +mode: preview +content: + field_news_update: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 2 + region: content + field_news_update_date: + type: datetime_custom + label: hidden + settings: + timezone_override: '' + date_format: U + third_party_settings: { } + weight: 1 + region: content + field_news_update_title: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 0 + region: content +hidden: + search_api_excerpt: true diff --git a/conf/cmi/field.field.node.news_item.field_news_item_updating_news.yml b/conf/cmi/field.field.node.news_item.field_news_item_updating_news.yml new file mode 100644 index 000000000..9e73cb66b --- /dev/null +++ b/conf/cmi/field.field.node.news_item.field_news_item_updating_news.yml @@ -0,0 +1,33 @@ +uuid: badac28d-62bc-4e48-94de-9ccc20dc44a7 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_news_item_updating_news + - node.type.news_item + - paragraphs.paragraphs_type.news_update + module: + - entity_reference_revisions +_core: + default_config_hash: tBaSkG3CaeSEpEZhLsNOBP58k2UVhfIMU0Y-kMr929w +id: node.news_item.field_news_item_updating_news +field_name: field_news_item_updating_news +entity_type: node +bundle: news_item +label: Content +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + target_bundles: + news_update: news_update + negate: 0 + target_bundles_drag_drop: + news_update: + weight: 52 + enabled: true +field_type: entity_reference_revisions diff --git a/conf/cmi/field.field.paragraph.news_update.field_news_update.yml b/conf/cmi/field.field.paragraph.news_update.field_news_update.yml new file mode 100644 index 000000000..5203de307 --- /dev/null +++ b/conf/cmi/field.field.paragraph.news_update.field_news_update.yml @@ -0,0 +1,48 @@ +uuid: b50d682f-ff11-481c-af5b-51192a655696 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update + - paragraphs.paragraphs_type.banner + - paragraphs.paragraphs_type.image + - paragraphs.paragraphs_type.news_update + - paragraphs.paragraphs_type.remote_video + - paragraphs.paragraphs_type.text + module: + - entity_reference_revisions +_core: + default_config_hash: yLDIO76pewsWmipYIxaOo5H7QA-p9My_0OBLAQkiaX8 +id: paragraph.news_update.field_news_update +field_name: field_news_update +entity_type: paragraph +bundle: news_update +label: 'News update' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + target_bundles: + text: text + image: image + remote_video: remote_video + banner: banner + negate: 0 + target_bundles_drag_drop: + banner: + weight: 3 + enabled: true + image: + weight: 1 + enabled: true + remote_video: + weight: 2 + enabled: true + text: + weight: 0 + enabled: true +field_type: entity_reference_revisions diff --git a/conf/cmi/field.field.paragraph.news_update.field_news_update_date.yml b/conf/cmi/field.field.paragraph.news_update.field_news_update_date.yml new file mode 100644 index 000000000..0701e0331 --- /dev/null +++ b/conf/cmi/field.field.paragraph.news_update.field_news_update_date.yml @@ -0,0 +1,26 @@ +uuid: 23a03e5f-7f4d-45f0-ad8d-76320b4cb880 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update_date + - paragraphs.paragraphs_type.news_update + module: + - datetime +_core: + default_config_hash: Ly1VkuFJwtrKK5cwC3KPYiQHnu-7yMIdtRYg30y4X04 +id: paragraph.news_update.field_news_update_date +field_name: field_news_update_date +entity_type: paragraph +bundle: news_update +label: Date +description: 'The date will appear in the table of contents and below the title of the news update.' +required: true +translatable: false +default_value: + - + default_date_type: now + default_date: now +default_value_callback: '' +settings: { } +field_type: datetime diff --git a/conf/cmi/field.field.paragraph.news_update.field_news_update_title.yml b/conf/cmi/field.field.paragraph.news_update.field_news_update_title.yml new file mode 100644 index 000000000..af864296d --- /dev/null +++ b/conf/cmi/field.field.paragraph.news_update.field_news_update_title.yml @@ -0,0 +1,21 @@ +uuid: bf3f766e-4a12-450f-8ffc-d162e9f7511a +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update_title + - paragraphs.paragraphs_type.news_update +_core: + default_config_hash: JuvEWSSqz85sOqrdphxrT8zpS15NvTaKqykZBoH3dYU +id: paragraph.news_update.field_news_update_title +field_name: field_news_update_title +entity_type: paragraph +bundle: news_update +label: Title +description: 'Write the title of the news update. Remember to update the title of the page if necessary to reflect the updated content.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/conf/cmi/field.storage.node.field_news_item_links_title.yml b/conf/cmi/field.storage.node.field_news_item_links_title.yml index 76188743f..41f4e1343 100644 --- a/conf/cmi/field.storage.node.field_news_item_links_title.yml +++ b/conf/cmi/field.storage.node.field_news_item_links_title.yml @@ -12,8 +12,8 @@ entity_type: node type: string settings: max_length: 255 - case_sensitive: false is_ascii: false + case_sensitive: false module: core locked: false cardinality: 1 diff --git a/conf/cmi/field.storage.node.field_news_item_updating_news.yml b/conf/cmi/field.storage.node.field_news_item_updating_news.yml new file mode 100644 index 000000000..e683a54ea --- /dev/null +++ b/conf/cmi/field.storage.node.field_news_item_updating_news.yml @@ -0,0 +1,23 @@ +uuid: cf9d1751-254b-4997-8688-746777df2498 +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - node + - paragraphs +_core: + default_config_hash: KRgdSbSbLnaEGg2e1iOD-YPYnwEzKwefSjXZ9KkDjzc +id: node.field_news_item_updating_news +field_name: field_news_item_updating_news +entity_type: node +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/conf/cmi/field.storage.node.field_short_title.yml b/conf/cmi/field.storage.node.field_short_title.yml index 5be8525d5..69a4287b7 100644 --- a/conf/cmi/field.storage.node.field_short_title.yml +++ b/conf/cmi/field.storage.node.field_short_title.yml @@ -12,8 +12,8 @@ entity_type: node type: string settings: max_length: 255 - case_sensitive: false is_ascii: false + case_sensitive: false module: core locked: false cardinality: 1 diff --git a/conf/cmi/field.storage.paragraph.field_news_update.yml b/conf/cmi/field.storage.paragraph.field_news_update.yml new file mode 100644 index 000000000..e344f7a46 --- /dev/null +++ b/conf/cmi/field.storage.paragraph.field_news_update.yml @@ -0,0 +1,22 @@ +uuid: 21076eb0-779f-4178-a184-c8fd396219c1 +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - paragraphs +_core: + default_config_hash: 4efvUKxnJHXJ6D143bvXle9gbX7HrDBqel69jmMR6QY +id: paragraph.field_news_update +field_name: field_news_update +entity_type: paragraph +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/conf/cmi/field.storage.paragraph.field_news_update_date.yml b/conf/cmi/field.storage.paragraph.field_news_update_date.yml new file mode 100644 index 000000000..526a78edc --- /dev/null +++ b/conf/cmi/field.storage.paragraph.field_news_update_date.yml @@ -0,0 +1,22 @@ +uuid: 58a866e3-c277-40c2-ac1f-c55529be88e9 +langcode: en +status: true +dependencies: + module: + - datetime + - paragraphs +_core: + default_config_hash: pzDCwWp6M4gXZ7clZAJssm3h9PCyqfoqWBCM8eoou70 +id: paragraph.field_news_update_date +field_name: field_news_update_date +entity_type: paragraph +type: datetime +settings: + datetime_type: datetime +module: datetime +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/conf/cmi/field.storage.paragraph.field_news_update_title.yml b/conf/cmi/field.storage.paragraph.field_news_update_title.yml new file mode 100644 index 000000000..7bc05ce62 --- /dev/null +++ b/conf/cmi/field.storage.paragraph.field_news_update_title.yml @@ -0,0 +1,23 @@ +uuid: 8bdb9cc3-8deb-44f4-b936-39e9a745dd10 +langcode: en +status: true +dependencies: + module: + - paragraphs +_core: + default_config_hash: s12tguXB_l2uSjVPAiZ2a0arAi8q9airYPeXJ3cgMwQ +id: paragraph.field_news_update_title +field_name: field_news_update_title +entity_type: paragraph +type: string +settings: + max_length: 255 + case_sensitive: false + is_ascii: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/conf/cmi/language/fi/core.entity_form_display.node.news_item.default.yml b/conf/cmi/language/fi/core.entity_form_display.node.news_item.default.yml index ddec27707..e215e02c2 100644 --- a/conf/cmi/language/fi/core.entity_form_display.node.news_item.default.yml +++ b/conf/cmi/language/fi/core.entity_form_display.node.news_item.default.yml @@ -6,6 +6,10 @@ third_party_settings: label: Linkit group_main_image: label: Pääkuva + group_updating_news: + label: 'Päivittyvä uutinen' + format_settings: + description: 'Jätä sisältöalue tyhjäksi päivittyvän uutisen yläpuolelta, jos luot päivittyvän uutisen.
Lisää uusin uutispäivitys viimeiseksi. Järjestelmä näyttää päivitykset sivulla käänteisessä järjestyksessä.' content: field_content: settings: diff --git a/conf/cmi/language/fi/core.entity_form_display.paragraph.news_update.default.yml b/conf/cmi/language/fi/core.entity_form_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..f95720cc1 --- /dev/null +++ b/conf/cmi/language/fi/core.entity_form_display.paragraph.news_update.default.yml @@ -0,0 +1,5 @@ +content: + field_news_update: + settings: + title: Lohko + title_plural: Lohkot diff --git a/conf/cmi/language/fi/field.field.node.news_item.field_news_item_links_link.yml b/conf/cmi/language/fi/field.field.node.news_item.field_news_item_links_link.yml index 4d8e877fd..6f8993a9a 100644 --- a/conf/cmi/language/fi/field.field.node.news_item.field_news_item_links_link.yml +++ b/conf/cmi/language/fi/field.field.node.news_item.field_news_item_links_link.yml @@ -1,2 +1,2 @@ label: Linkki -description: 'Lisää sisäisen tai ulkoisen linkin URL-osoite sekä sivulla näkyvä linkkiteksti.' +description: 'Sisäinen tai ulkoinen linkki haluttuun kohteeseen. Linkin teksti -kentän arvo näytetään sivuston käyttäjälle.' diff --git a/conf/cmi/language/fi/field.field.node.news_item.field_news_item_updating_news.yml b/conf/cmi/language/fi/field.field.node.news_item.field_news_item_updating_news.yml new file mode 100644 index 000000000..9d61cbc9a --- /dev/null +++ b/conf/cmi/language/fi/field.field.node.news_item.field_news_item_updating_news.yml @@ -0,0 +1 @@ +label: Sisältö diff --git a/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update.yml b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update.yml new file mode 100644 index 000000000..7771a775e --- /dev/null +++ b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update.yml @@ -0,0 +1 @@ +label: Uutispäivitys diff --git a/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_date.yml b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_date.yml new file mode 100644 index 000000000..6aee2db50 --- /dev/null +++ b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_date.yml @@ -0,0 +1,2 @@ +label: Ajankohta +description: 'Ajankohta näkyy sisällysluettelossa ja uutispäivityksen otsikon alla.' diff --git a/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_title.yml b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_title.yml new file mode 100644 index 000000000..224d385c6 --- /dev/null +++ b/conf/cmi/language/fi/field.field.paragraph.news_update.field_news_update_title.yml @@ -0,0 +1,2 @@ +label: Otsikko +description: 'Kirjoita uutispäivityksen otsikko. Muista päivittää tarvittaessa myös koko uutisen otsikko vastaamaan päivitettyä sisältöä.' diff --git a/conf/cmi/language/fi/paragraphs.paragraphs_type.news_update.yml b/conf/cmi/language/fi/paragraphs.paragraphs_type.news_update.yml new file mode 100644 index 000000000..7771a775e --- /dev/null +++ b/conf/cmi/language/fi/paragraphs.paragraphs_type.news_update.yml @@ -0,0 +1 @@ +label: Uutispäivitys diff --git a/conf/cmi/paragraphs.paragraphs_type.news_update.yml b/conf/cmi/paragraphs.paragraphs_type.news_update.yml new file mode 100644 index 000000000..2086c1348 --- /dev/null +++ b/conf/cmi/paragraphs.paragraphs_type.news_update.yml @@ -0,0 +1,12 @@ +uuid: 85ec51ba-cfc6-491f-8528-3fa0ee65165f +langcode: en +status: true +dependencies: { } +_core: + default_config_hash: p0PyOpRZeZXz95QAVZLj0GnUPD8P3dRYAxtxIJSQqb0 +id: news_update +label: 'News update' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } diff --git a/public/modules/custom/helfi_etusivu/config/install/core.entity_form_display.paragraph.news_update.default.yml b/public/modules/custom/helfi_etusivu/config/install/core.entity_form_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..b43916460 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/core.entity_form_display.paragraph.news_update.default.yml @@ -0,0 +1,54 @@ +uuid: 01df54cb-c5ac-4cab-bd27-787f2bdc93b1 +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - paragraphs +id: paragraph.news_update.default +targetEntityType: paragraph +bundle: news_update +mode: default +content: + field_news_update: + type: paragraphs + weight: 2 + region: content + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: open + closed_mode: summary + autocollapse: none + closed_mode_threshold: 0 + add_mode: dropdown + form_display_mode: default + default_paragraph_type: text + features: + add_above: '0' + collapse_edit_all: collapse_edit_all + convert: '0' + duplicate: duplicate + third_party_settings: { } + field_news_update_date: + type: datetime_default + weight: 1 + region: content + settings: { } + third_party_settings: { } + field_news_update_title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } +hidden: + created: true + status: true diff --git a/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..6f07f4645 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.default.yml @@ -0,0 +1,45 @@ +uuid: a0d41678-10a0-4519-be98-d17f3051a687 +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - entity_reference_revisions +id: paragraph.news_update.default +targetEntityType: paragraph +bundle: news_update +mode: default +content: + field_news_update: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 2 + region: content + field_news_update_date: + type: datetime_default + label: hidden + settings: + timezone_override: '' + format_type: publication_date_format + third_party_settings: { } + weight: 1 + region: content + field_news_update_title: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 0 + region: content +hidden: + search_api_excerpt: true diff --git a/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.preview.yml b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.preview.yml new file mode 100644 index 000000000..b0282a7a0 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/core.entity_view_display.paragraph.news_update.preview.yml @@ -0,0 +1,46 @@ +uuid: e6f7408a-1e53-4af0-97eb-5122f611d019 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.paragraph.preview + - field.field.paragraph.news_update.field_news_update + - field.field.paragraph.news_update.field_news_update_date + - field.field.paragraph.news_update.field_news_update_title + - paragraphs.paragraphs_type.news_update + module: + - datetime + - entity_reference_revisions +id: paragraph.news_update.preview +targetEntityType: paragraph +bundle: news_update +mode: preview +content: + field_news_update: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 2 + region: content + field_news_update_date: + type: datetime_custom + label: hidden + settings: + timezone_override: '' + date_format: U + third_party_settings: { } + weight: 1 + region: content + field_news_update_title: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 0 + region: content +hidden: + search_api_excerpt: true diff --git a/public/modules/custom/helfi_etusivu/config/install/field.field.node.news_item.field_news_item_updating_news.yml b/public/modules/custom/helfi_etusivu/config/install/field.field.node.news_item.field_news_item_updating_news.yml new file mode 100644 index 000000000..8f1f7fa75 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.field.node.news_item.field_news_item_updating_news.yml @@ -0,0 +1,31 @@ +uuid: badac28d-62bc-4e48-94de-9ccc20dc44a7 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_news_item_updating_news + - node.type.news_item + - paragraphs.paragraphs_type.news_update + module: + - entity_reference_revisions +id: node.news_item.field_news_item_updating_news +field_name: field_news_item_updating_news +entity_type: node +bundle: news_item +label: Content +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + target_bundles: + news_update: news_update + negate: 0 + target_bundles_drag_drop: + news_update: + weight: 52 + enabled: true +field_type: entity_reference_revisions diff --git a/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update.yml b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update.yml new file mode 100644 index 000000000..99c898052 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update.yml @@ -0,0 +1,30 @@ +uuid: b50d682f-ff11-481c-af5b-51192a655696 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update + - paragraphs.paragraphs_type.banner + - paragraphs.paragraphs_type.image + - paragraphs.paragraphs_type.news_update + - paragraphs.paragraphs_type.remote_video + - paragraphs.paragraphs_type.text + module: + - entity_reference_revisions +id: paragraph.news_update.field_news_update +field_name: field_news_update +entity_type: paragraph +bundle: news_update +label: 'News update' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + target_bundles: { } + negate: 0 + target_bundles_drag_drop: { } +field_type: entity_reference_revisions diff --git a/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_date.yml b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_date.yml new file mode 100644 index 000000000..321619c5a --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_date.yml @@ -0,0 +1,24 @@ +uuid: 23a03e5f-7f4d-45f0-ad8d-76320b4cb880 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update_date + - paragraphs.paragraphs_type.news_update + module: + - datetime +id: paragraph.news_update.field_news_update_date +field_name: field_news_update_date +entity_type: paragraph +bundle: news_update +label: Date +description: 'The date will appear in the table of contents and below the title of the news update.' +required: true +translatable: false +default_value: + - + default_date_type: now + default_date: now +default_value_callback: '' +settings: { } +field_type: datetime diff --git a/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_title.yml b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_title.yml new file mode 100644 index 000000000..e63792ffe --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.field.paragraph.news_update.field_news_update_title.yml @@ -0,0 +1,19 @@ +uuid: bf3f766e-4a12-450f-8ffc-d162e9f7511a +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_news_update_title + - paragraphs.paragraphs_type.news_update +id: paragraph.news_update.field_news_update_title +field_name: field_news_update_title +entity_type: paragraph +bundle: news_update +label: Title +description: 'Write the title of the news update. Remember to update the title of the page if necessary to reflect the updated content.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/public/modules/custom/helfi_etusivu/config/install/field.storage.node.field_news_item_updating_news.yml b/public/modules/custom/helfi_etusivu/config/install/field.storage.node.field_news_item_updating_news.yml new file mode 100644 index 000000000..13dd3f2f7 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.storage.node.field_news_item_updating_news.yml @@ -0,0 +1,21 @@ +uuid: cf9d1751-254b-4997-8688-746777df2498 +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - node + - paragraphs +id: node.field_news_item_updating_news +field_name: field_news_item_updating_news +entity_type: node +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update.yml b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update.yml new file mode 100644 index 000000000..72fcf1d47 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update.yml @@ -0,0 +1,20 @@ +uuid: 21076eb0-779f-4178-a184-c8fd396219c1 +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - paragraphs +id: paragraph.field_news_update +field_name: field_news_update +entity_type: paragraph +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_date.yml b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_date.yml new file mode 100644 index 000000000..003c8cc4b --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_date.yml @@ -0,0 +1,20 @@ +uuid: 58a866e3-c277-40c2-ac1f-c55529be88e9 +langcode: en +status: true +dependencies: + module: + - datetime + - paragraphs +id: paragraph.field_news_update_date +field_name: field_news_update_date +entity_type: paragraph +type: datetime +settings: + datetime_type: datetime +module: datetime +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_title.yml b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_title.yml new file mode 100644 index 000000000..4b580337c --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/field.storage.paragraph.field_news_update_title.yml @@ -0,0 +1,21 @@ +uuid: 8bdb9cc3-8deb-44f4-b936-39e9a745dd10 +langcode: en +status: true +dependencies: + module: + - paragraphs +id: paragraph.field_news_update_title +field_name: field_news_update_title +entity_type: paragraph +type: string +settings: + max_length: 255 + case_sensitive: false + is_ascii: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/public/modules/custom/helfi_etusivu/config/install/paragraphs.paragraphs_type.news_update.yml b/public/modules/custom/helfi_etusivu/config/install/paragraphs.paragraphs_type.news_update.yml new file mode 100644 index 000000000..c17fd17d3 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/install/paragraphs.paragraphs_type.news_update.yml @@ -0,0 +1,10 @@ +uuid: 85ec51ba-cfc6-491f-8528-3fa0ee65165f +langcode: en +status: true +dependencies: { } +id: news_update +label: 'News update' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/core.entity_form_display.paragraph.news_update.default.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/core.entity_form_display.paragraph.news_update.default.yml new file mode 100644 index 000000000..f95720cc1 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/core.entity_form_display.paragraph.news_update.default.yml @@ -0,0 +1,5 @@ +content: + field_news_update: + settings: + title: Lohko + title_plural: Lohkot diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.node.news_item.field_news_item_updating_news.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.node.news_item.field_news_item_updating_news.yml new file mode 100644 index 000000000..9d61cbc9a --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.node.news_item.field_news_item_updating_news.yml @@ -0,0 +1 @@ +label: Sisältö diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update.yml new file mode 100644 index 000000000..7771a775e --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update.yml @@ -0,0 +1 @@ +label: Uutispäivitys diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_date.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_date.yml new file mode 100644 index 000000000..6aee2db50 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_date.yml @@ -0,0 +1,2 @@ +label: Ajankohta +description: 'Ajankohta näkyy sisällysluettelossa ja uutispäivityksen otsikon alla.' diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_title.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_title.yml new file mode 100644 index 000000000..224d385c6 --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/field.field.paragraph.news_update.field_news_update_title.yml @@ -0,0 +1,2 @@ +label: Otsikko +description: 'Kirjoita uutispäivityksen otsikko. Muista päivittää tarvittaessa myös koko uutisen otsikko vastaamaan päivitettyä sisältöä.' diff --git a/public/modules/custom/helfi_etusivu/config/optional/language/fi/paragraphs.paragraphs_type.news_update.yml b/public/modules/custom/helfi_etusivu/config/optional/language/fi/paragraphs.paragraphs_type.news_update.yml new file mode 100644 index 000000000..7771a775e --- /dev/null +++ b/public/modules/custom/helfi_etusivu/config/optional/language/fi/paragraphs.paragraphs_type.news_update.yml @@ -0,0 +1 @@ +label: Uutispäivitys diff --git a/public/modules/custom/helfi_etusivu/helfi_etusivu.install b/public/modules/custom/helfi_etusivu/helfi_etusivu.install index c09af60d5..e0d21735f 100644 --- a/public/modules/custom/helfi_etusivu/helfi_etusivu.install +++ b/public/modules/custom/helfi_etusivu/helfi_etusivu.install @@ -216,3 +216,13 @@ function helfi_etusivu_update_9007() : void { function helfi_etusivu_update_9008(): void { helfi_platform_config_update_paragraph_target_types(); } + +/** + * UHF-9739: Add 'news update' paragraph to news item. + */ +function helfi_etusivu_update_9009(): void { + \Drupal::service('helfi_platform_config.config_update_helper') + ->update('helfi_node_news_item'); + \Drupal::service('helfi_platform_config.config_update_helper') + ->update('helfi_etusivu'); +} diff --git a/public/modules/custom/helfi_etusivu/helfi_etusivu.module b/public/modules/custom/helfi_etusivu/helfi_etusivu.module index 20c3a75f1..13c4a0865 100644 --- a/public/modules/custom/helfi_etusivu/helfi_etusivu.module +++ b/public/modules/custom/helfi_etusivu/helfi_etusivu.module @@ -105,6 +105,16 @@ function helfi_etusivu_helfi_paragraph_types() : array { ], ], ], + 'paragraph' => [ + 'news_update' => [ + 'field_news_update' => [ + 'text' => 0, + 'image' => 1, + 'remote_video' => 2, + 'banner' => 3, + ], + ], + ], ]; $enabled = []; diff --git a/public/modules/custom/helfi_etusivu/translations/fi.po b/public/modules/custom/helfi_etusivu/translations/fi.po index 50e308eee..eb02a5d64 100644 --- a/public/modules/custom/helfi_etusivu/translations/fi.po +++ b/public/modules/custom/helfi_etusivu/translations/fi.po @@ -11,3 +11,11 @@ msgstr "Pääuutisvirta" msgid "Organize top news feed" msgstr "Järjestä pääuutisvirtaa" + +msgctxt "Updating news" +msgid "Latest updates" +msgstr "Uusimmat päivitykset" + +msgctxt "Updating news" +msgid "News update published" +msgstr "Uutispäivityksen julkaisuaika" diff --git a/public/modules/custom/helfi_etusivu/translations/sv.po b/public/modules/custom/helfi_etusivu/translations/sv.po index 33c68c60c..1481bff5e 100644 --- a/public/modules/custom/helfi_etusivu/translations/sv.po +++ b/public/modules/custom/helfi_etusivu/translations/sv.po @@ -11,3 +11,11 @@ msgstr "Toppnyheterna" msgid "Organize top news feed" msgstr "Ordna toppnyheterna" + +msgctxt "Updating news" +msgid "Latest updates" +msgstr "Senaste uppdateringar" + +msgctxt "Updating news" +msgid "News update published time" +msgstr "Uppdatering publicerad tid" diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_form_display.node.news_item.default.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_form_display.node.news_item.default.yml index 4308b52ae..771f02f18 100644 --- a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_form_display.node.news_item.default.yml +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_form_display.node.news_item.default.yml @@ -10,6 +10,7 @@ dependencies: - field.field.node.news_item.field_news_item_links_link - field.field.node.news_item.field_news_item_links_title - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news - field.field.node.news_item.field_news_neighbourhoods - field.field.node.news_item.field_radioactivity - field.field.node.news_item.field_short_title @@ -25,7 +26,44 @@ dependencies: - scheduler - select2 - radioactivity +third_party_settings: + field_group: + group_updating_news: + children: + - field_news_item_updating_news + label: 'Updating news' + region: content + parent_name: '' + weight: 17 + format_type: details + format_settings: + classes: '' + show_empty_fields: true + id: '' + open: false + description: "Leave the content region above the updating news blank if you are creating an updating news.
\r\nAdd the latest news update at the end. The system will display updates on the page in reverse order." + required_fields: false content: + field_news_item_updating_news: + type: paragraphs + weight: 17 + region: content + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: open + closed_mode: summary + autocollapse: none + closed_mode_threshold: 0 + add_mode: dropdown + form_display_mode: default + default_paragraph_type: _none + features: + add_above: '0' + collapse_edit_all: '0' + convert: '0' + duplicate: '0' + third_party_settings: { } field_news_groups: type: select2_entity_reference weight: 26 diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.card_teaser.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.card_teaser.yml new file mode 100644 index 000000000..3219b4c81 --- /dev/null +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.card_teaser.yml @@ -0,0 +1,24 @@ +config_rewrite: + replace: ['dependencies'] +dependencies: + config: + - core.entity_view_mode.node.card_teaser + - field.field.node.news_item.field_content + - field.field.node.news_item.field_lead_in + - field.field.node.news_item.field_main_image + - field.field.node.news_item.field_main_image_caption + - field.field.node.news_item.field_news_groups + - field.field.node.news_item.field_news_item_links_link + - field.field.node.news_item.field_news_item_links_title + - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news + - field.field.node.news_item.field_news_neighbourhoods + - field.field.node.news_item.field_radioactivity + - field.field.node.news_item.field_short_title + - image.style.3_2_m + - node.type.news_item + module: + - media + - user +hidden: + field_news_item_updating_news: true diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.default.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.default.yml index 5c9038a72..cca982c80 100644 --- a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.default.yml +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.default.yml @@ -1,5 +1,5 @@ config_rewrite: - replace: ['dependencies','hidden'] + replace: ['dependencies'] dependencies: config: - field.field.node.news_item.field_content @@ -18,8 +18,8 @@ dependencies: - entity_reference_revisions - helfi_platform_config - link - - user - radioactivity + - user content: field_news_groups: type: entity_reference_label @@ -45,6 +45,15 @@ content: third_party_settings: { } weight: 12 region: content + field_news_item_updating_news: + type: entity_reference_revisions_entity_view + label: above + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 13 + region: content field_radioactivity: type: radioactivity_reference_emitter label: above diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.medium_teaser.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.medium_teaser.yml new file mode 100644 index 000000000..631debc7e --- /dev/null +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.medium_teaser.yml @@ -0,0 +1,22 @@ +config_rewrite: + replace: ['dependencies'] +dependencies: + config: + - core.entity_view_mode.node.medium_teaser + - field.field.node.news_item.field_content + - field.field.node.news_item.field_lead_in + - field.field.node.news_item.field_main_image + - field.field.node.news_item.field_main_image_caption + - field.field.node.news_item.field_news_groups + - field.field.node.news_item.field_news_item_links_link + - field.field.node.news_item.field_news_item_links_title + - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news + - field.field.node.news_item.field_news_neighbourhoods + - field.field.node.news_item.field_radioactivity + - field.field.node.news_item.field_short_title + - node.type.news_item + module: + - user +hidden: + field_news_item_updating_news: true diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.teaser.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.teaser.yml new file mode 100644 index 000000000..4b53f6767 --- /dev/null +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.teaser.yml @@ -0,0 +1,22 @@ +config_rewrite: + replace: ['dependencies'] +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.news_item.field_content + - field.field.node.news_item.field_lead_in + - field.field.node.news_item.field_main_image + - field.field.node.news_item.field_main_image_caption + - field.field.node.news_item.field_news_groups + - field.field.node.news_item.field_news_item_links_link + - field.field.node.news_item.field_news_item_links_title + - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news + - field.field.node.news_item.field_news_neighbourhoods + - field.field.node.news_item.field_radioactivity + - field.field.node.news_item.field_short_title + - node.type.news_item + module: + - user +hidden: + field_news_item_updating_news: true diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.tiny_teaser.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.tiny_teaser.yml new file mode 100644 index 000000000..4b53f6767 --- /dev/null +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/core.entity_view_display.node.news_item.tiny_teaser.yml @@ -0,0 +1,22 @@ +config_rewrite: + replace: ['dependencies'] +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.news_item.field_content + - field.field.node.news_item.field_lead_in + - field.field.node.news_item.field_main_image + - field.field.node.news_item.field_main_image_caption + - field.field.node.news_item.field_news_groups + - field.field.node.news_item.field_news_item_links_link + - field.field.node.news_item.field_news_item_links_title + - field.field.node.news_item.field_news_item_tags + - field.field.node.news_item.field_news_item_updating_news + - field.field.node.news_item.field_news_neighbourhoods + - field.field.node.news_item.field_radioactivity + - field.field.node.news_item.field_short_title + - node.type.news_item + module: + - user +hidden: + field_news_item_updating_news: true diff --git a/public/modules/custom/helfi_etusivu_config/config/rewrite/language/fi/core.entity_form_display.node.news_item.default.yml b/public/modules/custom/helfi_etusivu_config/config/rewrite/language/fi/core.entity_form_display.node.news_item.default.yml new file mode 100644 index 000000000..a7ca62d83 --- /dev/null +++ b/public/modules/custom/helfi_etusivu_config/config/rewrite/language/fi/core.entity_form_display.node.news_item.default.yml @@ -0,0 +1,6 @@ +third_party_settings: + field_group: + group_updating_news: + label: 'Päivittyvä uutinen' + format_settings: + description: "Jätä sisältöalue tyhjäksi päivittyvän uutisen yläpuolelta, jos luot päivittyvän uutisen.
Lisää uusin uutispäivitys viimeiseksi. Järjestelmä näyttää päivitykset sivulla käänteisessä järjestyksessä." diff --git a/public/themes/custom/hdbt_subtheme/dist/css/styles.min.css b/public/themes/custom/hdbt_subtheme/dist/css/styles.min.css index d53aa568b..4cad84a0c 100644 --- a/public/themes/custom/hdbt_subtheme/dist/css/styles.min.css +++ b/public/themes/custom/hdbt_subtheme/dist/css/styles.min.css @@ -1 +1 @@ -.block--news-of-interest,.block--main-news{padding-left:16px;padding-right:16px;max-width:1296px;margin-top:32px;margin:auto;width:100%}@media(min-width: 768px){.block--news-of-interest,.block--main-news{padding-left:32px;padding-right:32px}}@media(min-width: 768px){.block--news-of-interest,.block--main-news{max-width:1328px}}@media(min-width: 992px){.block--news-of-interest,.block--main-news{margin-top:64px}}.block--news-of-interest h2,.block--main-news h2{margin-bottom:48px;margin-top:0}.component--current{background-color:var(--hdbt-color-palette--secondary);color:var(--hdbt-color-palette-text--secondary)}.current__content{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;max-width:1264px}@media(min-width: 768px){.current__content{flex-direction:row}}.current__links-container{padding-bottom:16px;padding-top:16px}@media(min-width: 576px){.current__links-container{padding-bottom:24px;padding-top:24px}}@media(min-width: 768px){.current__links-container{padding-right:16px}}@media(min-width: 992px){.current__links-container{padding-bottom:48px;padding-top:48px}}@media(min-width: 992px){.current__links-container{padding-bottom:64px;padding-top:64px}}.current{display:flex;flex-direction:column}@media(min-width: 768px){.current__illustration-container{margin-left:auto;margin-top:-32px}}@media(min-width: 992px){.current__illustration-container{margin-top:-48px}}@media(min-width: 1248px){.current__illustration-container{margin-top:-64px}}.current__seasonal-illustration{aspect-ratio:1;display:block;width:258px}@media(min-width: 992px){.current__seasonal-illustration{width:378px}}@media(min-width: 1248px){.current__seasonal-illustration{width:486px}}.component--latest-news--cards{background-color:#f2f2f2}.component--latest-news .latest-news__link-wrapper{margin-top:32px}@media(min-width: 768px){.component--latest-news .latest-news__link-wrapper{margin-top:64px}} +.table-of-contents--news-update{padding-left:16px;padding-right:16px;--item-title-lineheight: 1.875rem}@media(min-width: 768px){.table-of-contents--news-update{padding-left:32px;padding-right:32px}}[dir="ltr"] .table-of-contents--news-update .table-of-contents__container{border-left:none}[dir="rtl"] .table-of-contents--news-update .table-of-contents__container{border-right:none}.table-of-contents--news-update .table-of-contents__title+.table-of-contents__content{padding-top:16px}.table-of-contents--news-update .table-of-contents__item{--line-height: 1.5;font-size:1.25rem;font-weight:500;line-height:var(--line-height);display:flex;flex-direction:column;padding-top:16px;padding-bottom:16px;padding-left:16px;padding-right:16px;position:relative}@media(min-width: 768px){.table-of-contents--news-update .table-of-contents__item{flex-direction:row}}[dir="ltr"] .table-of-contents--news-update .table-of-contents__item::before,[dir="ltr"] .table-of-contents--news-update .table-of-contents__item::after{left:8px}[dir="rtl"] .table-of-contents--news-update .table-of-contents__item::before,[dir="rtl"] .table-of-contents--news-update .table-of-contents__item::after{right:8px}.table-of-contents--news-update .table-of-contents__item::before,.table-of-contents--news-update .table-of-contents__item::after{content:"";display:block;position:absolute}[dir="rtl"] .table-of-contents--news-update .table-of-contents__item::before,[dir="rtl"] .table-of-contents--news-update .table-of-contents__item::after{right:8px}.table-of-contents--news-update .table-of-contents__item::after{background-color:#000;height:calc(100% + 32px + 8px);top:-16px;transform:translateX(calc(var(--lang-direction) * -50%));width:2px;z-index:0}.table-of-contents--news-update .table-of-contents__item:first-of-type::after{height:100%;top:calc(16px + var(--item-title-lineheight)*.5)}.table-of-contents--news-update .table-of-contents__item:last-of-type::after{height:calc(16px + var(--item-title-lineheight)*.5)}.table-of-contents--news-update .table-of-contents__item:only-child::after{display:none}.table-of-contents--news-update .table-of-contents__item::before{background-color:#fff;border:3px solid #000;border-radius:50%;height:16px;top:calc(16px + var(--item-title-lineheight)*.5);transform:translate(calc(var(--lang-direction) * -50%), -50%);width:16px;z-index:1}.table-of-contents--news-update time{padding-left:16px}[dir="rtl"] .table-of-contents--news-update time{padding-left:0;padding-right:16px}.table-of-contents--news-update .table-of-contents__link{margin-left:16px}@media(min-width: 768px){.table-of-contents--news-update .table-of-contents__link{margin-left:32px}}[dir="rtl"] .table-of-contents--news-update .table-of-contents__link{margin-left:0;margin-right:16px}@media(min-width: 768px){[dir="rtl"] .table-of-contents--news-update .table-of-contents__link{margin-right:32px}}.block--news-of-interest,.block--main-news{padding-left:16px;padding-right:16px;max-width:1296px;margin-top:32px;margin:auto;width:100%}@media(min-width: 768px){.block--news-of-interest,.block--main-news{padding-left:32px;padding-right:32px}}@media(min-width: 768px){.block--news-of-interest,.block--main-news{max-width:1328px}}@media(min-width: 992px){.block--news-of-interest,.block--main-news{margin-top:64px}}.block--news-of-interest h2,.block--main-news h2{margin-bottom:48px;margin-top:0}.component--current{background-color:var(--hdbt-color-palette--secondary);color:var(--hdbt-color-palette-text--secondary)}.current__content{display:flex;flex-direction:column;margin-left:auto;margin-right:auto;max-width:1264px}@media(min-width: 768px){.current__content{flex-direction:row}}.current__links-container{padding-bottom:16px;padding-top:16px}@media(min-width: 576px){.current__links-container{padding-bottom:24px;padding-top:24px}}@media(min-width: 768px){.current__links-container{padding-right:16px}}@media(min-width: 992px){.current__links-container{padding-bottom:48px;padding-top:48px}}@media(min-width: 992px){.current__links-container{padding-bottom:64px;padding-top:64px}}.current{display:flex;flex-direction:column}@media(min-width: 768px){.current__illustration-container{margin-left:auto;margin-top:-32px}}@media(min-width: 992px){.current__illustration-container{margin-top:-48px}}@media(min-width: 1248px){.current__illustration-container{margin-top:-64px}}.current__seasonal-illustration{aspect-ratio:1;display:block;width:258px}@media(min-width: 992px){.current__seasonal-illustration{width:378px}}@media(min-width: 1248px){.current__seasonal-illustration{width:486px}}.component--latest-news--cards{background-color:#f2f2f2}.component--latest-news .latest-news__link-wrapper{margin-top:32px}@media(min-width: 768px){.component--latest-news .latest-news__link-wrapper{margin-top:64px}}.component--news-update{border-bottom:1px solid #ccc;padding-bottom:32px}@media(min-width: 768px){.component--news-update{padding-bottom:48px}}.component--news-update time{--line-height: 1.5555555556;font-size:1.125rem;font-weight:400;line-height:var(--line-height);display:inline-block;margin-top:16px}.component--news-update .component__content{margin-top:32px}@media(min-width: 768px){.component--news-update .component__content{margin-top:48px}}*~.component--news-update,.component--news-update~.component--news-update{margin-top:32px}@media(min-width: 768px){*~.component--news-update,.component--news-update~.component--news-update{margin-top:48px}} diff --git a/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js b/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js new file mode 100644 index 000000000..ae105e822 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/dist/js/updatingNewsTableOfContents.min.js @@ -0,0 +1 @@ +!function(){"use strict";!function(Drupal,e){Drupal.behaviors.updating_news_table_of_contents={attach:function(){const t=document.getElementById("helfi-toc-table-of-contents-news-updates");if(!t)return;const n=document.querySelector("#helfi-toc-table-of-contents-list > ul"),o=document.querySelector("main.layout-main-wrapper");document.querySelectorAll("[id]").forEach((function(e){Drupal.tableOfContents.reservedIds.push(e.id)}));let l=Drupal.tableOfContents.exclusions();l+=":not(.components--upper *):not(.component--remote-video *):not(.component--text *):not(.component--banner *):not(.component--image *):not(.block--news-of-interest *):not(#helfi-toc-table-of-contents-news-updates *)",e("updating-news-table-of-contents",Drupal.tableOfContents.titleComponents(l).join(","),o).forEach((function(e){const{nodeName:o,anchorName:l}=Drupal.tableOfContents.createTableOfContentElements(e,[]);let a="";if(t&&e.nextSibling&&"TIME"===e.nextElementSibling.nodeName){let t=new Date(e.nextElementSibling.dateTime);a=`${t.getDate()}.${t.getMonth()+1}.${t.getFullYear()}`}if(n&&"h2"===o){let t=document.createElement("li");if(t.classList.add("table-of-contents__item"),a){let n=document.createElement("time");n.dateTime=e.nextElementSibling.dateTime,n.textContent=a,t.appendChild(n)}let o=document.createElement("a");o.classList.add("table-of-contents__link"),o.href=`#${l}`,o.textContent=e.textContent.trim(),t.appendChild(o),n.appendChild(t)}})),t&&Drupal.tableOfContents.updateTOC(t)}}}(Drupal,once)}(); \ No newline at end of file diff --git a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml index c41df7056..ef35eb84b 100644 --- a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml +++ b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.libraries.yml @@ -3,3 +3,11 @@ global-styling: css: theme: dist/css/styles.min.css: {} + +updating-news-table-of-contents: + js: + dist/js/updatingNewsTableOfContents.min.js: {} + version: 1.0 + dependencies: + - core/once + - helfi_toc/table_of_contents diff --git a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme index 6253c0b33..facbe2e26 100644 --- a/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme +++ b/public/themes/custom/hdbt_subtheme/hdbt_subtheme.theme @@ -8,6 +8,7 @@ declare(strict_types=1); use Drupal\Core\Url; +use Drupal\node\NodeInterface; /** * Implements hook_preprocess_HOOK(). @@ -210,3 +211,18 @@ function hdbt_subtheme_preprocess_views_view_row_rss(&$variables) : void { } } } + +/** + * Implements hook_preprocess_HOOK(). + */ +function hdbt_subtheme_preprocess_node(array &$variables): void { + if ( + !$variables['node'] instanceof NodeInterface || + $variables['node']->bundle() !== 'news_item' + ) { + return; + } + + // Attach the updating news table of contents library to the news item page. + $variables['#attached']['library'][] = 'hdbt_subtheme/updating-news-table-of-contents'; +} diff --git a/public/themes/custom/hdbt_subtheme/package-lock.json b/public/themes/custom/hdbt_subtheme/package-lock.json index 824faec91..765f4e3b0 100644 --- a/public/themes/custom/hdbt_subtheme/package-lock.json +++ b/public/themes/custom/hdbt_subtheme/package-lock.json @@ -3343,9 +3343,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001615", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001615.tgz", - "integrity": "sha512-1IpazM5G3r38meiae0bHRnPhz+CBQ3ZLqbQMtrg+AsTPKAXgW38JNsXkyZ+v8waCsDmPq87lmfun5Q2AGysNEQ==", + "version": "1.0.30001620", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz", + "integrity": "sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew==", "funding": [ { "type": "opencollective", @@ -13196,9 +13196,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001615", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001615.tgz", - "integrity": "sha512-1IpazM5G3r38meiae0bHRnPhz+CBQ3ZLqbQMtrg+AsTPKAXgW38JNsXkyZ+v8waCsDmPq87lmfun5Q2AGysNEQ==" + "version": "1.0.30001620", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz", + "integrity": "sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew==" }, "chalk": { "version": "2.4.2", diff --git a/public/themes/custom/hdbt_subtheme/src/js/.keepme b/public/themes/custom/hdbt_subtheme/src/js/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js b/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js new file mode 100644 index 000000000..c6b0b6c40 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/src/js/updatingNewsTableOfContents.js @@ -0,0 +1,76 @@ +'use strict'; + +(function (Drupal, once) { + Drupal.behaviors.updating_news_table_of_contents = { + attach: function attach() { + + const tableOfContentsNewsUpdates = document.getElementById('helfi-toc-table-of-contents-news-updates'); + + // Bail if table of contents is not enabled. + if (!tableOfContentsNewsUpdates) { + return; + } + + const tableOfContentsList = document.querySelector('#helfi-toc-table-of-contents-list > ul'); + const mainContent = document.querySelector('main.layout-main-wrapper'); + const reservedElems = document.querySelectorAll('[id]'); + reservedElems.forEach(function (elem) { + Drupal.tableOfContents.reservedIds.push(elem.id); + }); + let exclusions = Drupal.tableOfContents.exclusions(); + + // Add exclusions for the news updates table of contents. + exclusions += + ':not(.components--upper *)' + + ':not(.component--remote-video *)' + + ':not(.component--text *)' + + ':not(.component--banner *)' + + ':not(.component--image *)' + + ':not(.block--news-of-interest *)' + + ':not(#helfi-toc-table-of-contents-news-updates *)'; + + // Craft table of contents for news item. + once('updating-news-table-of-contents', Drupal.tableOfContents.titleComponents(exclusions).join(','), mainContent) + .forEach(function (content) { + + const { nodeName, anchorName} = Drupal.tableOfContents.createTableOfContentElements(content, []); + + // On updating news there is published date under the title that we want to display in the + // table of contents news update version. For normal table of contents this remains empty. + let contentPublishDate = ''; + + if (tableOfContentsNewsUpdates && content.nextSibling && content.nextElementSibling.nodeName === 'TIME') { + let contentPublishDateStamp = new Date(content.nextElementSibling.dateTime); + contentPublishDate = `${contentPublishDateStamp.getDate()}.${contentPublishDateStamp.getMonth() + 1}.${contentPublishDateStamp.getFullYear()}`; + } + + // Create table of contents if component is enabled. + if (tableOfContentsList && nodeName === 'h2') { + let listItem = document.createElement('li'); + listItem.classList.add('table-of-contents__item'); + + // Add content publish date and its wrapper to list items only if they exist. + if (contentPublishDate) { + let publishDate = document.createElement('time'); + publishDate.dateTime = content.nextElementSibling.dateTime; + publishDate.textContent = contentPublishDate; + listItem.appendChild(publishDate); + } + + let link = document.createElement('a'); + link.classList.add('table-of-contents__link'); + link.href = `#${anchorName}`; + link.textContent = content.textContent.trim(); + + listItem.appendChild(link); + tableOfContentsList.appendChild(listItem); + } + } + ); + + if (tableOfContentsNewsUpdates) { + Drupal.tableOfContents.updateTOC(tableOfContentsNewsUpdates); + } + }, + }; +})(Drupal, once); diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss index 96650aaec..3c399dcc0 100644 --- a/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss +++ b/public/themes/custom/hdbt_subtheme/src/scss/06_components/__index.scss @@ -1,3 +1,4 @@ @import 'block/_index'; +@import 'navigation/index'; @import 'pages/_index'; @import 'paragraphs/index'; diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_index.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_index.scss new file mode 100644 index 000000000..9e523ccfd --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_index.scss @@ -0,0 +1 @@ +@import 'table-of-contents'; diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_table-of-contents.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_table-of-contents.scss new file mode 100644 index 000000000..5869da57b --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/src/scss/06_components/navigation/_table-of-contents.scss @@ -0,0 +1,98 @@ +// This implementation is very close to phasing component but not totally the same. +.table-of-contents--news-update { + @include component-side-padding; + --item-title-lineheight: #{1.5 * get-font-size('h4')}; + + .table-of-contents__container { + // Hide the border that the default TOC has on the left. + border-inline-start: none; + } + + .table-of-contents__title + .table-of-contents__content { + padding-top: $spacing; + } + + .table-of-contents__item { + @include font('special.large_link'); + display: flex; + flex-direction: column; + padding-block: $spacing; + padding-inline: $spacing; + position: relative; + + @include breakpoint($breakpoint-m) { + flex-direction: row; + } + + &::before, + &::after { + content: ''; + display: block; + inset-inline-start: calc($spacing * 0.5); + position: absolute; + + &:dir(rtl) { + right: calc($spacing * 0.5); + } + } + + &::after { + background-color: $color-black; + height: calc(100% + $spacing-double + $spacing-half); + top: -#{$spacing}; + transform: translateX(calc(var(--lang-direction) * -50%)); + width: 2px; + z-index: 0; + } + + &:first-of-type::after { + height: 100%; + top: calc($spacing + var(--item-title-lineheight) * 0.5); + } + + &:last-of-type::after { + height: calc($spacing + var(--item-title-lineheight) * 0.5); + } + + &:only-child::after { + display: none; + } + + &::before { + background-color: $color-white; + border: 3px solid $color-black; + border-radius: 50%; + height: $spacing; + top: calc($spacing + var(--item-title-lineheight) * 0.5); + transform: translate(calc(var(--lang-direction) * -50%), -50%); + width: $spacing; + z-index: 1; + } + } + + time { + padding-left: $spacing; + + &:dir(rtl) { + padding-left: 0; + padding-right: $spacing; + } + } + + .table-of-contents__link { + margin-left: $spacing; + + @include breakpoint($breakpoint-m) { + margin-left: $spacing-double; + } + + &:dir(rtl) { + margin-left: 0; + margin-right: $spacing; + + @include breakpoint($breakpoint-m) { + margin-right: $spacing-double; + } + } + } +} diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_index.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_index.scss index cdb90535d..fc606c379 100644 --- a/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_index.scss +++ b/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_index.scss @@ -1,2 +1,3 @@ @import 'current'; @import 'latest-news'; +@import 'news-update'; diff --git a/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_news-update.scss b/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_news-update.scss new file mode 100644 index 000000000..5a36a5603 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/src/scss/06_components/paragraphs/_news-update.scss @@ -0,0 +1,31 @@ +.component--news-update { + border-bottom: 1px solid $color-black-20; + padding-bottom: $spacing-double; + + @include breakpoint($breakpoint-m) { + padding-bottom: $spacing-triple; + } + + time { + @include font('body'); + display: inline-block; + margin-top: $spacing; + } + + .component__content { + margin-top: $spacing-double; + + @include breakpoint($breakpoint-m) { + margin-top: $spacing-triple; + } + } +} + +* ~ .component--news-update, +.component--news-update ~ .component--news-update { + margin-top: $spacing-double; + + @include breakpoint($breakpoint-m) { + margin-top: $spacing-triple; + } +} diff --git a/public/themes/custom/hdbt_subtheme/templates/content/.keepme b/public/themes/custom/hdbt_subtheme/templates/content/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/themes/custom/hdbt_subtheme/templates/content/node--news-item.html.twig b/public/themes/custom/hdbt_subtheme/templates/content/node--news-item.html.twig new file mode 100644 index 000000000..d313a094d --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/templates/content/node--news-item.html.twig @@ -0,0 +1,7 @@ +{% extends '@hdbt/module/helfi-news-item/node--news-item.html.twig' %} + +{% block after_content %} + {% if content.field_news_item_updating_news|render|striptags|trim is not empty %} + {{ content.field_news_item_updating_news }} + {% endif %} +{% endblock after_content %} diff --git a/public/themes/custom/hdbt_subtheme/templates/field/.keepme b/public/themes/custom/hdbt_subtheme/templates/field/.keepme deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/themes/custom/hdbt_subtheme/templates/field/field--node--field-news-item-updating-news.html.twig b/public/themes/custom/hdbt_subtheme/templates/field/field--node--field-news-item-updating-news.html.twig new file mode 100644 index 000000000..24fde56b0 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/templates/field/field--node--field-news-item-updating-news.html.twig @@ -0,0 +1,55 @@ +{% + set classes = [ + 'paragraph-content', + 'components', + ] +%} + +{% if items|length > 1 %} +
+
+ {% set title_attributes = { + 'class': [ + 'table-of-contents__title', + ] + } + %} + {% if alternative_language %} + {% set title_attributes = title_attributes|merge({ + 'dir': lang_attributes.fallback_dir, + 'lang': lang_attributes.fallback_lang + }) + %} + {% endif %} +

{{ 'Latest updates'|t({}, {'context': 'Updating news'}) }}

+ +
+ +
+{% endif %} + + + {% for item in items|reverse %} + {{ item.content }} + {% endfor %} + diff --git a/public/themes/custom/hdbt_subtheme/templates/paragraph/paragraph--news-update.html.twig b/public/themes/custom/hdbt_subtheme/templates/paragraph/paragraph--news-update.html.twig new file mode 100644 index 000000000..8e94faae5 --- /dev/null +++ b/public/themes/custom/hdbt_subtheme/templates/paragraph/paragraph--news-update.html.twig @@ -0,0 +1,18 @@ +{% block paragraph %} + {% embed "@hdbt/misc/component.twig" with + { + component_classes: [ 'component--news-update' ], + component_title: content.field_news_update_title, + component_content_class: 'news-update', + component_content_tag: 'div', + } + %} + {% block component_tags %} + {{ content.field_news_update_date }} + {% endblock component_tags %} + + {% block component_content %} + {{ content.field_news_update }} + {% endblock component_content %} + {% endembed %} +{% endblock paragraph %}