From b2f3fc75114b9e23d93b72f2f3e3be07b5ec7c7f Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Tue, 19 Jul 2022 16:09:25 +0200 Subject: [PATCH 01/24] feat: use Card List on any Entity type Refs: RWR-13 --- config/field.field.group.cluster.field_paragraphs.yml | 4 +--- config/field.field.group.operation.field_paragraphs.yml | 4 +--- config/field.field.node.page.field_paragraphs.yml | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/config/field.field.group.cluster.field_paragraphs.yml b/config/field.field.group.cluster.field_paragraphs.yml index 94dd29d9..71991bc0 100644 --- a/config/field.field.group.cluster.field_paragraphs.yml +++ b/config/field.field.group.cluster.field_paragraphs.yml @@ -5,7 +5,6 @@ dependencies: config: - field.storage.group.field_paragraphs - group.type.cluster - - paragraphs.paragraphs_type.card_list - paragraphs.paragraphs_type.child_groups - paragraphs.paragraphs_type.layout - paragraphs.paragraphs_type.twitter_feed @@ -25,7 +24,6 @@ settings: handler: 'default:paragraph' handler_settings: target_bundles: - card_list: card_list child_groups: child_groups layout: layout twitter_feed: twitter_feed @@ -33,7 +31,7 @@ settings: target_bundles_drag_drop: card_list: weight: -31 - enabled: true + enabled: false child_groups: weight: -23 enabled: true diff --git a/config/field.field.group.operation.field_paragraphs.yml b/config/field.field.group.operation.field_paragraphs.yml index a1082229..852e29cb 100644 --- a/config/field.field.group.operation.field_paragraphs.yml +++ b/config/field.field.group.operation.field_paragraphs.yml @@ -5,7 +5,6 @@ dependencies: config: - field.storage.group.field_paragraphs - group.type.operation - - paragraphs.paragraphs_type.card_list - paragraphs.paragraphs_type.layout - paragraphs.paragraphs_type.twitter_feed module: @@ -24,14 +23,13 @@ settings: handler: 'default:paragraph' handler_settings: target_bundles: - card_list: card_list layout: layout twitter_feed: twitter_feed negate: 1 target_bundles_drag_drop: card_list: weight: -31 - enabled: true + enabled: false child_groups: weight: -23 enabled: false diff --git a/config/field.field.node.page.field_paragraphs.yml b/config/field.field.node.page.field_paragraphs.yml index 8ef3a962..1ea444ed 100644 --- a/config/field.field.node.page.field_paragraphs.yml +++ b/config/field.field.node.page.field_paragraphs.yml @@ -5,7 +5,6 @@ dependencies: config: - field.storage.node.field_paragraphs - node.type.page - - paragraphs.paragraphs_type.card_list - paragraphs.paragraphs_type.layout - paragraphs.paragraphs_type.twitter_feed module: @@ -24,14 +23,13 @@ settings: handler: 'default:paragraph' handler_settings: target_bundles: - card_list: card_list layout: layout twitter_feed: twitter_feed negate: 1 target_bundles_drag_drop: card_list: weight: -31 - enabled: true + enabled: false child_groups: weight: -23 enabled: false From 3fa781fad79c838833d4e7a3bbcc31544cad65df Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Thu, 21 Jul 2022 16:09:40 +0200 Subject: [PATCH 02/24] feat: Operations listing Refs: RWR-156 --- config/views.view.operations.yml | 384 +++++++++++++++++++++++++++++++ 1 file changed, 384 insertions(+) create mode 100644 config/views.view.operations.yml diff --git a/config/views.view.operations.yml b/config/views.view.operations.yml new file mode 100644 index 00000000..0a7fc790 --- /dev/null +++ b/config/views.view.operations.yml @@ -0,0 +1,384 @@ +uuid: a51d6e0c-2d4d-4873-ba4c-f6b9007fdf60 +langcode: en +status: true +dependencies: + config: + - field.storage.group.field_archive_group + - group.type.operation + - system.menu.main + module: + - group +id: operations +label: Operations +module: views +description: 'Overviews of all Operations' +tag: '' +base_table: groups_field_data +base_field: id +display: + default: + id: default + display_title: Default + display_plugin: default + position: 0 + display_options: + title: Operations + fields: + label_1: + id: label_1 + table: groups_field_data + field: label + relationship: none + group_type: group + admin_label: 'First letter of Operation name' + entity_type: group + entity_field: label + plugin_id: field + label: '' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: true + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 1 + word_boundary: false + ellipsis: false + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: true + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: false + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + label: + id: label + table: groups_field_data + field: label + relationship: none + group_type: group + admin_label: '' + entity_type: null + entity_field: label + plugin_id: field + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + settings: + link_to_entity: true + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + field_archive_group: + id: field_archive_group + table: group__field_archive_group + field: field_archive_group + relationship: none + group_type: group + admin_label: 'Archive status' + plugin_id: field + label: '' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: true + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: boolean + settings: + format: custom + format_custom_false: '' + format_custom_true: Archived + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + pager: + type: none + options: + offset: 0 + items_per_page: null + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: none + options: { } + cache: + type: tag + options: { } + empty: { } + sorts: + label: + id: label + table: groups_field_data + field: label + relationship: none + group_type: group + admin_label: '' + entity_type: group + entity_field: label + plugin_id: standard + order: ASC + expose: + label: '' + field_identifier: '' + exposed: false + arguments: { } + filters: + status: + id: status + table: groups_field_data + field: status + entity_type: group + entity_field: status + plugin_id: boolean + value: '1' + group: 1 + expose: + operator: '' + operator_limit_selection: false + operator_list: { } + type: + id: type + table: groups_field_data + field: type + relationship: none + group_type: group + admin_label: '' + entity_type: group + entity_field: type + plugin_id: bundle + operator: in + value: + operation: operation + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + style: + type: grid + options: + grouping: + - + field: label_1 + rendered: true + rendered_strip: false + columns: 4 + automatic_width: true + alignment: vertical + row_class_custom: '' + row_class_default: true + col_class_custom: '' + col_class_default: true + row: + type: fields + options: + default_field_elements: true + inline: + label: label + field_archive_group: field_archive_group + separator: '' + hide_empty: false + query: + type: views_query + options: + query_comment: '' + disable_sql_rewrite: false + distinct: false + replica: false + query_tags: { } + relationships: { } + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + tags: + - 'config:field.storage.group.field_archive_group' + page_operations: + id: page_operations + display_title: Operations + display_plugin: page + position: 1 + display_options: + display_description: '' + display_extenders: { } + path: operations + menu: + type: normal + title: Operations + description: '' + weight: 0 + expanded: false + menu_name: main + parent: '' + context: '0' + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + tags: + - 'config:field.storage.group.field_archive_group' From f214334c249d7932b942090a14cea4b6fee3dabe Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Thu, 21 Jul 2022 16:20:16 +0200 Subject: [PATCH 03/24] fix: copy default Views tpl for Grid so we can customize Refs: RWR-156 --- ...iew--operations--page-operations.html.twig | 92 +++++++++++++++++++ .../templates/views-view-grid.html.twig | 80 ++++++++++++++++ 2 files changed, 172 insertions(+) create mode 100644 html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig create mode 100644 html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig diff --git a/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig b/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig new file mode 100644 index 00000000..a8cc87e8 --- /dev/null +++ b/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig @@ -0,0 +1,92 @@ +{# +/** + * @file + * HR.info override for a main view template. + * + * @overrides html/themes/contrib/common_design/templates/views/views-view.html.twig + * + * Available variables: + * - attributes: Remaining HTML attributes for the element. + * - css_name: A css-safe version of the view name. + * - css_class: The user-specified classes names, if any. + * - header: The optional header. + * - footer: The optional footer. + * - rows: The results of the view query, if any. + * - empty: The content to display if there are no rows. + * - pager: The optional pager next/prev links to display. + * - exposed: Exposed widget form/info to display. + * - feed_icons: Optional feed icons to display. + * - more: An optional link to the next page of results. + * - title: Title of the view, only used when displaying in the admin preview. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the view title. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the view title. + * - attachment_before: An optional attachment view to be displayed before the + * view content. + * - attachment_after: An optional attachment view to be displayed after the + * view content. + * - dom_id: Unique id for every view being printed to give unique class for + * Javascript. + * + * @see template_preprocess_views_view() + */ +#} +{% + set classes = [ + 'view', + 'view-' ~ id|clean_class, + 'view-id-' ~ id, + 'view-display-id-' ~ display_id, + dom_id ? 'js-view-dom-id-' ~ dom_id + ] +%} + + {{ title_prefix }} + {% if title %} + {{ title }} + {% endif %} + {{ title_suffix }} + {% if header %} +
+ {{ header }} +
+ {% endif %} + {% if exposed %} +
+ {{ exposed }} +
+ {% endif %} + {% if attachment_before %} +
+ {{ attachment_before }} +
+ {% endif %} + + {% if rows %} +
+ {{ rows }} +
+ {% elseif empty %} +
+ {{ empty }} +
+ {% endif %} + + {% if pager %} + {{ pager }} + {% endif %} + {% if attachment_after %} +
+ {{ attachment_after }} +
+ {% endif %} + {% if more %} + {{ more }} + {% endif %} + {% if footer %} + + {% endif %} + diff --git a/html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig b/html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig new file mode 100644 index 00000000..d5fff2ab --- /dev/null +++ b/html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig @@ -0,0 +1,80 @@ +{# +/** + * @file + * HR.info theme implementation for views to display rows in a grid. + * + * @overrides html/core/modules/views/templates/views-view-grid.html.twig + * + * Available variables: + * - attributes: HTML attributes for the wrapping element. + * - title: The title of this group of rows. + * - view: The view object. + * - rows: The rendered view results. + * - options: The view plugin style options. + * - row_class_default: A flag indicating whether default classes should be + * used on rows. + * - col_class_default: A flag indicating whether default classes should be + * used on columns. + * - items: A list of grid items. Each item contains a list of rows or columns. + * The order in what comes first (row or column) depends on which alignment + * type is chosen (horizontal or vertical). + * - attributes: HTML attributes for each row or column. + * - content: A list of columns or rows. Each row or column contains: + * - attributes: HTML attributes for each row or column. + * - content: The row or column contents. + * + * @see template_preprocess_views_view_grid() + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'views-view-grid', + options.alignment, + 'cols-' ~ options.columns, + 'clearfix', + ] +%} +{% if options.row_class_default %} + {% + set row_classes = [ + 'views-row', + options.alignment == 'horizontal' ? 'clearfix', + ] + %} +{% endif %} +{% if options.col_class_default %} + {% + set col_classes = [ + 'views-col', + options.alignment == 'vertical' ? 'clearfix', + ] + %} +{% endif %} +{% if title %} +

{{ title }}

+{% endif %} + + {% if options.alignment == 'horizontal' %} + {% for row in items %} + + {% for column in row.content %} + + {{- column.content -}} + + {% endfor %} + + {% endfor %} + {% else %} + {% for column in items %} + + {% for row in column.content %} + + {{- row.content -}} + + {% endfor %} + + {% endfor %} + {% endif %} + From b5e7ecab68dd9f775a494a95bd00ba4e5dbb7137 Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Thu, 21 Jul 2022 16:53:56 +0200 Subject: [PATCH 04/24] fix: basic RW branding for Operations listing Refs: RWR-156 --- config/views.view.operations.yml | 4 +- .../common_design_subtheme.libraries.yml | 12 +++ .../components/rw-brand/rw-brand.css | 47 +++++++++++ .../components/rw-country/rw-country-list.css | 77 +++++++++++++++++++ ...iew--operations--page-operations.html.twig | 20 ++--- .../templates/views-view-grid.html.twig | 52 +++++++------ 6 files changed, 176 insertions(+), 36 deletions(-) create mode 100644 html/themes/custom/common_design_subtheme/components/rw-brand/rw-brand.css create mode 100644 html/themes/custom/common_design_subtheme/components/rw-country/rw-country-list.css diff --git a/config/views.view.operations.yml b/config/views.view.operations.yml index 0a7fc790..09c8953d 100644 --- a/config/views.view.operations.yml +++ b/config/views.view.operations.yml @@ -323,7 +323,7 @@ display: rendered: true rendered_strip: false columns: 4 - automatic_width: true + automatic_width: false alignment: vertical row_class_custom: '' row_class_default: true @@ -332,7 +332,7 @@ display: row: type: fields options: - default_field_elements: true + default_field_elements: false inline: label: label field_archive_group: field_archive_group diff --git a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml index a53e0a71..68391e82 100644 --- a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml +++ b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml @@ -147,3 +147,15 @@ hri-twitter-feed: css: theme: components/hri-twitter-feed/hri-twitter-feed.css: {} + +rw-brand: + css: + theme: + components/rw-brand/rw-brand.css: {} + +rw-country: + css: + theme: + components/rw-country/rw-country-list.css: {} + dependencies: + - common_design_subtheme/rw-brand diff --git a/html/themes/custom/common_design_subtheme/components/rw-brand/rw-brand.css b/html/themes/custom/common_design_subtheme/components/rw-brand/rw-brand.css new file mode 100644 index 00000000..ca94d3eb --- /dev/null +++ b/html/themes/custom/common_design_subtheme/components/rw-brand/rw-brand.css @@ -0,0 +1,47 @@ +/* stylelint-disable max-line-length */ +/** + * RW Brand Colors + * + * Recompile the Sass source files to get a new list. + * + * @see https://github.com/UN-OCHA/rwint9-site/blob/38e66da1b0fa4d6f316aaa7c961db859e2ef5d4b/html/themes/custom/common_design_subtheme/sass/cd/_cd-variables.scss + */ + +:root { + --cd-reliefweb-brand-blue: #0988bb; + --cd-reliefweb-brand-red: #f65c51; + --cd-reliefweb-brand-blue--dark: #055372; + --cd-reliefweb-brand-red--dark: #eb1405; + --cd-reliefweb-brand-grey--dark: #2e3436; + --cd-reliefweb-brand-grey--mid: #4d5254; + --cd-reliefweb-brand-grey--light: #e6ecef; + --cd-rgb-reliefweb-brand-blue: 9, 136, 187; + --cd-rgb-reliefweb-brand-red: 246, 92, 81; + --cd-rgb-reliefweb-brand-blue--dark: 4, 82, 112; + --cd-rgb-reliefweb-brand-red--dark: 235, 20, 5; + --cd-rgb-reliefweb-brand-grey--dark: 46, 52, 54; + --cd-rgb-reliefweb-brand-grey--light: 230, 236, 239; + --cd-reliefweb-grey--light: #d9d9d9; + --cd-reliefweb-grey--light--bg: rgba(217, 217, 217, 0.2); + --cd-reliefweb-orange: #f49e2c; + --cd-reliefweb-orange--bg: rgba(244, 158, 44, 0.2); + --cd-reliefweb-blue: #076d96; + --cd-reliefweb-blue--bg: rgba(7, 109, 150, 0.2); + --cd-reliefweb-green: #88bb09; + --cd-reliefweb-green--bg: rgba(136, 187, 9, 0.2); + --cd-reliefweb-red: #da190b; + --cd-reliefweb-red--bg: rgba(218, 25, 11, 0.2); + --cd-reliefweb-purple: #9509bb; + --cd-reliefweb-purple--bg: rgba(149, 9, 187, 0.2); + --cd-reliefweb-grey: #4b4b4b; + --cd-reliefweb-grey--bg: rgba(75, 75, 75, 0.2); + --cd-reliefweb-brown: #8f5507; + --cd-reliefweb-brown--bg: rgba(143, 85, 7, 0.2); + --cd-reliefweb-yellow: #f5cb2f; + --cd-reliefweb-yellow--bg: rgba(245, 203, 47, 0.2); + --cd-reliefweb-cyan: #56c9f7; + --cd-reliefweb-cyan--bg: rgba(86, 201, 247, 0.2); + --cd-reliefweb-orange--alert: #eb8705; + --cd-reliefweb-pink: rgba(246, 92, 81, 0.2); + --cd-reliefweb-grey--disable: rgba(230, 236, 239, 0.5); +} diff --git a/html/themes/custom/common_design_subtheme/components/rw-country/rw-country-list.css b/html/themes/custom/common_design_subtheme/components/rw-country/rw-country-list.css new file mode 100644 index 00000000..501d977f --- /dev/null +++ b/html/themes/custom/common_design_subtheme/components/rw-country/rw-country-list.css @@ -0,0 +1,77 @@ +/* stylelint-disable max-line-length */ +/** + * RW Country List + * + * Taken directly from RW9. Any cusotmizations will appear in a separate file. + * + * @see https://github.com/UN-OCHA/rwint9-site/blob/38e66da1b0fa4d6f316aaa7c961db859e2ef5d4b/html/themes/custom/common_design_subtheme/components/rw-country/rw-country-list.css + */ +.rw-river-page--countries > ul { + position: relative; + z-index: 1; + display: block; + margin: 12px -12px -12px -12px; + padding: 0; + list-style: none; +} +.rw-river-page--countries > ul ul, +.rw-river-page--countries > ul li { + position: relative; + display: inline-block; + width: 100%; + margin: 0; + padding: 0; + list-style: none; +} +.rw-river-page--countries > ul > li { + padding: 12px; +} +.rw-river-page--countries > ul > li:target:before { + position: absolute; + z-index: -1; + top: 8px; + right: 0; + bottom: 12px; + left: 0; + content: ""; + border: 4px solid var(--cd-reliefweb-brand-grey--light); +} +.rw-river-page--countries > ul .rw-river-country-list__group__title { + margin: 8px 0 24px 0; + padding: 0 0 16px 0; + border-bottom: 1px solid var(--cd-reliefweb-brand-grey--dark); + font-size: var(--cd-font-size--large); + font-weight: bold; +} +.rw-river-page--countries > ul li li { + margin: 0 0 8px 0; + padding-bottom: 8px; +} +.rw-river-page--countries > ul li li:last-child { + margin: 0; + border-bottom: none; +} +.rw-river-page--countries > ul li a { + line-height: 1.5; +} + +@media screen and (min-width: 480px) { + .rw-river-page--countries > ul { + columns: 2; + column-gap: 8px; + } +} + +@media screen and (min-width: 768px) { + .rw-river-page--countries > ul { + columns: 3; + column-gap: 8px; + } +} + +@media screen and (min-width: 1024px) { + .rw-river-page--countries > ul { + columns: 4; + column-gap: 8px; + } +} diff --git a/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig b/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig index a8cc87e8..86c16eca 100644 --- a/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig @@ -32,16 +32,18 @@ * @see template_preprocess_views_view() */ #} +{{ attach_library('common_design_subtheme/rw-country') }} {% set classes = [ - 'view', - 'view-' ~ id|clean_class, - 'view-id-' ~ id, - 'view-display-id-' ~ display_id, - dom_id ? 'js-view-dom-id-' ~ dom_id + 'rw-river-page', + 'rw-river-page--countries', + 'rw-river-page--countries--all', + 'rw-river-page--with-views', + 'rw-river-page--with-letter-navigation', + 'rw-river-page--with-links', ] %} - + {{ title_prefix }} {% if title %} {{ title }} @@ -64,9 +66,9 @@ {% endif %} {% if rows %} -
+
    {{ rows }} -
+ {% elseif empty %}
{{ empty }} @@ -89,4 +91,4 @@ {{ footer }}
{% endif %} - + diff --git a/html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig b/html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig index d5fff2ab..08ce18ce 100644 --- a/html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig @@ -52,29 +52,31 @@ ] %} {% endif %} -{% if title %} -

{{ title }}

-{% endif %} - - {% if options.alignment == 'horizontal' %} - {% for row in items %} - - {% for column in row.content %} - - {{- column.content -}} - - {% endfor %} - - {% endfor %} - {% else %} - {% for column in items %} - - {% for row in column.content %} - - {{- row.content -}} - - {% endfor %} - - {% endfor %} +
  • + {% if title %} +

    {{ title }}

    {% endif %} - + + {% if options.alignment == 'horizontal' %} + {% for row in items %} + + {% for column in row.content %} + + {{- column.content -}} + + {% endfor %} + + {% endfor %} + {% else %} +
      + {% for column in items %} + + {% for row in column.content %} + {{- row.content -}} + {% endfor %} + + {% endfor %} +
    + {% endif %} + +
  • From 0e3c998a6f22e681a77aec412e1ba51577ad53d4 Mon Sep 17 00:00:00 2001 From: "Peter Droogmans (attiks)" Date: Fri, 22 Jul 2022 10:46:00 +0200 Subject: [PATCH 05/24] feat: Notify team, username is email Refs: #RWR-175, #RWR-173 --- .../custom/hr_paragraphs/hr_paragraphs.module | 15 ++++ .../hr_paragraphs/hr_paragraphs.services.yml | 6 ++ .../EventSubscriber/SocialAuthSubscriber.php | 74 +++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 html/modules/custom/hr_paragraphs/src/EventSubscriber/SocialAuthSubscriber.php diff --git a/html/modules/custom/hr_paragraphs/hr_paragraphs.module b/html/modules/custom/hr_paragraphs/hr_paragraphs.module index da50ea70..f3515de0 100644 --- a/html/modules/custom/hr_paragraphs/hr_paragraphs.module +++ b/html/modules/custom/hr_paragraphs/hr_paragraphs.module @@ -1609,3 +1609,18 @@ function hr_paragraphs_remove_layout_paragraph_from_entity($entity_type, $id) { $entity->field_paragraphs = $paras; $entity->save(); } + +/** + * Implements hook_mail(). + */ +function hr_paragraphs_mail($key, &$message, $params) { + switch ($key) { + case 'user_created': + $message['subject'] = t('New HID login on Response site'); + $message['body'][] = t("Dear team\n\nThere is new user created on the site."); + $message['body'][] = t("\n\nEmail address: @mail.", [ + '@mail' => $params['mail'], + ]); + break; + } +} diff --git a/html/modules/custom/hr_paragraphs/hr_paragraphs.services.yml b/html/modules/custom/hr_paragraphs/hr_paragraphs.services.yml index 665fd86e..6b7775c1 100644 --- a/html/modules/custom/hr_paragraphs/hr_paragraphs.services.yml +++ b/html/modules/custom/hr_paragraphs/hr_paragraphs.services.yml @@ -31,3 +31,9 @@ services: class: Drupal\hr_paragraphs\Routing\RouteSubscriber tags: - { name: event_subscriber } + helper.event_subscriber: + class: Drupal\hr_paragraphs\EventSubscriber\SocialAuthSubscriber + arguments: + - '@plugin.manager.mail' + tags: + - { name: 'event_subscriber' } diff --git a/html/modules/custom/hr_paragraphs/src/EventSubscriber/SocialAuthSubscriber.php b/html/modules/custom/hr_paragraphs/src/EventSubscriber/SocialAuthSubscriber.php new file mode 100644 index 00000000..dea2bbde --- /dev/null +++ b/html/modules/custom/hr_paragraphs/src/EventSubscriber/SocialAuthSubscriber.php @@ -0,0 +1,74 @@ +mailManager = $mail_manager; + } + + /** + * {@inheritdoc} + */ + public static function getSubscribedEvents() { + $events[SocialAuthEvents::USER_FIELDS] = [ + 'onUserPreCreate', + ]; + + $events[SocialAuthEvents::USER_CREATED] = [ + 'onUserCreated', + ]; + + return $events; + } + + /** + * Set name to mail. + * + * @param \Drupal\social_auth\Event\UserFieldsEvent $event + * The Social Auth user fields event object. + */ + public function onUserPreCreate(UserFieldsEvent $event) { + $fields = $event->getUserFields(); + $fields['name'] = $fields['mail']; + $event->setUserFields($fields); + } + + /** + * Send notification. + * + * @param \Drupal\social_auth\Event\UserEvent $event + * The Social Auth user event object. + */ + public function onUserCreated(UserEvent $event) { + $params = [ + 'mail' => $event->getUser()->getInitialEmail(), + ]; + + $this->mailManager->mail('hr_paragraphs', 'user_created', 'info@humanitarianresponse.info', 'en', $params); + } + +} From 761fa1958c9264273c47df3ebc6053efca4868c2 Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Fri, 22 Jul 2022 11:56:17 +0200 Subject: [PATCH 06/24] feat: Letter Navigation for Operation listing Refs: RWR-156 --- .../common_design_subtheme.libraries.yml | 8 ++ .../rw-river-create-letter-navigation.js | 33 ++++++ .../rw-river-letter-navigation.css | 109 ++++++++++++++++++ .../rw-river-letter-navigation.js | 31 +++++ ...iew--operations--page-operations.html.twig | 5 + 5 files changed, 186 insertions(+) create mode 100644 html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-create-letter-navigation.js create mode 100644 html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.css create mode 100644 html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.js diff --git a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml index 68391e82..556706eb 100644 --- a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml +++ b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml @@ -159,3 +159,11 @@ rw-country: components/rw-country/rw-country-list.css: {} dependencies: - common_design_subtheme/rw-brand + +rw-river-letter-navigation: + css: + theme: + components/rw-river-letter-navigation/rw-river-letter-navigation.css: {} + js: + components/rw-river-letter-navigation/rw-river-create-letter-navigation.js: {} + components/rw-river-letter-navigation/rw-river-letter-navigation.js: {} diff --git a/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-create-letter-navigation.js b/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-create-letter-navigation.js new file mode 100644 index 00000000..5801064f --- /dev/null +++ b/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-create-letter-navigation.js @@ -0,0 +1,33 @@ +/** + * RW River - Create the Letter Navigation + * + * We don't have the navigation in the HTML response so we build it client-side. + */ +(function () { + 'use strict'; + + var output = ''; + var navId = 'letter-navigation'; + var navIdTitle = navId + '-title'; + var navWrapper = document.querySelector('#rw-river-letter-navigation-wrapper'); + var navLetters = document.querySelectorAll('.rw-river-country-list__group__title'); + + output += ''; + + navWrapper.innerHTML = output; +})(); diff --git a/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.css b/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.css new file mode 100644 index 00000000..d820efb3 --- /dev/null +++ b/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.css @@ -0,0 +1,109 @@ +/* stylelint-disable max-line-length */ +/** + * RW River Letter Navigation + * + * @see https://raw.githubusercontent.com/UN-OCHA/rwint9-site/41d232253529a2b86e0954954491f229611e0b52/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.css + */ + +/* Go to letter navigation */ +.rw-river-letter-navigation h3 { + display: inline-block; + margin: 0; + vertical-align: middle; + line-height: 40px; +} +.rw-river-letter-navigation h3:after { + content: ":"; +} +.rw-river-letter-navigation ul { + display: inline-block; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(40px, min-content)); + justify-content: space-between; + margin: 0; + padding: 0; + list-style: none; + vertical-align: middle; + background: rgba(230, 236, 239, 0.2); +} +.rw-river-letter-navigation li { + float: left; + margin: 0; + padding: 0; +} +.rw-river-letter-navigation li a { + display: inline-block; + min-width: 40px; + height: 40px; + padding: 0 8px; + text-align: center; + text-transform: uppercase; + line-height: 40px; +} +.rw-river-letter-navigation li a.rw-river-letter-navigation__link--active, +.rw-river-letter-navigation li a:focus, +.rw-river-letter-navigation li a:active, +.rw-river-letter-navigation li a:hover { + text-decoration: none; + background: var(--cd-reliefweb-brand-grey--light); + font-weight: bold; +} + +@media screen and (max-width: 479px) { + .js .rw-river-letter-navigation__btn { + display: block; + height: 40px; + margin: 0 auto; + padding: 0 8px; + border: 1px solid var(--cd-reliefweb-brand-grey--light); + background: white; + font-size: 16px; + } + .rw-river-letter-navigation__btn[aria-expanded] .cd-icon--arrow-down { + fill: var(--cd-reliefweb-brand-grey--dark); + } + [dir="ltr"] .rw-river-letter-navigation__btn[aria-expanded] .cd-icon--arrow-down { + margin-left: 0.5rem; + } + [dir="rtl"] .rw-river-letter-navigation__btn[aria-expanded] .cd-icon--arrow-down { + margin-right: 0.5rem; + } + .js .rw-river-letter-navigation { + position: absolute; + z-index: 4; + right: 12px; + left: 12px; + background: white; + -webkit-box-shadow: 0 0 6px 2px var(--cd-reliefweb-brand-grey--light); + box-shadow: 0 0 6px 2px var(--cd-reliefweb-brand-grey--light); + } +} + +@media screen and (min-width: 480px) { + .js .rw-river-letter-navigation { + --dropdown: false; + } +} + +@media all and (min-width: 480px) and (-ms-high-contrast: none) { + /* This is needed for IE11 + No support for CSS custom properties means + --dropdown: false; property on nav container is not recognised + so the cd-dropdown.js creates a toggler button on desktop + This hides it when that happens. + */ + .rw-river-letter-navigation__btn { + display: none; + } + + /* This is needed for IE11 + No support for CSS custom properties means + --dropdown: false; property on nav container is not recognised + so the cd-dropdown.js does not run the updateToggler function + which toggles the data-cd-hidden attribute. + This displays the nav regardless of that attribute value. + */ + .rw-river-letter-navigation[data-cd-hidden="true"] { + display: block; + } +} diff --git a/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.js b/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.js new file mode 100644 index 00000000..c2f227f5 --- /dev/null +++ b/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.js @@ -0,0 +1,31 @@ +/** + * RW River Letter Navigation + * + * @see https://raw.githubusercontent.com/UN-OCHA/rwint9-site/41d232253529a2b86e0954954491f229611e0b52/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.js + */ +(function () { + 'use strict'; + + /** + * Update the active anchor link when the current url fragment changes. + */ + function updateActiveFragmentLink() { + var hash = location.hash || '#'; + var links = document.querySelectorAll('.rw-river-letter-navigation__link[href^="#"]'); + for (var i = links.length - 1; i >= 0; i--) { + var link = links[i]; + if (link.getAttribute('href') !== hash) { + link.classList.remove('rw-river-letter-navigation__link--active'); + } + else { + link.classList.add('rw-river-letter-navigation__link--active'); + } + } + } + + // Update the active fragment link when the window hash changes. + window.addEventListener('hashchange', updateActiveFragmentLink); + + // Initial update of the active fragment link. + updateActiveFragmentLink(); +})(); diff --git a/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig b/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig index 86c16eca..df53cb15 100644 --- a/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig @@ -33,6 +33,7 @@ */ #} {{ attach_library('common_design_subtheme/rw-country') }} +{{ attach_library('common_design_subtheme/rw-river-letter-navigation') }} {% set classes = [ 'rw-river-page', @@ -54,6 +55,10 @@ {{ header }} {% endif %} + + {# @see html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-create-letter-navigation.js #} +
    + {% if exposed %}
    {{ exposed }} From cd4b49413b04e38c10f1b2445bc01b614aaca852 Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Fri, 22 Jul 2022 12:06:54 +0200 Subject: [PATCH 07/24] fix: re-style the Page Title for Operation listing Refs: RWR-156 --- ...lock.common_design_subtheme_page_title.yml | 8 ++- .../common_design_subtheme.libraries.yml | 6 ++ .../components/rw-river/rw-river-views.css | 55 ++++++++++++++++++ .../components/rw-river/rw-river.css | 58 +++++++++++++++++++ ...iew--operations--page-operations.html.twig | 7 +++ 5 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 html/themes/custom/common_design_subtheme/components/rw-river/rw-river-views.css create mode 100644 html/themes/custom/common_design_subtheme/components/rw-river/rw-river.css diff --git a/config/block.block.common_design_subtheme_page_title.yml b/config/block.block.common_design_subtheme_page_title.yml index 42307a9b..2debea30 100644 --- a/config/block.block.common_design_subtheme_page_title.yml +++ b/config/block.block.common_design_subtheme_page_title.yml @@ -2,6 +2,8 @@ uuid: 58a53cc2-0985-4abf-b29e-c079e46bbcda langcode: en status: true dependencies: + module: + - system theme: - common_design_subtheme _core: @@ -17,4 +19,8 @@ settings: label: 'Page title' label_display: '0' provider: core -visibility: { } +visibility: + request_path: + id: request_path + negate: true + pages: /operations diff --git a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml index 556706eb..d34c7153 100644 --- a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml +++ b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml @@ -160,6 +160,12 @@ rw-country: dependencies: - common_design_subtheme/rw-brand +rw-river: + css: + theme: + components/rw-river/rw-river.css: {} + components/rw-river/rw-river-views.css: {} + rw-river-letter-navigation: css: theme: diff --git a/html/themes/custom/common_design_subtheme/components/rw-river/rw-river-views.css b/html/themes/custom/common_design_subtheme/components/rw-river/rw-river-views.css new file mode 100644 index 00000000..30686ce6 --- /dev/null +++ b/html/themes/custom/common_design_subtheme/components/rw-river/rw-river-views.css @@ -0,0 +1,55 @@ +/* stylelint-disable max-line-length */ +/** + * RW River Views + * + * Taken directly from RW9. Any cusotmizations will appear in a separate file. + * + * @see https://raw.githubusercontent.com/UN-OCHA/rwint9-site/38e66da1b0fa4d6f316aaa7c961db859e2ef5d4b/html/themes/custom/common_design_subtheme/components/rw-river/rw-river-views.css + */ + +/* View selector */ +.rw-river-page .rw-river-views { + width: 100%; + /* margin: 8px 0; */ + padding: 0; + list-style: none; +} +.rw-river-page .rw-river-views ul { + margin: -12px; + padding: 0; + list-style: none; +} +.rw-river-page .rw-river-views li { + display: inline-block; + margin: 12px 16px; + vertical-align: bottom; +} +.rw-river-page .rw-river-views a { + position: relative; + display: inline-block; + padding-bottom: 3px; + text-decoration: none; + color: var(--cd-reliefweb-brand-grey--dark); + border-bottom: 3px solid transparent; + font-size: 18px; +} +.rw-river-page .rw-river-views a:hover, +.rw-river-page .rw-river-views a:focus, +.rw-river-page .rw-river-views a:active { + text-decoration: none; + border-color: var(--cd-reliefweb-brand-grey--light); +} +.rw-river-page .rw-river-views .rw-river-views__list__item--selected a { + border-color: var(--cd-reliefweb-brand-red--dark); + font-size: 22px; + font-weight: bold; +} + +@media screen and (min-width: 768px) { + .rw-river-page .rw-river-views a { + font-size: 20px; + } + .rw-river-page .rw-river-views .rw-river-views__list__item--selected a { + font-size: var(--cd-font-size--large); + } +} diff --git a/html/themes/custom/common_design_subtheme/components/rw-river/rw-river.css b/html/themes/custom/common_design_subtheme/components/rw-river/rw-river.css new file mode 100644 index 00000000..72b459de --- /dev/null +++ b/html/themes/custom/common_design_subtheme/components/rw-river/rw-river.css @@ -0,0 +1,58 @@ +/* stylelint-disable max-line-length */ +/** + * RW River + * + * Taken directly from RW9. Any cusotmizations will appear in a separate file. + * + * @see https://raw.githubusercontent.com/UN-OCHA/rwint9-site/38e66da1b0fa4d6f316aaa7c961db859e2ef5d4b/html/themes/custom/common_design_subtheme/components/rw-river/rw-river.css + */ + +/** + * Spacing between the sections on a river page. + * + */ +.rw-river-page .rw-river-search, +.rw-river-page .rw-river-letter-navigation-wrapper, +.rw-river-page .rw-river--disaster-map, +.rw-river-page section + section { + margin-top: 32px; +} +.rw-river-page .rw-river-search ~ .rw-river-letter-navigation-wrapper { + margin-top: 24px; +} + +/** + * 2 columns layout on tablet/desktop for rivers with advanced search. + */ +@media screen and (min-width: 768px) { + .rw-river-page--with-advanced-search .rw-advanced-search { + float: left; + width: 300px; + margin-bottom: 32px; + } + .rw-river-page--with-advanced-search .rw-river--river-list { + float: right; + width: calc(100% - 340px); + margin-bottom: 32px; + } + /* Clear the floating above. */ + .rw-river-page--with-advanced-search #list:after { + display: block; + clear: both; + content: ""; + } + + .rw-river--river-cards .rw-river__articles { + margin-right: -8px; + margin-left: -8px; + } +} + +@media screen and (min-width: 1024px) { + .rw-river-page--with-advanced-search .rw-advanced-search { + width: 320px; + } + .rw-river-page--with-advanced-search .rw-river--river-list { + width: calc(100% - 360px); + } +} diff --git a/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig b/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig index df53cb15..14b85215 100644 --- a/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig @@ -33,6 +33,7 @@ */ #} {{ attach_library('common_design_subtheme/rw-country') }} +{{ attach_library('common_design_subtheme/rw-river') }} {{ attach_library('common_design_subtheme/rw-river-letter-navigation') }} {% set classes = [ @@ -56,6 +57,12 @@
    {% endif %} +
    + +
    + {# @see html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-create-letter-navigation.js #}
    From 38a2d21a6ecfd6f1ab9d8624a8313a4672d674ca Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Fri, 22 Jul 2022 13:21:43 +0200 Subject: [PATCH 08/24] fix: Operations -> Locations Refs: RWR-156 --- ...block.common_design_subtheme_page_title.yml | 2 +- ...operations.yml => views.view.locations.yml} | 18 +++++++++--------- ...-view--locations--page-locations.html.twig} | 4 +++- 3 files changed, 13 insertions(+), 11 deletions(-) rename config/{views.view.operations.yml => views.view.locations.yml} (97%) rename html/themes/custom/common_design_subtheme/templates/{views-view--operations--page-operations.html.twig => views-view--locations--page-locations.html.twig} (95%) diff --git a/config/block.block.common_design_subtheme_page_title.yml b/config/block.block.common_design_subtheme_page_title.yml index 2debea30..8e789712 100644 --- a/config/block.block.common_design_subtheme_page_title.yml +++ b/config/block.block.common_design_subtheme_page_title.yml @@ -23,4 +23,4 @@ visibility: request_path: id: request_path negate: true - pages: /operations + pages: /locations diff --git a/config/views.view.operations.yml b/config/views.view.locations.yml similarity index 97% rename from config/views.view.operations.yml rename to config/views.view.locations.yml index 09c8953d..8a880924 100644 --- a/config/views.view.operations.yml +++ b/config/views.view.locations.yml @@ -1,4 +1,4 @@ -uuid: a51d6e0c-2d4d-4873-ba4c-f6b9007fdf60 +uuid: cb46f568-8171-4663-91a6-8b804543e885 langcode: en status: true dependencies: @@ -8,10 +8,10 @@ dependencies: - system.menu.main module: - group -id: operations -label: Operations +id: locations +label: Locations module: views -description: 'Overviews of all Operations' +description: 'Overview of all Operations' tag: '' base_table: groups_field_data base_field: id @@ -357,18 +357,18 @@ display: - 'languages:language_interface' tags: - 'config:field.storage.group.field_archive_group' - page_operations: - id: page_operations - display_title: Operations + page_locations: + id: page_locations + display_title: Locations display_plugin: page position: 1 display_options: display_description: '' display_extenders: { } - path: operations + path: locations menu: type: normal - title: Operations + title: Locations description: '' weight: 0 expanded: false diff --git a/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig b/html/themes/custom/common_design_subtheme/templates/views-view--locations--page-locations.html.twig similarity index 95% rename from html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig rename to html/themes/custom/common_design_subtheme/templates/views-view--locations--page-locations.html.twig index 14b85215..60df8790 100644 --- a/html/themes/custom/common_design_subtheme/templates/views-view--operations--page-operations.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/views-view--locations--page-locations.html.twig @@ -59,7 +59,9 @@ From fc183dcb2fb3677bff7d11643168279d3abd1033 Mon Sep 17 00:00:00 2001 From: "Peter Droogmans (attiks)" Date: Fri, 22 Jul 2022 14:53:49 +0200 Subject: [PATCH 09/24] feat: Notify team, email from config Refs: #RWR-175, #RWR-173 --- .../hr_paragraphs/hr_paragraphs.services.yml | 1 + .../EventSubscriber/SocialAuthSubscriber.php | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/html/modules/custom/hr_paragraphs/hr_paragraphs.services.yml b/html/modules/custom/hr_paragraphs/hr_paragraphs.services.yml index 6b7775c1..7ca44388 100644 --- a/html/modules/custom/hr_paragraphs/hr_paragraphs.services.yml +++ b/html/modules/custom/hr_paragraphs/hr_paragraphs.services.yml @@ -34,6 +34,7 @@ services: helper.event_subscriber: class: Drupal\hr_paragraphs\EventSubscriber\SocialAuthSubscriber arguments: + - '@config.factory' - '@plugin.manager.mail' tags: - { name: 'event_subscriber' } diff --git a/html/modules/custom/hr_paragraphs/src/EventSubscriber/SocialAuthSubscriber.php b/html/modules/custom/hr_paragraphs/src/EventSubscriber/SocialAuthSubscriber.php index dea2bbde..d0a631d6 100644 --- a/html/modules/custom/hr_paragraphs/src/EventSubscriber/SocialAuthSubscriber.php +++ b/html/modules/custom/hr_paragraphs/src/EventSubscriber/SocialAuthSubscriber.php @@ -2,6 +2,7 @@ namespace Drupal\hr_paragraphs\EventSubscriber; +use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Mail\MailManager; use Drupal\social_auth\Event\SocialAuthEvents; use Drupal\social_auth\Event\UserEvent; @@ -13,6 +14,13 @@ */ class SocialAuthSubscriber implements EventSubscriberInterface { + /** + * The config factory. + * + * @var \Drupal\Core\Config\ConfigFactoryInterface + */ + protected $configFactory; + /** * Mail manager. * @@ -23,10 +31,13 @@ class SocialAuthSubscriber implements EventSubscriberInterface { /** * SocialAuthSubscriber constructor. * + * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * Config. * @param \Drupal\Core\Mail\MailManager $mail_manager * The mail manager service. */ - public function __construct(MailManager $mail_manager) { + public function __construct(ConfigFactoryInterface $config_factory, MailManager $mail_manager) { + $this->configFactory = $config_factory; $this->mailManager = $mail_manager; } @@ -68,7 +79,10 @@ public function onUserCreated(UserEvent $event) { 'mail' => $event->getUser()->getInitialEmail(), ]; - $this->mailManager->mail('hr_paragraphs', 'user_created', 'info@humanitarianresponse.info', 'en', $params); + $to = $this->configFactory->get('hr_paragraphs.settings')->get('notification_email'); + if (!empty($to)) { + $this->mailManager->mail('hr_paragraphs', 'user_created', $to, 'en', $params); + } } } From c018a9127e0b351c5fb5bbb393cea72b10ad4464 Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Mon, 25 Jul 2022 09:20:06 +0200 Subject: [PATCH 10/24] fix: create Letter Navigation in Twig instead of JS Refs: RWR-156 --- .../common_design_subtheme.libraries.yml | 1 - .../rw-river-create-letter-navigation.js | 33 ---------------- .../rw-river-letter-navigation.css | 4 +- ...-view--locations--page-locations.html.twig | 38 ++++++++++++++++++- 4 files changed, 39 insertions(+), 37 deletions(-) delete mode 100644 html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-create-letter-navigation.js diff --git a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml index d34c7153..da709c67 100644 --- a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml +++ b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml @@ -171,5 +171,4 @@ rw-river-letter-navigation: theme: components/rw-river-letter-navigation/rw-river-letter-navigation.css: {} js: - components/rw-river-letter-navigation/rw-river-create-letter-navigation.js: {} components/rw-river-letter-navigation/rw-river-letter-navigation.js: {} diff --git a/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-create-letter-navigation.js b/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-create-letter-navigation.js deleted file mode 100644 index 5801064f..00000000 --- a/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-create-letter-navigation.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * RW River - Create the Letter Navigation - * - * We don't have the navigation in the HTML response so we build it client-side. - */ -(function () { - 'use strict'; - - var output = ''; - var navId = 'letter-navigation'; - var navIdTitle = navId + '-title'; - var navWrapper = document.querySelector('#rw-river-letter-navigation-wrapper'); - var navLetters = document.querySelectorAll('.rw-river-country-list__group__title'); - - output += ''; - - navWrapper.innerHTML = output; -})(); diff --git a/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.css b/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.css index d820efb3..8a41785e 100644 --- a/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.css +++ b/html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-letter-navigation.css @@ -15,7 +15,9 @@ .rw-river-letter-navigation h3:after { content: ":"; } -.rw-river-letter-navigation ul { +/* selector differs from original to overcome equal strength rule which should + apply to the content of this page, but not the navigation */ +.rw-river-letter-navigation ul.rw-river-letter-navigation__list { display: inline-block; display: grid; grid-template-columns: repeat(auto-fit, minmax(40px, min-content)); diff --git a/html/themes/custom/common_design_subtheme/templates/views-view--locations--page-locations.html.twig b/html/themes/custom/common_design_subtheme/templates/views-view--locations--page-locations.html.twig index 60df8790..478b3936 100644 --- a/html/themes/custom/common_design_subtheme/templates/views-view--locations--page-locations.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/views-view--locations--page-locations.html.twig @@ -65,8 +65,42 @@ - {# @see html/themes/custom/common_design_subtheme/components/rw-river-letter-navigation/rw-river-create-letter-navigation.js #} -
    +
    + {% set id = 'letter-navigation' %} + + Jump to letter + +
      + {% for row in rows %} +
    • {{ row['#title']|render|striptags|trim }}
    • + {% endfor %} +
    • {{ 'All'|t }}
    • +
    + + +
    {% if exposed %}
    From eeee0686211c837844e14aaddd66c011ba1de6b4 Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Mon, 25 Jul 2022 11:15:12 +0200 Subject: [PATCH 11/24] fix: use RW download icon for River files Refs: RWR-142 --- .../components/hri-river/hri-river.css | 12 ++++++++++-- .../templates/river-row.html.twig | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css b/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css index d3ac66c0..767cfbea 100644 --- a/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css +++ b/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css @@ -164,8 +164,16 @@ } /* files buttons */ -.hri-river__result .cd-button--small .cd-icon { - margin: 0; +.hri-river__file { + text-decoration: none; +} +.hri-river__file-icon { + display: inline-block; + width: 12px; + height: 12px; + background: transparent url("rw-icons-sprite.svg") -72px -60px no-repeat; + position: relative; + top: 1px; } /** diff --git a/html/themes/custom/common_design_subtheme/templates/river-row.html.twig b/html/themes/custom/common_design_subtheme/templates/river-row.html.twig index 1772c510..5d21b3ca 100644 --- a/html/themes/custom/common_design_subtheme/templates/river-row.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/river-row.html.twig @@ -55,9 +55,9 @@
    {{ 'Files'|t }}:
    {% for file in row.files|slice(0,1) %} - + {{ 'Download'|t }} - + {% endfor %} {% if row.files|length > 1 %} From 61d71332bec3f55f9f00e62b08d38e24bca57c0e Mon Sep 17 00:00:00 2001 From: Andy Footner Date: Mon, 25 Jul 2022 13:31:52 +0200 Subject: [PATCH 12/24] chore: remove seckit and install csp module Refs: OPS-8232 --- composer.json | 2 +- composer.lock | 115 +++++++++++++++++-------------------- config/core.extension.yml | 2 +- config/csp.settings.yml | 55 ++++++++++++++++++ config/seckit.settings.yml | 56 ------------------ 5 files changed, 109 insertions(+), 121 deletions(-) create mode 100644 config/csp.settings.yml delete mode 100644 config/seckit.settings.yml diff --git a/composer.json b/composer.json index c5f82c79..66fdb079 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,7 @@ "drupal/core-composer-scaffold": "^9", "drupal/core-project-message": "^9", "drupal/core-recommended": "^9", + "drupal/csp": "^1.16", "drupal/date_recur": "^3.2", "drupal/external_entities": "^2.0@alpha", "drupal/field_group": "^3.2", @@ -56,7 +57,6 @@ "drupal/override_node_options": "^2.6", "drupal/paragraphs_asymmetric_translation_widgets": "^1.0@beta", "drupal/pathauto": "^1.8", - "drupal/seckit": "^2.0", "drupal/select2": "^1.13", "drupal/social_auth_hid": "^3.0", "drupal/subgroup": "^1.0", diff --git a/composer.lock b/composer.lock index d43f1155..e28e1d66 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1e69702d9f88c495c73a981733f50e6e", + "content-hash": "5cf3a3faef2f01158d8f3e271b1e5c77", "packages": [ { "name": "asm89/stack-cors", @@ -2019,6 +2019,56 @@ }, "time": "2022-06-15T16:34:03+00:00" }, + { + "name": "drupal/csp", + "version": "1.16.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/csp.git", + "reference": "8.x-1.16" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/csp-8.x-1.16.zip", + "reference": "8.x-1.16", + "shasum": "0d6568ff2b176497ff97a440bfae6b7135ad2d6b" + }, + "require": { + "drupal/core": "^8.5 || ^9.0", + "ext-json": "*", + "php": ">=7.2" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-1.16", + "datestamp": "1641415148", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "gapple", + "homepage": "https://www.drupal.org/user/490940" + } + ], + "description": "Provide Content-Security-Policy headers", + "homepage": "https://www.drupal.org/project/csp", + "keywords": [ + "Drupal" + ], + "support": { + "source": "https://git.drupalcode.org/project/csp", + "issues": "https://www.drupal.org/project/issues/csp" + } + }, { "name": "drupal/ctools", "version": "3.7.0", @@ -3723,67 +3773,6 @@ "documentation": "https://www.drupal.org/docs/8/modules/pathauto" } }, - { - "name": "drupal/seckit", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://git.drupalcode.org/project/seckit.git", - "reference": "2.0.0" - }, - "dist": { - "type": "zip", - "url": "https://ftp.drupal.org/files/projects/seckit-2.0.0.zip", - "reference": "2.0.0", - "shasum": "d5356230b2de7d1e8a2e68eb81e70619a2e36c1e" - }, - "require": { - "drupal/core": "^8.8 || ^9" - }, - "type": "drupal-module", - "extra": { - "drupal": { - "version": "2.0.0", - "datestamp": "1598609351", - "security-coverage": { - "status": "covered", - "message": "Covered by Drupal's security advisory policy" - } - } - }, - "notification-url": "https://packages.drupal.org/8/downloads", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "badjava", - "homepage": "https://www.drupal.org/user/83372" - }, - { - "name": "jweowu", - "homepage": "https://www.drupal.org/user/152788" - }, - { - "name": "mcdruid", - "homepage": "https://www.drupal.org/user/255969" - }, - { - "name": "p0deje", - "homepage": "https://www.drupal.org/user/529960" - } - ], - "description": "SecKit provides Drupal with various security-hardening options.", - "homepage": "https://www.drupal.org/project/seckit", - "keywords": [ - "Drupal", - "security" - ], - "support": { - "source": "http://cgit.drupalcode.org/seckit", - "issues": "http://drupal.org/project/issues/seckit" - } - }, { "name": "drupal/select2", "version": "1.13.0", @@ -15869,5 +15858,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } diff --git a/config/core.extension.yml b/config/core.extension.yml index c2c1bc01..6c5c981d 100644 --- a/config/core.extension.yml +++ b/config/core.extension.yml @@ -10,6 +10,7 @@ module: components: 0 config: 0 contextual: 0 + csp: 0 ctools: 0 date_recur: 0 datetime: 0 @@ -61,7 +62,6 @@ module: path: 0 path_alias: 0 rdf: 0 - seckit: 0 select2: 0 shortcut: 0 social_api: 0 diff --git a/config/csp.settings.yml b/config/csp.settings.yml new file mode 100644 index 00000000..f5d428a9 --- /dev/null +++ b/config/csp.settings.yml @@ -0,0 +1,55 @@ +_core: + default_config_hash: yOPH6uEZYRHbg2OFP-bze0jGr06fI-Gr_66W-vA8Faw +report-only: + enable: true + directives: + connect-src: + base: self + sources: + - '*.google-analytics.com' + - '*.doubleclick.net' + - '*.analytics.google.com' + font-src: + base: self + sources: + - fonts.gstatic.com + img-src: + base: self + sources: + - 'data:' + - '*.google-analytics.com' + - reliefweb.int + object-src: + base: none + script-src: + base: self + sources: + - fonts.googleapis.com + - '*.gstatic.com' + - '*.google.com' + - '*.google-analytics.com' + - cdn.jsdelivr.net + - googletagmanager.com + script-src-attr: + base: self + script-src-elem: + base: self + style-src: + base: self + style-src-attr: + base: self + style-src-elem: + base: self + frame-ancestors: + base: self + reporting: + plugin: sitelog +enforce: + enable: true + directives: + object-src: + base: none + frame-ancestors: + base: self + reporting: + plugin: sitelog diff --git a/config/seckit.settings.yml b/config/seckit.settings.yml deleted file mode 100644 index 6b59b0f2..00000000 --- a/config/seckit.settings.yml +++ /dev/null @@ -1,56 +0,0 @@ -_core: - default_config_hash: x6bhN6WZwfVUI_LLMvRJIUW_2c26VTaBozbfXmJWmro -seckit_xss: - csp: - checkbox: true - vendor-prefix: - x: false - webkit: false - report-only: true - default-src: '' - script-src: '''self'' ''unsafe-inline'' https://fonts.googleapis.com https://www.gstatic.com https://www.google.com https://www.google-analytics.com https://cdn.jsdelivr.net' - object-src: '' - style-src: '' - img-src: '''self''' - media-src: '' - frame-src: '' - frame-ancestors: '' - child-src: '' - font-src: 'https://fonts.gstatic.com' - connect-src: '''self'' https://www.google-analytics.com https://stats.g.doubleclick.net' - report-uri: /report-csp-violation - upgrade-req: false - policy-uri: '' - x_xss: - seckit_x_xss_option_disable: Disabled - seckit_x_xss_option_0: '0' - seckit_x_xss_option_1: 1; - seckit_x_xss_option_1_block: '1; mode=block' - select: 0 -seckit_csrf: - origin: false - origin_whitelist: 'https://fonts.gstatic.com ' -seckit_clickjacking: - js_css_noscript: false - noscript_message: 'Sorry, you need to enable JavaScript to visit this website.' - x_frame: '1' - x_frame_allow_from: '' -seckit_ssl: - hsts: false - hsts_subdomains: false - hsts_max_age: 1000 - hsts_preload: false -seckit_ct: - expect_ct: false - max_age: 86400 - report_uri: '' - enforce: false -seckit_fp: - feature_policy: false - feature_policy_policy: '' -seckit_various: - from_origin: false - from_origin_destination: same - referrer_policy: false - referrer_policy_policy: no-referrer-when-downgrade - disable_autocomplete: false From 9e99bc8f4af32225790f47a13ffd534e6905285b Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Mon, 25 Jul 2022 13:50:10 +0200 Subject: [PATCH 13/24] fix: add external link icon to all River titles Refs: RWR-142 --- .../components/hri-river/hri-river.css | 10 ++++++++++ .../templates/river-row.html.twig | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css b/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css index 767cfbea..b41e9bf7 100644 --- a/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css +++ b/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css @@ -168,12 +168,22 @@ text-decoration: none; } .hri-river__file-icon { + position: relative; + top: 1px; display: inline-block; width: 12px; height: 12px; background: transparent url("rw-icons-sprite.svg") -72px -60px no-repeat; +} + +/* external URL symbols */ +.hri-river__external-url { position: relative; top: 1px; + display: inline-block; + width: 12px; + height: 12px; + background: transparent url("rw-icons-sprite.svg") -84px -108px no-repeat; } /** diff --git a/html/themes/custom/common_design_subtheme/templates/river-row.html.twig b/html/themes/custom/common_design_subtheme/templates/river-row.html.twig index 5d21b3ca..556008a4 100644 --- a/html/themes/custom/common_design_subtheme/templates/river-row.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/river-row.html.twig @@ -15,7 +15,10 @@ + {{ row.countries|slice(1)|length }} more {% endif %}

    -

    {{ row.title }}

    +

    + {{ row.title }} + +

    From 1642e52eceeacfe193da1fc4570a5fe6a722f841 Mon Sep 17 00:00:00 2001 From: Andy Footner Date: Mon, 25 Jul 2022 14:44:25 +0200 Subject: [PATCH 14/24] fix: include patch for better logging Refs: OPS-8232 --- PATCHES/csp-log-format.patch | 18 ++++++++++++++++++ composer.patches.json | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 PATCHES/csp-log-format.patch diff --git a/PATCHES/csp-log-format.patch b/PATCHES/csp-log-format.patch new file mode 100644 index 00000000..470e2f41 --- /dev/null +++ b/PATCHES/csp-log-format.patch @@ -0,0 +1,18 @@ +diff --git a/src/Controller/ReportUri.php b/src/Controller/ReportUri.php +index d7229fa..744a40a 100644 +--- a/src/Controller/ReportUri.php ++++ b/src/Controller/ReportUri.php +@@ -87,9 +87,11 @@ public function log($type) { + } + + $this->logger +- ->info("@type
    \n
    @data
    ", [ ++ ->info("(@type) - Unmatched @directive: @blocked on page @page", [ + '@type' => $type, +- '@data' => json_encode($report, JSON_PRETTY_PRINT), ++ '@directive' => $report->{'csp-report'}->{'violated-directive'}, ++ '@blocked' => $report->{'csp-report'}->{'blocked-uri'}, ++ '@page' => $report->{'csp-report'}->{'document-uri'}, + ]); + + // 202: Accepted. diff --git a/composer.patches.json b/composer.patches.json index 75bae83f..4055fa5d 100644 --- a/composer.patches.json +++ b/composer.patches.json @@ -4,6 +4,9 @@ "https://www.drupal.org/project/drupal/issues/2544110": "https://www.drupal.org/files/issues/2021-02-11/2544110-100.patch", "Include database SSL/TLS info on status report": "./PATCHES/mysql-ssl-status.patch" }, + "drupal/csp": { + "Simplify log format": "PATCHES/csp-log-format.patch" + }, "drupal/layout_paragraphs" : { "Async translation - https://www.drupal.org/project/layout_paragraphs/issues/3178277": "./PATCHES/3178277-6.patch" }, From 9fd436630bc5273ea7d69447ca5ac24436008b31 Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Tue, 26 Jul 2022 10:38:10 +0200 Subject: [PATCH 15/24] fix: allow RW brand colors to be used globally Refs: RWR-177 --- .../common_design_subtheme.libraries.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml index d34c7153..1004010f 100644 --- a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml +++ b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml @@ -5,6 +5,7 @@ global-styling: js: js/login_destination.js: {} dependencies: + - common_design_subtheme/rw-brand - common_design_subtheme/hri-breadcrumbs - common_design_subtheme/hri-cd-header - common_design_subtheme/hri-global-styling @@ -165,6 +166,8 @@ rw-river: theme: components/rw-river/rw-river.css: {} components/rw-river/rw-river-views.css: {} + dependencies: + - common_design_subtheme/rw-brand rw-river-letter-navigation: css: @@ -173,3 +176,5 @@ rw-river-letter-navigation: js: components/rw-river-letter-navigation/rw-river-create-letter-navigation.js: {} components/rw-river-letter-navigation/rw-river-letter-navigation.js: {} + dependencies: + - common_design_subtheme/rw-brand From e5421283336aa09498bb7d9197a69025bc6d195f Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Tue, 26 Jul 2022 10:38:40 +0200 Subject: [PATCH 16/24] fix: match RW OCHA Services branding Refs: RWR-177 --- .../components/hri-button/hri-button.css | 16 +++++----------- .../custom/common_design_subtheme/css/brand.css | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/html/themes/custom/common_design_subtheme/components/hri-button/hri-button.css b/html/themes/custom/common_design_subtheme/components/hri-button/hri-button.css index a22ef277..547569ae 100644 --- a/html/themes/custom/common_design_subtheme/components/hri-button/hri-button.css +++ b/html/themes/custom/common_design_subtheme/components/hri-button/hri-button.css @@ -9,19 +9,13 @@ } .cd-button--light { - color: var(--cd-white); - background-color: var(--brand-secondary); -} -.cd-button--light:hover { - color: var(--cd-white); - background-color: var(--brand-secondary); - background-image: linear-gradient(rgba(255, 255, 255, 0.0625), rgba(255, 255, 255, 0.0625)); + color: var(--cd-primary-color--dark); + background-color: var(--cd-primary-color--lighter); } +.cd-button--light:hover, .cd-button--light:focus { - color: var(--cd-white); - border-color: black; - background-color: var(--brand-secondary); - background-image: linear-gradient(rgba(255, 255, 255, 0.0625), rgba(255, 255, 255, 0.0625)); + color: var(--cd-primary-color--dark); + background-color: var(--cd-primary-color--light); } .cd-button--icon.cd-button--small.cd-button--icon-no-margin span + svg { diff --git a/html/themes/custom/common_design_subtheme/css/brand.css b/html/themes/custom/common_design_subtheme/css/brand.css index 7d8ec0d3..9b2c8811 100644 --- a/html/themes/custom/common_design_subtheme/css/brand.css +++ b/html/themes/custom/common_design_subtheme/css/brand.css @@ -15,4 +15,18 @@ --brand-light: #d4e5f7; --brand-grey: var(--cd-blue-grey); --brand-logo-width: 150px; + + --cd-ie-primary-color: #0988bb; + --cd-ie-primary-color--light: #63cef8; + --cd-ie-primary-color--dark: #032b3a; + --cd-ie-primary-color--lighter: #8fdbfa; + --cd-ie-highlight-red: #f65c51; + --cd-ie-highlight-red--light: #f88981; + --cd-primary-color-h: 197; + --cd-primary-color-s: 91%; + --cd-primary-color-l: 38%; + --cd-primary-color: hsl(var(--cd-primary-color-h),var(--cd-primary-color-s),var(--cd-primary-color-l)); + --cd-primary-color--light: hsl(var(--cd-primary-color-h),var(--cd-primary-color-s),calc(var(--cd-primary-color-l) + 30%)); + --cd-primary-color--dark: hsl(var(--cd-primary-color-h),var(--cd-primary-color-s),calc(var(--cd-primary-color-l) - 26%)); + --cd-primary-color--lighter: hsl(var(--cd-primary-color-h),var(--cd-primary-color-s),calc(var(--cd-primary-color-l) + 39%)); } From 3b866f78bdcf663c83f59e7672b5ff86c59ca2bc Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Tue, 26 Jul 2022 10:56:13 +0200 Subject: [PATCH 17/24] fix: use RW --brand-highlight Refs: RWR-177 --- html/themes/custom/common_design_subtheme/css/brand.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/themes/custom/common_design_subtheme/css/brand.css b/html/themes/custom/common_design_subtheme/css/brand.css index 9b2c8811..6a58e24f 100644 --- a/html/themes/custom/common_design_subtheme/css/brand.css +++ b/html/themes/custom/common_design_subtheme/css/brand.css @@ -11,7 +11,7 @@ --brand-primary--dark: #04415a; --brand-secondary: #f65c51; --brand-secondary--dark: #eb1405; - --brand-highlight: var(--cd-blue--bright); + --brand-highlight: var(--cd-reliefweb-brand-red--dark); --brand-light: #d4e5f7; --brand-grey: var(--cd-blue-grey); --brand-logo-width: 150px; From 250bff7a844bb3ccc8393c693579947d274d95df Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Tue, 26 Jul 2022 10:57:22 +0200 Subject: [PATCH 18/24] fix: add title attribute to all iframe embeds Refs: RWR-177 --- .../templates/hr-paragraphs-iframe.html.twig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/html/themes/custom/common_design_subtheme/templates/hr-paragraphs-iframe.html.twig b/html/themes/custom/common_design_subtheme/templates/hr-paragraphs-iframe.html.twig index 1edf2d64..b334cee0 100644 --- a/html/themes/custom/common_design_subtheme/templates/hr-paragraphs-iframe.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/hr-paragraphs-iframe.html.twig @@ -13,7 +13,7 @@ 'hri-iframe--' ~ ratio, ] %} -
    +
    From 4952c61498596aec8f1b24e55671645db7ca984b Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Tue, 26 Jul 2022 11:14:24 +0200 Subject: [PATCH 19/24] fix: link to the correct... Location Refs: RWR-156 --- .../templates/views-view--locations--page-locations.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/themes/custom/common_design_subtheme/templates/views-view--locations--page-locations.html.twig b/html/themes/custom/common_design_subtheme/templates/views-view--locations--page-locations.html.twig index 60df8790..137f0909 100644 --- a/html/themes/custom/common_design_subtheme/templates/views-view--locations--page-locations.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/views-view--locations--page-locations.html.twig @@ -60,7 +60,7 @@ From 146510e9984f2cfdfb7ea8f620dd299cbaa9863b Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Tue, 26 Jul 2022 11:17:50 +0200 Subject: [PATCH 20/24] fix: ensure every Locations entry is inside its own
  • Refs: RWR-156 --- .../templates/views-view-grid.html.twig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig b/html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig index 08ce18ce..6dd260a8 100644 --- a/html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/views-view-grid.html.twig @@ -70,11 +70,11 @@ {% else %}
      {% for column in items %} - - {% for row in column.content %} + {% for row in column.content %} + {{- row.content -}} - {% endfor %} - + + {% endfor %} {% endfor %}
    {% endif %} From 2da292ad8585963d7a5437774d475ecc3881dcb4 Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Wed, 27 Jul 2022 09:02:55 +0200 Subject: [PATCH 21/24] fix: correct title for Locations page Refs: RWR-156 --- config/views.view.locations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/views.view.locations.yml b/config/views.view.locations.yml index 8a880924..616fdf82 100644 --- a/config/views.view.locations.yml +++ b/config/views.view.locations.yml @@ -22,7 +22,7 @@ display: display_plugin: default position: 0 display_options: - title: Operations + title: Locations fields: label_1: id: label_1 From 8551f8e1ee1335427f21f3cfac89832b2c7491aa Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Wed, 27 Jul 2022 09:12:35 +0200 Subject: [PATCH 22/24] fix: display external-url icon on RSS links too Refs: RWR-142 --- .../hri-global-styling/hri-global-styling.css | 12 ++++++++++++ .../templates/hr-paragraphs-rss-feed.html.twig | 1 + .../templates/river-row.html.twig | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/html/themes/custom/common_design_subtheme/components/hri-global-styling/hri-global-styling.css b/html/themes/custom/common_design_subtheme/components/hri-global-styling/hri-global-styling.css index 1d93c8de..5ce47e12 100644 --- a/html/themes/custom/common_design_subtheme/components/hri-global-styling/hri-global-styling.css +++ b/html/themes/custom/common_design_subtheme/components/hri-global-styling/hri-global-styling.css @@ -24,3 +24,15 @@ .node--unpublished { background: #fdd; } + +/** + * External URLs + */ +.hri__external-url { + position: relative; + top: 1px; + display: inline-block; + width: 12px; + height: 12px; + background: transparent url("../hri-river/rw-icons-sprite.svg") -84px -108px no-repeat; +} diff --git a/html/themes/custom/common_design_subtheme/templates/hr-paragraphs-rss-feed.html.twig b/html/themes/custom/common_design_subtheme/templates/hr-paragraphs-rss-feed.html.twig index 598bcead..82356839 100644 --- a/html/themes/custom/common_design_subtheme/templates/hr-paragraphs-rss-feed.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/hr-paragraphs-rss-feed.html.twig @@ -10,6 +10,7 @@

    {% if options.display_date %}{{ item.date|date('d-M-Y') }} - {% endif %} {{ item.title }} +

  • diff --git a/html/themes/custom/common_design_subtheme/templates/river-row.html.twig b/html/themes/custom/common_design_subtheme/templates/river-row.html.twig index 556008a4..94794f01 100644 --- a/html/themes/custom/common_design_subtheme/templates/river-row.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/river-row.html.twig @@ -17,7 +17,7 @@

    {{ row.title }} - +

    From 544ab9a67c67d6a120e362dbd048df4df9b0030a Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Wed, 27 Jul 2022 10:10:11 +0200 Subject: [PATCH 23/24] fix: move RW Icons to a global dependency --- .../common_design_subtheme.libraries.yml | 1 + .../components/hri-global-styling/hri-global-styling.css | 2 +- .../components/hri-river/hri-river.css | 6 +++--- .../components/{hri-river => rw-brand}/rw-icons-sprite.svg | 0 4 files changed, 5 insertions(+), 4 deletions(-) rename html/themes/custom/common_design_subtheme/components/{hri-river => rw-brand}/rw-icons-sprite.svg (100%) diff --git a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml index bf17b8f9..2293d060 100644 --- a/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml +++ b/html/themes/custom/common_design_subtheme/common_design_subtheme.libraries.yml @@ -119,6 +119,7 @@ hri-river: theme: components/hri-river/hri-river.css: {} dependencies: + - common_design_subtheme/rw-brand - common_design/cd-button - common_design_subtheme/hri-powered-by diff --git a/html/themes/custom/common_design_subtheme/components/hri-global-styling/hri-global-styling.css b/html/themes/custom/common_design_subtheme/components/hri-global-styling/hri-global-styling.css index 5ce47e12..64cbf036 100644 --- a/html/themes/custom/common_design_subtheme/components/hri-global-styling/hri-global-styling.css +++ b/html/themes/custom/common_design_subtheme/components/hri-global-styling/hri-global-styling.css @@ -34,5 +34,5 @@ display: inline-block; width: 12px; height: 12px; - background: transparent url("../hri-river/rw-icons-sprite.svg") -84px -108px no-repeat; + background: transparent url("../rw-brand/rw-icons-sprite.svg") -84px -108px no-repeat; } diff --git a/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css b/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css index b41e9bf7..0980fb93 100644 --- a/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css +++ b/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css @@ -147,7 +147,7 @@ margin: -2px 6px 0 0; content: ""; vertical-align: middle; - background: rgba(0, 0, 0, 0) url("rw-icons-sprite.svg") -328px -32px no-repeat; + background: rgba(0, 0, 0, 0) url("../rw-brand/rw-icons-sprite.svg") -328px -32px no-repeat; } .hri-river__result .meta dd.format.map::before { @@ -173,7 +173,7 @@ display: inline-block; width: 12px; height: 12px; - background: transparent url("rw-icons-sprite.svg") -72px -60px no-repeat; + background: transparent url("../rw-brand/rw-icons-sprite.svg") -72px -60px no-repeat; } /* external URL symbols */ @@ -183,7 +183,7 @@ display: inline-block; width: 12px; height: 12px; - background: transparent url("rw-icons-sprite.svg") -84px -108px no-repeat; + background: transparent url("../rw-brand/rw-icons-sprite.svg") -84px -108px no-repeat; } /** diff --git a/html/themes/custom/common_design_subtheme/components/hri-river/rw-icons-sprite.svg b/html/themes/custom/common_design_subtheme/components/rw-brand/rw-icons-sprite.svg similarity index 100% rename from html/themes/custom/common_design_subtheme/components/hri-river/rw-icons-sprite.svg rename to html/themes/custom/common_design_subtheme/components/rw-brand/rw-icons-sprite.svg From b812a7221d1f3c78a0fbc61c2b58893fd6dd6ed1 Mon Sep 17 00:00:00 2001 From: Chris Ruppel Date: Wed, 27 Jul 2022 10:50:15 +0200 Subject: [PATCH 24/24] fix: white icon on standard CD Button for River files Refs: RWR-142 --- .../common_design_subtheme/components/hri-river/hri-river.css | 2 +- .../common_design_subtheme/templates/river-row.html.twig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css b/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css index 0980fb93..425c788d 100644 --- a/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css +++ b/html/themes/custom/common_design_subtheme/components/hri-river/hri-river.css @@ -173,7 +173,7 @@ display: inline-block; width: 12px; height: 12px; - background: transparent url("../rw-brand/rw-icons-sprite.svg") -72px -60px no-repeat; + background: transparent url("../rw-brand/rw-icons-sprite.svg") -108px -60px no-repeat; } /* external URL symbols */ diff --git a/html/themes/custom/common_design_subtheme/templates/river-row.html.twig b/html/themes/custom/common_design_subtheme/templates/river-row.html.twig index 94794f01..57828676 100644 --- a/html/themes/custom/common_design_subtheme/templates/river-row.html.twig +++ b/html/themes/custom/common_design_subtheme/templates/river-row.html.twig @@ -58,9 +58,9 @@
    {{ 'Files'|t }}:
    {% for file in row.files|slice(0,1) %} - + {{ 'Download'|t }} - + {% endfor %} {% if row.files|length > 1 %}