diff --git a/config/sync/core.entity_form_display.node.authors.default.yml b/config/sync/core.entity_form_display.node.authors.default.yml index 935a3b3c..b9b35f5c 100644 --- a/config/sync/core.entity_form_display.node.authors.default.yml +++ b/config/sync/core.entity_form_display.node.authors.default.yml @@ -40,7 +40,7 @@ third_party_settings: label: 'Social Media' region: content parent_name: '' - weight: 20 + weight: 19 format_type: details format_settings: classes: '' @@ -73,7 +73,7 @@ content: third_party_settings: { } field_agency_acronym: type: string_textfield - weight: 15 + weight: 14 region: content settings: size: 60 @@ -81,7 +81,7 @@ content: third_party_settings: { } field_agency_full_name: type: string_textfield - weight: 14 + weight: 13 region: content settings: size: 60 @@ -89,7 +89,7 @@ content: third_party_settings: { } field_bio: type: text_textfield - weight: 17 + weight: 16 region: content settings: size: 60 @@ -97,7 +97,7 @@ content: third_party_settings: { } field_bio_url: type: link_default - weight: 18 + weight: 17 region: content settings: placeholder_url: '' @@ -105,7 +105,7 @@ content: third_party_settings: { } field_email: type: email_default - weight: 12 + weight: 11 region: content settings: placeholder: '' @@ -121,7 +121,7 @@ content: third_party_settings: { } field_first_name: type: text_textfield - weight: 9 + weight: 8 region: content settings: size: 60 @@ -145,7 +145,7 @@ content: third_party_settings: { } field_last_name: type: text_textfield - weight: 10 + weight: 9 region: content settings: size: 60 @@ -161,7 +161,7 @@ content: third_party_settings: { } field_location: type: string_textfield - weight: 16 + weight: 15 region: content settings: size: 60 @@ -169,7 +169,15 @@ content: third_party_settings: { } field_pronouns: type: string_textfield - weight: 11 + weight: 10 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + field_slug: + type: string_textfield + weight: 18 region: content settings: size: 60 @@ -177,7 +185,7 @@ content: third_party_settings: { } field_summary: type: text_textfield - weight: 13 + weight: 12 region: content settings: size: 60 @@ -256,7 +264,6 @@ content: settings: { } third_party_settings: { } hidden: - field_slug: true publish_on: true publish_state: true unpublish_on: true diff --git a/config/sync/core.entity_form_display.node.guides.default.yml b/config/sync/core.entity_form_display.node.guides.default.yml index 35120432..5df7254e 100644 --- a/config/sync/core.entity_form_display.node.guides.default.yml +++ b/config/sync/core.entity_form_display.node.guides.default.yml @@ -7,16 +7,19 @@ dependencies: - field.field.node.guides.field_deck - field.field.node.guides.field_featured_image - field.field.node.guides.field_guide_weight + - field.field.node.guides.field_kicker - field.field.node.guides.field_page_weight - field.field.node.guides.field_primary_image - field.field.node.guides.field_summary - field.field.node.guides.field_summary_box - field.field.node.guides.field_topics - node.type.guides + - workflows.workflow.editorial module: - content_moderation - inline_entity_form - media_library + - path - text id: node.guides.default targetEntityType: node @@ -61,6 +64,14 @@ content: settings: placeholder: '' third_party_settings: { } + field_kicker: + type: string_textfield + weight: 1 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } field_page_weight: type: number weight: 9 diff --git a/config/sync/core.entity_form_display.node.landing_page.default.yml b/config/sync/core.entity_form_display.node.landing_page.default.yml index 602ec2b1..8e661b1c 100644 --- a/config/sync/core.entity_form_display.node.landing_page.default.yml +++ b/config/sync/core.entity_form_display.node.landing_page.default.yml @@ -5,11 +5,15 @@ dependencies: config: - field.field.node.landing_page.body - field.field.node.landing_page.field_buttons + - field.field.node.landing_page.field_deck + - field.field.node.landing_page.field_landing_page_type - field.field.node.landing_page.field_summary - node.type.landing_page + - workflows.workflow.editorial module: - content_moderation - link + - path - text id: node.landing_page.default targetEntityType: node @@ -18,7 +22,7 @@ mode: default content: body: type: text_textarea_with_summary - weight: 3 + weight: 4 region: content settings: rows: 9 @@ -28,18 +32,32 @@ content: third_party_settings: { } created: type: datetime_timestamp - weight: 5 + weight: 6 region: content settings: { } third_party_settings: { } field_buttons: type: link_default - weight: 2 + weight: 3 region: content settings: placeholder_url: '' placeholder_title: '' third_party_settings: { } + field_deck: + type: text_textfield + weight: 1 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + field_landing_page_type: + type: options_select + weight: 2 + region: content + settings: { } + third_party_settings: { } field_summary: type: text_textfield weight: 1 @@ -50,19 +68,19 @@ content: third_party_settings: { } moderation_state: type: moderation_state_default - weight: 6 + weight: 7 region: content settings: { } third_party_settings: { } path: type: path - weight: 30 + weight: 9 region: content settings: { } third_party_settings: { } status: type: boolean_checkbox - weight: 7 + weight: 8 region: content settings: display_label: true @@ -77,7 +95,7 @@ content: third_party_settings: { } uid: type: entity_reference_autocomplete - weight: 4 + weight: 5 region: content settings: match_operator: CONTAINS diff --git a/config/sync/core.entity_form_display.node.news.default.yml b/config/sync/core.entity_form_display.node.news.default.yml index 2a6bffcb..752a1ff9 100644 --- a/config/sync/core.entity_form_display.node.news.default.yml +++ b/config/sync/core.entity_form_display.node.news.default.yml @@ -95,6 +95,14 @@ content: settings: media_types: { } third_party_settings: { } + field_slug: + type: string_textfield + weight: 14 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } field_summary: type: text_textfield weight: 3 @@ -172,7 +180,6 @@ content: settings: { } third_party_settings: { } hidden: - field_slug: true promote: true publish_on: true publish_state: true diff --git a/config/sync/core.entity_form_display.node.topics.default.yml b/config/sync/core.entity_form_display.node.topics.default.yml index f9315f00..b5db27fe 100644 --- a/config/sync/core.entity_form_display.node.topics.default.yml +++ b/config/sync/core.entity_form_display.node.topics.default.yml @@ -70,7 +70,7 @@ content: third_party_settings: { } field_featured_links: type: paragraphs - weight: 28 + weight: 13 region: content settings: title: Paragraph @@ -90,7 +90,7 @@ content: third_party_settings: { } field_featured_resources: type: paragraphs - weight: 26 + weight: 12 region: content settings: title: Paragraph @@ -130,6 +130,14 @@ content: settings: media_types: { } third_party_settings: { } + field_slug: + type: string_textfield + weight: 14 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } field_summary: type: text_textfield weight: 2 @@ -189,7 +197,6 @@ content: settings: { } third_party_settings: { } hidden: - field_slug: true promote: true publish_on: true publish_state: true diff --git a/config/sync/core.entity_view_display.node.guides.default.yml b/config/sync/core.entity_view_display.node.guides.default.yml index 0d89eac5..073c2e67 100644 --- a/config/sync/core.entity_view_display.node.guides.default.yml +++ b/config/sync/core.entity_view_display.node.guides.default.yml @@ -7,6 +7,7 @@ dependencies: - field.field.node.guides.field_deck - field.field.node.guides.field_featured_image - field.field.node.guides.field_guide_weight + - field.field.node.guides.field_kicker - field.field.node.guides.field_page_weight - field.field.node.guides.field_primary_image - field.field.node.guides.field_summary @@ -28,6 +29,11 @@ content: third_party_settings: { } weight: 101 region: content + content_moderation_control: + settings: { } + third_party_settings: { } + weight: -20 + region: content field_deck: type: text_default label: above @@ -53,6 +59,14 @@ content: third_party_settings: { } weight: 127 region: content + field_kicker: + type: string + label: above + settings: + link_to_entity: false + third_party_settings: { } + weight: 116 + region: content field_page_weight: type: number_integer label: above diff --git a/config/sync/core.entity_view_display.node.guides.teaser.yml b/config/sync/core.entity_view_display.node.guides.teaser.yml index 18882c32..c8354e34 100644 --- a/config/sync/core.entity_view_display.node.guides.teaser.yml +++ b/config/sync/core.entity_view_display.node.guides.teaser.yml @@ -8,6 +8,7 @@ dependencies: - field.field.node.guides.field_deck - field.field.node.guides.field_featured_image - field.field.node.guides.field_guide_weight + - field.field.node.guides.field_kicker - field.field.node.guides.field_page_weight - field.field.node.guides.field_primary_image - field.field.node.guides.field_summary @@ -30,6 +31,11 @@ content: third_party_settings: { } weight: 101 region: content + content_moderation_control: + settings: { } + third_party_settings: { } + weight: -20 + region: content links: settings: { } third_party_settings: { } @@ -39,6 +45,7 @@ hidden: field_deck: true field_featured_image: true field_guide_weight: true + field_kicker: true field_page_weight: true field_primary_image: true field_summary: true diff --git a/config/sync/core.entity_view_display.node.landing_page.default.yml b/config/sync/core.entity_view_display.node.landing_page.default.yml index f6ddd145..cc61385d 100644 --- a/config/sync/core.entity_view_display.node.landing_page.default.yml +++ b/config/sync/core.entity_view_display.node.landing_page.default.yml @@ -5,6 +5,8 @@ dependencies: config: - field.field.node.landing_page.body - field.field.node.landing_page.field_buttons + - field.field.node.landing_page.field_deck + - field.field.node.landing_page.field_landing_page_type - field.field.node.landing_page.field_summary - node.type.landing_page module: @@ -21,7 +23,12 @@ content: label: hidden settings: { } third_party_settings: { } - weight: 101 + weight: 2 + region: content + content_moderation_control: + settings: { } + third_party_settings: { } + weight: 0 region: content field_buttons: type: link @@ -33,18 +40,26 @@ content: rel: '' target: '' third_party_settings: { } - weight: 105 + weight: 5 + region: content + field_deck: + type: text_default + label: above + settings: { } + third_party_settings: { } + weight: 4 region: content field_summary: type: text_default label: above settings: { } third_party_settings: { } - weight: 104 + weight: 3 region: content links: settings: { } third_party_settings: { } - weight: 100 + weight: 1 region: content -hidden: { } +hidden: + field_landing_page_type: true diff --git a/config/sync/core.entity_view_display.node.landing_page.teaser.yml b/config/sync/core.entity_view_display.node.landing_page.teaser.yml index 24786e76..a4279f98 100644 --- a/config/sync/core.entity_view_display.node.landing_page.teaser.yml +++ b/config/sync/core.entity_view_display.node.landing_page.teaser.yml @@ -6,6 +6,8 @@ dependencies: - core.entity_view_mode.node.teaser - field.field.node.landing_page.body - field.field.node.landing_page.field_buttons + - field.field.node.landing_page.field_deck + - field.field.node.landing_page.field_landing_page_type - field.field.node.landing_page.field_summary - node.type.landing_page module: @@ -24,6 +26,11 @@ content: third_party_settings: { } weight: 101 region: content + content_moderation_control: + settings: { } + third_party_settings: { } + weight: -20 + region: content links: settings: { } third_party_settings: { } @@ -31,4 +38,6 @@ content: region: content hidden: field_buttons: true + field_deck: true + field_landing_page_type: true field_summary: true diff --git a/config/sync/core.entity_view_display.node.news.default.yml b/config/sync/core.entity_view_display.node.news.default.yml index e8e89913..5a4e2f41 100644 --- a/config/sync/core.entity_view_display.node.news.default.yml +++ b/config/sync/core.entity_view_display.node.news.default.yml @@ -30,9 +30,10 @@ content: weight: 101 region: content field_authors: - type: entity_reference_label - label: above + type: entity_reference_entity_view + label: hidden settings: + view_mode: default link: true third_party_settings: { } weight: 126 @@ -96,7 +97,7 @@ content: region: content field_topics: type: entity_reference_label - label: above + label: hidden settings: link: true third_party_settings: { } diff --git a/config/sync/field.field.node.guides.field_kicker.yml b/config/sync/field.field.node.guides.field_kicker.yml new file mode 100644 index 00000000..87149ffe --- /dev/null +++ b/config/sync/field.field.node.guides.field_kicker.yml @@ -0,0 +1,19 @@ +uuid: 5b0e584d-be8d-4f09-9200-9f81dfcbbb32 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_kicker + - node.type.guides +id: node.guides.field_kicker +field_name: field_kicker +entity_type: node +bundle: guides +label: Kicker +description: 'Highlight the relevant topic. This displays above the title on the /gudes/ page. Should always be included. Use only one or two words.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/sync/field.field.node.landing_page.field_deck.yml b/config/sync/field.field.node.landing_page.field_deck.yml new file mode 100644 index 00000000..68f34740 --- /dev/null +++ b/config/sync/field.field.node.landing_page.field_deck.yml @@ -0,0 +1,24 @@ +uuid: 503bd964-010e-432a-aa2d-ed7fa61d0e56 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_deck + - filter.format.html + - node.type.landing_page + module: + - text +id: node.landing_page.field_deck +field_name: field_deck +entity_type: node +bundle: landing_page +label: Deck +description: "Think of this as the sentence you'd most like to tweet. Do not repeat the headline. You need to be able to read it outloud in a single breath." +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + allowed_formats: + - html +field_type: text diff --git a/config/sync/field.field.node.landing_page.field_landing_page_type.yml b/config/sync/field.field.node.landing_page.field_landing_page_type.yml new file mode 100644 index 00000000..7aa46730 --- /dev/null +++ b/config/sync/field.field.node.landing_page.field_landing_page_type.yml @@ -0,0 +1,21 @@ +uuid: 819799c2-e653-4805-846d-3f97e4541180 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_landing_page_type + - node.type.landing_page + module: + - options +id: node.landing_page.field_landing_page_type +field_name: field_landing_page_type +entity_type: node +bundle: landing_page +label: 'Landing Page Type' +description: 'Select which landing page template and header to use.' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: list_string diff --git a/config/sync/field.storage.node.field_landing_page_type.yml b/config/sync/field.storage.node.field_landing_page_type.yml new file mode 100644 index 00000000..82c3bd87 --- /dev/null +++ b/config/sync/field.storage.node.field_landing_page_type.yml @@ -0,0 +1,39 @@ +uuid: c8e15d30-d2bd-4b39-9d00-5462fd559df5 +langcode: en +status: true +dependencies: + module: + - node + - options +id: node.field_landing_page_type +field_name: field_landing_page_type +entity_type: node +type: list_string +settings: + allowed_values: + - + value: communities + label: Communities + - + value: events + label: Events + - + value: guides + label: Guides + - + value: job_board + label: 'Job board' + - + value: news + label: News + - + value: resources + label: Resources + allowed_values_function: '' +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/web/themes/custom/digital_gov/digital_gov.theme b/web/themes/custom/digital_gov/digital_gov.theme index 8fb18383..63b1cb44 100644 --- a/web/themes/custom/digital_gov/digital_gov.theme +++ b/web/themes/custom/digital_gov/digital_gov.theme @@ -7,6 +7,7 @@ declare(strict_types=1); +use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\Template\Attribute; /** @@ -32,7 +33,79 @@ function digital_gov_preprocess_page(array &$variables): void { * Implements hook_preprocess_HOOK() for node.html.twig. */ function digital_gov_preprocess_node(array &$variables): void { + $variables['attributes']['class'] = 'grid-container-desktop'; + $created = DrupalDateTime::createFromTimestamp($variables['node']->getCreatedTime()); + $variables['created'] = $created->format('M j, Y'); + + switch ($variables['node']->bundle()) { + case 'news': + $before_date = new DrupalDateTime('5 years ago'); + $variables['show_archive_warning'] = $created->getPhpDateTime() <= $before_date->getPhpDateTime(); + break; + + case 'event': + $now = new DrupalDateTime(); + $startDate = $variables['node']->field_start_date->date; + $variables['start_date'] = $startDate->format('l, F j, Y', ['timezone' => date_default_timezone_get()]); + $variables['start_time'] = $startDate->format('g:i A', ['timezone' => date_default_timezone_get()]); + $variables['is_future_event'] = $startDate->getPhpDateTime() > $now->getPhpDateTime(); + + if ($variables["node"]->field_end_date->value) { + $endDate = $variables["node"]->field_end_date->date; + $variables['end_time'] = $endDate->format('g:i A T', ['timezone' => date_default_timezone_get()]); + } + break; + } +} +/** + * Implements hook_theme(). + */ +function digital_gov_theme(): array { + return [ + 'author_image' => [ + 'variables' => [ + 'author' => NULL, + ], + ], + ]; +} + +/** + * Preprocessor for author_image theme function. + */ +function digital_gov_preprocess_author_image(array &$vars): void { + $profile_source = $vars["author"]["#entity"]->field_profile_source->value ?? NULL; + $github = $vars["author"]["#entity"]->field_github->value ?? NULL; + + $slug = $vars["author"]["#entity"]->field_slug->value; + switch (TRUE) { + case $profile_source === 'github' && $github: + // Author has selected GitHub and specified a GitHub user ID. + $vars['icon_path'] = sprintf('https://github.com/%s.png?size=50', $github); + break; + + case $profile_source === 'digit-light': + case $profile_source === 'digit-dark': + case $profile_source === 'digit-pride': + $vars['icon_path'] = sprintf('img/%s.png', $profile_source); + break; + + default: + if ($github) { + // Author did not select GitHub but use a GitHUB ID if they have one. + $vars['icon_path'] = sprintf('https://github.com/%s.png?size=50', $github); + } + else { + // No source selected OR they picked GitHub without a GitHub ID + // choose between light and dark based on length of the slug. + $vars['icon_path'] = sprintf( + 'img/digit-%s.png', + strlen($slug ?? $vars['author']['#title']) % 2 ? 'dark' : 'light' + ); + } + break; + } } /** @@ -111,3 +184,19 @@ function digital_gov_preprocess_menu(&$variables, $hook) { } } } + +/** + * Implements hook_preprocess_theme_suggestions_node_alter(). + */ +function digital_gov_theme_suggestions_node_alter(array &$suggestions, array $variables) { + $node = $variables["elements"]["#node"]; + + switch ($node->getType()) { + case 'landing_page': + if ($landing_type = $node->field_landing_page_type->value) { + $suggestions[] = 'node__landing_page__' . $landing_type; + $suggestions[] = 'node__landing_page__' . $landing_type . '__' . $variables["elements"]["#view_mode"]; + } + break; + } +} diff --git a/web/themes/custom/digital_gov/templates/author-image.html.twig b/web/themes/custom/digital_gov/templates/author-image.html.twig new file mode 100644 index 00000000..e1408b47 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/author-image.html.twig @@ -0,0 +1,19 @@ +{# +# Displays profile image for an author +EXPECTED VARIABLES: + - author: render array of author node + + An author can define where they want to pull their author photo from: + - github + - digit-dark + - digit-light + - digit-pride + + icon_path is set in digital_gov_preprocess_author_image() +#} + + diff --git a/web/themes/custom/digital_gov/templates/field/field--field-topics.html.twig b/web/themes/custom/digital_gov/templates/field/field--field-topics.html.twig new file mode 100644 index 00000000..3c39a79f --- /dev/null +++ b/web/themes/custom/digital_gov/templates/field/field--field-topics.html.twig @@ -0,0 +1,49 @@ +{# +/** + * @file + * Default theme implementation for a field. + * + * To override output, copy the "field.html.twig" from the templates directory + * to your theme's directory and customize it, just like customizing other + * Drupal templates such as page.html.twig or node.html.twig. + * + * Instead of overriding the theming for all fields, you can also just override + * theming for a subset of fields using + * @link themeable Theme hook suggestions. @endlink For example, + * here are some theme hook suggestions that can be used for a field_foo field + * on an article node type: + * - field--node--field-foo--article.html.twig + * - field--node--field-foo.html.twig + * - field--node--article.html.twig + * - field--field-foo.html.twig + * - field--text-with-summary.html.twig + * - field.html.twig + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - label_hidden: Whether to show the field label or not. + * - title_attributes: HTML attributes for the title. + * - label: The label for the field. + * - multiple: TRUE if a field can contain multiple items. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item's content. + * - entity_type: The entity type to which the field belongs. + * - field_name: The name of the field. + * - field_type: The type of the field. + * - label_display: The display settings for the label. + * + * @see template_preprocess_field() + * + * @ingroup themeable + */ +#} + +
+

Related Topics

+ {% for item in items %} + {% set topic = item.content['#entity'] %} + {{ item.content['#title'] }} + {% endfor %} +
diff --git a/web/themes/custom/digital_gov/templates/field/field--node--field-summary.html.twig b/web/themes/custom/digital_gov/templates/field/field--node--field-summary.html.twig new file mode 100644 index 00000000..0b45124e --- /dev/null +++ b/web/themes/custom/digital_gov/templates/field/field--node--field-summary.html.twig @@ -0,0 +1,45 @@ +{# +/** + * @file + * Default theme implementation for a field. + * + * To override output, copy the "field.html.twig" from the templates directory + * to your theme's directory and customize it, just like customizing other + * Drupal templates such as page.html.twig or node.html.twig. + * + * Instead of overriding the theming for all fields, you can also just override + * theming for a subset of fields using + * @link themeable Theme hook suggestions. @endlink For example, + * here are some theme hook suggestions that can be used for a field_foo field + * on an article node type: + * - field--node--field-foo--article.html.twig + * - field--node--field-foo.html.twig + * - field--node--article.html.twig + * - field--field-foo.html.twig + * - field--text-with-summary.html.twig + * - field.html.twig + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - label_hidden: Whether to show the field label or not. + * - title_attributes: HTML attributes for the title. + * - label: The label for the field. + * - multiple: TRUE if a field can contain multiple items. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item's content. + * - entity_type: The entity type to which the field belongs. + * - field_name: The name of the field. + * - field_type: The type of the field. + * - label_display: The display settings for the label. + * + * @see template_preprocess_field() + * + * @ingroup themeable + */ +#} +{% for item in items %} +

+ {{ item.content['#text'] }} +

+{% endfor %} diff --git a/web/themes/custom/digital_gov/templates/node/node--authors.html.twig b/web/themes/custom/digital_gov/templates/node/node--authors.html.twig new file mode 100644 index 00000000..5475c723 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--authors.html.twig @@ -0,0 +1,116 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ + +#} +
+
+
+
+ {% if node.field_github.value %} + Profile image for {{ node.title.value }} + {% else %} + Profile image for {{ node.title.value }} + {% endif %} + +
+

{{ node.title.value }}

+ +
+ {% if node.field_pronouns.value %} +

{{ node.field_pronouns.value }}

+ {% endif %} + + {% if node.field_agency_full_name.value %} +

+ {{ node.field_agency_full_name.value }} +

+ {% endif %} +
+
+
+
+
+ +
+
+
+
+

Latest Content by {{ node.title.value }}

+ + [placeholder for latest content] +
+
+ {{ include('@digital_gov/partials/see-all-footer.html.twig') }} +
+
+
diff --git a/web/themes/custom/digital_gov/templates/node/node--basic-page.html.twig b/web/themes/custom/digital_gov/templates/node/node--basic-page.html.twig new file mode 100644 index 00000000..0c2052c0 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--basic-page.html.twig @@ -0,0 +1,92 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} + +
+
+
+ + {{ drupal_entity('block', 'digital_gov_breadcrumbs') }} + + {{ include("@digital_gov/partials/page-header.html.twig", { + 'title': node.title.value, + 'deck': node.field_deck.value, + }, with_context = false) }} +
+ +
+ + +
+ {{ content }} +
+ +
+ +
+
diff --git a/web/themes/custom/digital_gov/templates/node/node--community.html.twig b/web/themes/custom/digital_gov/templates/node/node--community.html.twig new file mode 100644 index 00000000..a14f4de2 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--community.html.twig @@ -0,0 +1,142 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} + +{# where does community list come from? #} +{% set community_list = true %} +
+
+ + {{ drupal_entity('block', 'digital_gov_breadcrumbs') }} + +
+ {{ include("@digital_gov/partials/page-header.html.twig", { + 'title': node.title.value, + 'deck': node.field_deck.value, + 'append_title_text': 'Community' + }, with_context = false) }} +
+ +
+ +
+ {# Summary controls if the community content is shown + but is not displayed on full page #} + {% if node.field_summary.value %} + {% set community_acronym = node.field_dg_acronym.value %} + {% set subscribe_email_subject = node.field_subscribe_email_subject.value %} +
+ {% if community_list %} +
+
+ {{ content.field_dg_logo | field_value }} +

Connect with us

+
+
+

+ Federal, state, territorial, tribal, and local government + employees and contractors are eligible to join. +

+

+ Select "{{ subscribe_email_subject }}," then a form will ask + for your name and email address. The form should take most + people a minute or less to complete. +

+ {# Get the form link #} + + {{ subscribe_email_subject }} + +
+
+ {% endif %} +
+ {{ content | without('field_dg_logo') }} +
+ + {# @TODO Community Events #} + [placeholder Upcoming events] + {# NOT-MIGRATED + {{ partial '@digital_gov/partials/core/get-upcomingevents.html' }} + #} +
+

Community Conduct

+ {% include('@digital_gov/partials/community-pagefooter.html.twig') %} +
+
+ {% endif %} +
+ +
+ +
+
diff --git a/web/themes/custom/digital_gov/templates/node/node--event.html.twig b/web/themes/custom/digital_gov/templates/node/node--event.html.twig new file mode 100644 index 00000000..136a1d34 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--event.html.twig @@ -0,0 +1,195 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} + +{# where does community list come from? #} +{% set community_list = true %} + +
+
+ + {{ drupal_entity('block', 'digital_gov_breadcrumbs') }} + +
+ {# @TODO kicker and deck fields can contain HTML tags but use the plain text filter... #} + {{ include("@digital_gov/partials/page-header.html.twig", { + 'title': node.title.value, + 'kicker': node.field_kicker.value, + 'deck': node.field_deck.value + }, with_context = false) }} + + +

+ + + {{ start_date }} + {{ start_time }} + {% if (end_time) %} + – {{ end_time }} + {% endif %} + +

+ {% if (node.field_host.value) %} +

Hosted by Digital.gov and the {{ node.field_host.value }}

+ {% endif %} + +
+ {# EVENT Actions — REGISTER and Add to Calendar #} + {% if is_future_event and node.field_registration_url %} +
+ {{ _self.registration_link(node) }} +
+ {% endif %} + + {# EVENT Stages — Depending on the type of event, different "event stages" appear on the page. / #} + {% if is_future_event and node.field_event_platform.value == "youtube_live" %} + {{ include('@digital_gov/partials/events/stage-youtube-live.html.twig', { + 'youtube_id': node.field_youtube_id.value, + 'youtube_title': node.label, + 'captions': node.field_captions.0.uri, + }, with_context = false) }} + {% endif %} + + {% if not is_future_event and node.field_youtube_id.value %} + {{ include('@digital_gov/partials/events/stage-youtube.html.twig', { + 'youtube_id': node.field_youtube_id.value, + 'youtube_title': node.label + }, with_context = false) }} + {% endif %} + +
+
+ {# ZOOM Stage #} + {% if is_future_event and node.field_event_platform.value == "zoom" %} + {{ include('@digital_gov/partials/events/stage-zoom.html.twig', { + 'youtube_id': node.field_youtube_id.value, + 'youtube_title': node.label, + 'captions': node.field_captions.0.uri + }, with_context = false) }} + {% endif %} + + {# Main Content #} +
+ {{ content }} +
+ + {# Touchpoints Form #} + {{ include('@digital_gov/partials/touchpoints-form.html.twig') }} +
+ +
+ {# Authors #} + {% if content.field_authors %} +

In this talk

+ {{ include('@digital_gov/partials/authors-list.html.twig', { + 'inline': false, + 'authors': content.field_authors, + }, with_context = false) }} + {% endif %} + + {% if node.field_event_platform.value == "youtube_live" %} + {% if is_future_event %} +
+ {# Register #} + {{ _self.registration_link(node) }} +
+ {% endif %} + {% endif %} + + {# Display Primary Communities #} + {{ include('@digital_gov/partials/primary-communities.html.twig') }} + + {# partial "core/primary-communities.html" . #} + + {# Topics #} + {{ content.field_topics }} + + {# Share Tools #} + {{ include('@digital_gov/partials/get-sharetools.html.twig', { + 'share_path': url, + 'mailto_subject': node.label, + }, with_context = false) }} + +
+
+
+ +
+{% macro registration_link(node) %} + Register +{% endmacro %} diff --git a/web/themes/custom/digital_gov/templates/node/node--guides.html.twig b/web/themes/custom/digital_gov/templates/node/node--guides.html.twig new file mode 100644 index 00000000..bd79a7e1 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--guides.html.twig @@ -0,0 +1,98 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ + +#} +
+
+ {{ include("@digital_gov/partials/guides/guide-header.html.twig") }} + + {# NOT - MIGRATED + {-- partial "core/guides/guide-menu-bar.html" . -} + #} + {# NOT - MIGRATED + {% if .Params.guide %} + {{ $guideData = index $.Site.Data.guidenav (.Params.guide) }} + {% endif %} + #} + + {% if guideData.showInPageNav %} +
+ +
+ {{ include("@digital_gov/partials/guides/guide-content.html.twig") }} +
+
+ {% else %} + {{ include("@digital_gov/partials/guides/guide-content.html.twig") }} + {% endif %} + {# NOT-MIGRATED #} + {# if .Parent.Params.glossary #} + {# partial "core/glossary.html" . #} + {# endif #} +
+
diff --git a/web/themes/custom/digital_gov/templates/node/node--landing-page--communities.html.twig b/web/themes/custom/digital_gov/templates/node/node--landing-page--communities.html.twig new file mode 100644 index 00000000..637e0287 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--landing-page--communities.html.twig @@ -0,0 +1,93 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} + +
+
+

{{ node.title.value }}

+ + {% if content.field_deck %} +
{{ content.field_deck | field_value}}
+ {% endif %} +
+ + [placeholder Featured Communities] + {# NOT-MIGRATED + {{ partial "core/featured-communities.html" (dict "context" . "outline" true "layout" "has-image") }} + #} + {# Other Communities of Practice #} +
+

Other Communities of Practice

+
+ These communities are not managed by Digital.gov, but are listed here +
because they overlap with + our mission. +
+
+ + [placeholder Other Communities] + {# NOT-MIGRATED + {{ partial "core/collection/collection-grid-list.html" (dict "list_data" $other_communities) }} + #} +
diff --git a/web/themes/custom/digital_gov/templates/node/node--landing-page--events.html.twig b/web/themes/custom/digital_gov/templates/node/node--landing-page--events.html.twig new file mode 100644 index 00000000..da3569b4 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--landing-page--events.html.twig @@ -0,0 +1,129 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} + +
+
+
+ {# Page Title #} +

{{ node.title.value }}

+ + {# Deck #} + {% if content.field_deck %} +
{{ content.field_deck | field_value}}
+ {% endif %} + + {% if content.field_buttons %} +
+ {{ content.field_buttons | field_value }} +
+ {% endif %} +
+
+ +
+
+

Upcoming Events

+ + [placeholder Show upcoming events up until event ends ] + {# NOT-MIGRATED + {{ range where .Site.Pages.Reverse "Params.End_date" ">=" $now }} + {{ if .Params.registration_url }} + {{ .Render "card-event" }} + {{ end }} + {{ else }} + {{/* @TODO Add as an option for card refactor */}} +
+

Upcoming events will be added soon.

+ To be notified of new events, + subscribe to our newsletter! +
+ {{ end }} + #} +
+
+ +
+
+
+

Past Events

+
+
+
+
+ [placeholder Past Events] + {# NOT-MIGRATED + {{ $events := where .Site.RegularPages.ByDate "Section" "events" }} + {{ range where $events.Reverse ".Date.Unix" "<" now.Unix }} + {{ $endDate := .Params.End_date | time.Format "2006-01-02" }} + {{ if lt $endDate $now }} + {{ .Render "card-event" }} + {{ end }} + {{ end }} + #} +
+
+
+
diff --git a/web/themes/custom/digital_gov/templates/node/node--landing-page--guides.html.twig b/web/themes/custom/digital_gov/templates/node/node--landing-page--guides.html.twig new file mode 100644 index 00000000..4784cfb9 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--landing-page--guides.html.twig @@ -0,0 +1,111 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} + +
+
+
+

{{ node.title.value }}

+ {% if content.field_deck %} +

{{ content.field_deck | field_value}}

+ {% endif %} +
+
+
    + [placeholder for Guide cards] + + {# NOT-MIGRATED + {{ range $guidePages.ByParam "guide_weight" }} + {{ $image := .Params.image }} + {{ $layout := "" }} + {{ if $image }} + {{ $layout = "has-image" }} + {{ else }} + {{ $layout = "no-image" }} + {{ end }} + {{ $kicker := "Digital.gov Guide" }} + {{ if .Params.guide_weight }} +
  • + {{ $card_data := (dict + "header" .Title + "body" .Params.summary + "link" (.Permalink | relURL) + "link_title" .Title + "image" $image + "alt" "Test Alt" + "layout" $layout + "kicker" $kicker + "site" .Site + ) + }} + + {{ partial "core/usa-card.html" (dict "card_data" $card_data) }} +
  • + {{ end }} + {{ end }} + #} +
+
+
+
diff --git a/web/themes/custom/digital_gov/templates/node/node--landing-page--job-board.html.twig b/web/themes/custom/digital_gov/templates/node/node--landing-page--job-board.html.twig new file mode 100644 index 00000000..fa8b94e0 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--landing-page--job-board.html.twig @@ -0,0 +1,144 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} + +
+
+
+
+
+

{{ node.title.value }}

+ + {% if content.field_deck %} +

{{ content.field_deck | field_value}}

+ {% endif %} + +
+
+
+
+
+ +
+
+ [placeholder list job cards] + {# NOT-MIGRATED + {{ range .Site.Data.job_board }} + {{ if ge .close_date $now }} + {{ $anyActivePost = true }} + {{ $jobLink := .apply_link | safeURL }} +
+ +
+
+ {{ .department | markdownify }} +
+
+ {{ .location | markdownify }} +
+

+ {{ .description | markdownify }} +

+
+ +
+ Open {{ .open_date | time.Format ":date_long" }} to + {{ .close_date | time.Format ":date_long" }} +
+
+ {{ range .cop_topics }} + {{ $topic := . }} + {{ $acronym := index $acronymToCop $topic }} +
+ {{- $topic -}} +
+ {{ end }} +
+
+ {{ end }} + {{ end }} + + + {{ if not $anyActivePost }} +
+ There are no active job postings at the moment. Please check back + another time. +
+ {{ end }} + #} +
+ {#- partial "core/pagination.html" . -#} +
+
diff --git a/web/themes/custom/digital_gov/templates/node/node--landing-page--news.html.twig b/web/themes/custom/digital_gov/templates/node/node--landing-page--news.html.twig new file mode 100644 index 00000000..9cc82f32 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--landing-page--news.html.twig @@ -0,0 +1,121 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} + +
+
+
+
+
+ {# Page Title #} +

{{ node.title.value }}

+ + {# Deck #} + {% if content.field_deck %} +

{{ content.field_deck | field_value}}

+ {% endif %} + +
+
+
+
+ +
+
+ [placeholder Blog Posts by Topic — + List all of the blog posts and events tagged with this topic] + + {# NOT-MIGRATED #} + {# Gets the past events #} + {# $events := where .Site.RegularPages.ByDate.Reverse "Section" "events" #} + + {# $past_events := where (where .Site.RegularPages.ByDate.Reverse "Section" "events") ".Date.Unix" "<" now.Unix #} + + {# $all_events := union $past_events $events #} + + {# Gets the recent blog posts #} + {# $posts := where .Pages "Section" "news" #} + + {# Merges the past events and the recent blog posts #} + {# $stream := union $all_events $posts #} + + {# If there are any items at all... #} + {# if $stream #} + {# Loop through all the pages #} + {# Also sorting all the items by date and reverse chron #} + {# range (.Paginate ( $stream.ByDate.Reverse )).Pages #} + + {# if eq .Type "events" #} + {# .Render "card-event" #} + {# endif #} + + {# if eq .Type "news" #} + {# .Render "card-news" #} + {# endif #} + {# endif #} + {# endif #} + {# partial "core/pagination.html" . #} +
+
+
diff --git a/web/themes/custom/digital_gov/templates/node/node--landing-page--resources.html.twig b/web/themes/custom/digital_gov/templates/node/node--landing-page--resources.html.twig new file mode 100644 index 00000000..f84db0a4 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--landing-page--resources.html.twig @@ -0,0 +1,121 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} + +
+
+
+

{{ node.title.value }}

+ + {% if content.field_deck %} +

+ {{ content.field_deck | field_value}} +

+ {% endif %} +
+ +
+

Browse by topic

+
+ [placeholder resource topics views] + {# NOT-MIGRATED + {{ template "topics-list" (dict "title" "Design" "data" $design_topics "scope" .) }} + {{ template "topics-list" (dict "title" "Data & analysis" "data" $data_analysis_topics "scope" .) }} + {{ template "topics-list" (dict "title" "Operations" "data" $operations_topics "scope" .) }} + {{ template "topics-list" (dict "title" "Content & communication" "data" $content_communications_topics "scope" .) }} + {{ template "topics-list" (dict "title" "Technology" "data" $technology_topics "scope" .) }} + {{ template "topics-list" (dict "title" "Strategic development" "data" $strategic_development_topics "scope" .) }} + #} +
+
+
+
+ +[ Placeholder Display a list of topic links and resource category header ] + +{# NOT_MIGRATED +@param {string} - title for the header of the resource category topic list +@param {list} - data list of topic strings to display for each link +@param {scope} - scope of current page context +*/}} +{{ define "topics-list" }} + {{ $title := .title }} + {{ $data := .data }} + {{ $scope := .scope }} +
+

+ {{ .title }} +

+ +
+#} diff --git a/web/themes/custom/digital_gov/templates/node/node--news.html.twig b/web/themes/custom/digital_gov/templates/node/node--news.html.twig new file mode 100644 index 00000000..18a4ca37 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--news.html.twig @@ -0,0 +1,134 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} +
+
+ + {{ drupal_entity('block', 'digital_gov_breadcrumbs') }} + +
+ {{ include('@digital_gov/partials/blog-date-warning.html.twig') }} + + {{ include("@digital_gov/partials/page-header.html.twig", { + 'title': node.title.value, + 'kicker': node.field_kicker.value, + 'deck': node.field_deck.value + }, with_context = false) }} + + {{ include('@digital_gov/partials/authors-list.html.twig', { + 'inline': true, + 'authors': content.field_authors, + }, with_context = false) }} + +
+
+ {{ created }} +
+
+
+ +
+
+
+
+ {{ content.body }} +
+ + {# /* Touchpoints Form #} + {{ include('@digital_gov/partials/touchpoints-form.html.twig') }} +
+ +
+ {{ include('@digital_gov/partials/authors-list.html.twig', { + 'inline': false, + 'authors': content.field_authors, + }, with_context = false) }} + +
+
+ {{ created }} +
+
+ + {{ content.field_topics }} + + {# Share Tools #} + {{ include('@digital_gov/partials/get-sharetools.html.twig', { + 'share_path': url, + 'mailto_subject': node.label, + }, with_context = false) }} + + +
+
+
+ +
+ +
diff --git a/web/themes/custom/digital_gov/templates/node/node--resources.html.twig b/web/themes/custom/digital_gov/templates/node/node--resources.html.twig new file mode 100644 index 00000000..38fba69b --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--resources.html.twig @@ -0,0 +1,104 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} + +
+
+
+ + {{ drupal_entity('block', 'digital_gov_breadcrumbs') }} + + {{ include("@digital_gov/partials/page-header.html.twig", { + 'title': node.title.value, + 'deck': node.field_deck.value, + }, with_context = false) }} +
+ +
+
+
+ {{ content }} +
+ + {# Touchpoints Form #} + {{ include('@digital_gov/partials/touchpoints-form.html.twig') }} +
+ + +
+
+
diff --git a/web/themes/custom/digital_gov/templates/node/node--topics.html.twig b/web/themes/custom/digital_gov/templates/node/node--topics.html.twig new file mode 100644 index 00000000..f32157c1 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/node/node--topics.html.twig @@ -0,0 +1,281 @@ +{# +/** + * @file + * Default theme implementation to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * + * @see template_preprocess_node() + * + * @ingroup themeable + */ +#} + +{# NOT_MIGRATED #} +{% set is_first_page = TRUE %} + +
+
+ {{ drupal_entity('block', 'digital_gov_breadcrumbs') }} +
+ + {# Default & Collection Header #} +
+

+ {{ node.title.value }} +

+ + {# Deck #} + {% if content.field_deck %} +

+ {{ content.field_deck | field_value }} +

+ {% endif %} +
+ + {# Collection — Summary & Legislation #} + {% if node.field_summary or node.field_legislation %} + {% if is_first_page %} +
+
+
+ {{ content.field_summary }} +
+
+ {% if node.field_legislation.list %} + {{ include('@digital_gov/partials/card-legislation.html.twig', { + 'title': node.field_legislation.0.title, + 'url': node.field_legislation.0.uri + }, with_context = false) }} + {% endif %} +
+
+
+ {% endif %} + {% endif %} + + [placeholder featured resources and communities] + {# Collection — Featured Resources and Communities #} + {% if or .Params.featured_resources .Params.featured_communities %} + {% if is_first_page %} + + {% endif %} + {% endif %} + + {# Collection Featured Links #} + [placeholder featured links] + {% if Params.featured_links %} + {% if is_first_page %} +
+ {% if Params.featured_links.title %} +

{{ Params.featured_links.title }}

+ {% else %} +

What you need to know

+ {% endif %} + + {# NOT-MIGRATED #} + {# $featured_links := .Params.featured_links.resources #} + {# $footer := ( dict "title" .Params.featured_links.footer.title "href" .Params.featured_links.footer.href ) #} + {# $collection_settings := ( dict "variant" "custom" "limit" 10 "list_header" 3 "footer" $footer ) #} + {# partial "partials/core/collection/collection.html" (dict "collection_data" $featured_links "settings" $collection_settings) #} +
+ {% endif %} + {% else %} + {# Only show these sections when on page 1, otherwise hide to show only More News and Events #} + {% if is_first_page %} + {# Default - Related resources, services, and communities #} +
+ {# NOT-MIGRATED #} + {# $resource_settings := ( dict "header_title" (print "Resources on " .Title) "header_size" 2 "variant" "media" "list_header" 3) #} + {# partial "partials/core/collection/collection.html" (dict "collection_data" $resources "settings" $resource_settings ) #} + + {# NOT-MIGRATED #} + {# $services_settings := ( dict "header_title" "Tools and Services" "header_size" 2 "variant" "media" "list_header" 3) #} + {# partial "partials/core/collection/collection.html" (dict "collection_data" $services "settings" $services_settings) #} + + {# NOT-MIGRATED #} + {# $community_settings := ( dict "header_title" "Join a Community of Practice" "header_size" 2 "variant" "media" "list_header" 3) #} + {# partial "partials/core/collection/collection.html" (dict "collection_data" $communities "settings" $community_settings) #} +
+ {% endif %} + {% endif %} + + {# Topic Collection will always have a legislation card, use this as flag to display first 5 events & news #} + {% if Params.legislation %} + {# Only show these sections when on page 1, otherwise hide to show only More News and Events #} + {% if is_first_page %} +
+
+ {# Display first 5 events #} + {# $featured_events_stream := first 5 $events #} + {% if featured_events_stream %} +

{{ node.title.value }} events

+ + [placeholder featured events] + {# NOT-MIGRATED #} + {# range $featured_events_stream #} + {# .Render "card-event" #} + {# end #} + {% else %} +

No Events to Display

+ {% endif %} +
+ +
+ {# Display first 5 news posts #} + {# NOT-MIGRATED #} + {# $featured_posts_stream := first 5 $posts.ByDate.Reverse #} + + [placeholder featured posts] + {% if featured_posts_stream %} +

{{ node.title.value }} news

+ + {# range $featured_posts_stream #} + {# NOT-MIGRATED #} + {# .Render "card-news" #} + {% else %} +

No News to Display

+ {% endif %} +
+
+ {% endif %} + {% else %} +
+
+ {# Display events and news in one stream with pagination for topic default #} + [placeholder featured events and news] + {% if stream_paginated %} +

+ News and Events on + {{ node.title.value }} +

+

{{ stream_count }} posts

+ + {# NOT-MIGRATED + {{ range stream_paginated }} + {% if eq .Type "events" %} + {{ .Render "card-event" }} + {% endif %} + + {% if eq .Type "news" %} + {{ .Render "card-news" }} + {% endif %} + #} + {# end #} + {% endif %} + {# NOT-MIGRATED #} + {# partial "core/pagination.html" . #} +
+
+ {% endif %} + + {% if node.field_legislation.0 %} + {# Display remaining resources, events and news for topic collection #} + {% if is_first_page %} +
+ [placeholder remaining resources] + {# Only show these sections when on page 1, otherwise hide to show only More News and Events #} + {# $resource_settings := ( dict "header_title" (printf "Resources on %s" .Title) "header_size" 2 "variant" "media" "list_header" 3) #} + {# NOT-MIGRATED #} + {# partial "partials/core/collection/collection.html" (dict "collection_data" $resources "settings" $resource_settings ) #} + + {# $services_settings := ( dict "header_title" "Tools and Services" "header_size" 2 "variant" "media" "list_header" 3) #} + {# NOT-MIGRATED #} + {# partial "partials/core/collection/collection.html" (dict "collection_data" $services "settings" $services_settings) #} +
+ {% endif %} + + [placeholder more news and events] + {% if stream_paginated %} +
+
+

+ More News and Events on + {{ node.title.value }} +

+

{{ stream_count }} posts

+ + {# range $stream_paginated #} + {% if Type == "events" %} + {# NOT-MIGRATED #} + {# .Render "card-event" #} + {% endif %} + + {% if Type == "news" %} + {# NOT-MIGRATED #} + {# .Render "card-news" #} + {% endif %} + {# end #} + {# NOT-MIGRATED #} + {# partial "core/pagination.html" . #} +
+
+ {% endif %} + {% endif %} + +
diff --git a/web/themes/custom/digital_gov/templates/page--node.html.twig b/web/themes/custom/digital_gov/templates/page--node.html.twig new file mode 100644 index 00000000..c0ec1a94 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/page--node.html.twig @@ -0,0 +1,70 @@ +{# +/** + * @file + * Default theme implementation to display a single page. + * + * The doctype, html, head and body tags are not in this template. Instead they + * can be found in the html.html.twig template in this directory. + * + * Available variables: + * + * General utility variables: + * - base_path: The base URL path of the Drupal installation. Will usually be + * "/" unless you have installed Drupal in a sub-directory. + * - is_front: A flag indicating if the current page is the front page. + * - logged_in: A flag indicating if the user is registered and signed in. + * - is_admin: A flag indicating if the user has permission to access + * administration pages. + * + * Site identity: + * - front_page: The URL of the front page. Use this instead of base_path when + * linking to the front page. This includes the language domain or prefix. + * + * Page content (in order of occurrence in the default page.html.twig): + * - messages: Status and error messages. Should be displayed prominently. + * - node: Fully loaded node, if there is an automatically-loaded node + * associated with the page and the node ID is the second argument in the + * page's path (e.g. node/12345 and node/12345/revisions, but not + * comment/reply/12345). + * + * Regions: + * - page.header: Items for the header region. + * - page.primary_menu: Items for the primary menu region. + * - page.secondary_menu: Items for the secondary menu region. + * - page.highlighted: Items for the highlighted content region. + * - page.help: Dynamic help text, mostly for admin pages. + * - page.content: The main content of the current page. + * - page.sidebar_first: Items for the first sidebar. + * - page.sidebar_second: Items for the second sidebar. + * - page.footer: Items for the footer region. + * - page.breadcrumb: Items for the breadcrumb region. + * + * @see template_preprocess_page() + * @see html.html.twig + * + * @ingroup themeable + */ +#} +
+ +
+ {{ page.header }} +
+ + {{ page.primary_menu }} + {{ page.secondary_menu }} + + + {{ page.highlighted }} + + {{ page.help }} + + {{ page.content }} + + {% if page.footer %} + + {% endif %} + +
{# /.layout-container #} diff --git a/web/themes/custom/digital_gov/templates/partials/authors-list.html.twig b/web/themes/custom/digital_gov/templates/partials/authors-list.html.twig new file mode 100644 index 00000000..72c857b5 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/authors-list.html.twig @@ -0,0 +1,31 @@ +{# + # Displays a list of authors, either inline or in a list + + EXPECTED VARIABLES: + - inline: boolean + - authors: render array of author nodes + +#} +
+ {% for author in authors | children %} +
+ {{ render_var({ '#theme': 'author_image', '#author': author }) }} + + {% if not inline and author['#entity'].field_agency_acronym.value %} +

+ {{ author['#entity'].field_agency_acronym.value }} +

+ {% endif %} +
+ {% endfor %} + +
+ diff --git a/web/themes/custom/digital_gov/templates/partials/blog-date-warning.html.twig b/web/themes/custom/digital_gov/templates/partials/blog-date-warning.html.twig new file mode 100644 index 00000000..c2635aa9 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/blog-date-warning.html.twig @@ -0,0 +1,20 @@ +{% if show_archive_warning %} + +{% endif %} diff --git a/web/themes/custom/digital_gov/templates/partials/card-legislation.html.twig b/web/themes/custom/digital_gov/templates/partials/card-legislation.html.twig new file mode 100644 index 00000000..aa6c2ac1 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/card-legislation.html.twig @@ -0,0 +1,32 @@ +
+
+ {% if title %} +
+ +

+ {{ title }} +

+
+ {% endif %} +
+
+ {{ title }} +
+
+ {% if description %} +
+

+ {{ description }} +

+
+ {% endif %} + {% if url %} + + {% endif %} +
+
diff --git a/web/themes/custom/digital_gov/templates/partials/community-pagefooter.html.twig b/web/themes/custom/digital_gov/templates/partials/community-pagefooter.html.twig new file mode 100644 index 00000000..cb2eeb63 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/community-pagefooter.html.twig @@ -0,0 +1,14 @@ +

+ The Communities of Practice are hosted by Digital.gov, a service of the + Technology Transformation Services (TTS) within the General Services + Administration (GSA). GSA is a federal agency subject to the Freedom of + Information Act (FOIA) and must comply with requests for records made under + FOIA. As a result, all communications made on this Communities of Practice + LISTSERV are subject to release under FOIA. +

+

+ When participating in this CoP, follow + Digital.gov community guidelines. +

diff --git a/web/themes/custom/digital_gov/templates/partials/events/stage-youtube-live.html.twig b/web/themes/custom/digital_gov/templates/partials/events/stage-youtube-live.html.twig new file mode 100644 index 00000000..aa877076 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/events/stage-youtube-live.html.twig @@ -0,0 +1,92 @@ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+ + + + Watch on YouTube + + + + {% if captions %} + + + + View captions + + + {% endif %} +
+
+
+
+

+ + You'll need to sign in to Google to chat. All chats will be archived + alongside the video. +

+
+
+
+
+
diff --git a/web/themes/custom/digital_gov/templates/partials/events/stage-youtube.html.twig b/web/themes/custom/digital_gov/templates/partials/events/stage-youtube.html.twig new file mode 100644 index 00000000..f8624048 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/events/stage-youtube.html.twig @@ -0,0 +1,18 @@ +{% if youtube_id %} +
+
+
+
+
+ +
+
+
+
+
+{% endif %} diff --git a/web/themes/custom/digital_gov/templates/partials/events/stage-zoom.html.twig b/web/themes/custom/digital_gov/templates/partials/events/stage-zoom.html.twig new file mode 100644 index 00000000..95dbdfb9 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/events/stage-zoom.html.twig @@ -0,0 +1,69 @@ +
+
+

+ +

+
+
+

+ This event will be held and recorded over + Zoom for Government. + A link and password will be sent via email 1 hour, 1 day, and 1 week prior + to the event start time for those who register. For more info, see the + computer and device requirements + and + Frequently Asked Questions. If you have specific questions or security concerns about Zoom for + Government, please visit + ZoomGov.com. +

+

+ Before the event, visit the + Zoom Download Center to install + the Zoom web browser client. +

+

+ Please contact us directly at + digitalgov@gsa.gov if you need + accessible accommodations to be able to attend. +

+ {% if captions %} +

+ + + View captions + +

+ {% endif %} + +
+
diff --git a/web/themes/custom/digital_gov/templates/partials/get-related.html.twig b/web/themes/custom/digital_gov/templates/partials/get-related.html.twig new file mode 100644 index 00000000..082c5c28 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/get-related.html.twig @@ -0,0 +1,60 @@ +{# ====================================== +Related Communities +====================================== +#} + +{# Communities ====================== #} + +{# gets all pages in the site that are related #} +{# $related_pages := .Site.Pages.Related . #} + +{# gets only the related community pages #} +{# $.Scratch.Set "communities" (where $related_pages "Section" "communities") #} + +{# Now conditionally shuffle the community pages and pick the first 5 #} +{# if gt (len ($.Scratch.Get "communities")) 5) #} + {# $.Scratch.Set "communities" (first 5 ($.Scratch.Get "communities") | shuffle) #} +{# endif #} +{# $communities := ($.Scratch.Get "communities") #} + +{# If there are community pages... #} +{# with $communities #} + +{# end #} diff --git a/web/themes/custom/digital_gov/templates/partials/get-sharetools.html.twig b/web/themes/custom/digital_gov/templates/partials/get-sharetools.html.twig new file mode 100644 index 00000000..c61771a2 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/get-sharetools.html.twig @@ -0,0 +1,98 @@ +{# Share tools #} + + +
+
+ + + +
+
+ + +
+
diff --git a/web/themes/custom/digital_gov/templates/partials/get-upcomingevents.html.twig b/web/themes/custom/digital_gov/templates/partials/get-upcomingevents.html.twig new file mode 100644 index 00000000..f82a3018 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/get-upcomingevents.html.twig @@ -0,0 +1,40 @@ +{# ===== +Display upcoming events associated with a community of practice +#} + +{# NOT-MIGRATED #} + +{{ $upcoming_events := where (where .Site.RegularPages.ByDate.Reverse "Section" "events") ".Date.Unix" ">" now.Unix }} +{{ $upcoming_events = $upcoming_events | intersect (where $upcoming_events "Date" ">" now) }} +{{ $community := .Params.event_cop }} +{{ $hasEvents := false }} +{{ $tags := "" }} + +{{ range $upcoming_events }} + {# Turn the slice of []strings into a string format for comparison #} + {{ $tags = delimit .Params.event_cop ", " " " }} + {% if strings.Contains $tags $community %} + {{ $hasEvents = true }} + {% endif %} +{% endif %} + +{% if $hasEvents %} +
+

Upcoming Event

+ +
+
+{% endif %} diff --git a/web/themes/custom/digital_gov/templates/partials/guides/guide-content.html.twig b/web/themes/custom/digital_gov/templates/partials/guides/guide-content.html.twig new file mode 100644 index 00000000..2d50c79c --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/guides/guide-content.html.twig @@ -0,0 +1,22 @@ +
+
+ [placeholder Guide Content Header] + {# NOT-MIGRATED + {{ partial "core/guides/guide-content-header.html" . }} + #} +
+ {{ content }} +
+
+
+ + diff --git a/web/themes/custom/digital_gov/templates/partials/guides/guide-header.html.twig b/web/themes/custom/digital_gov/templates/partials/guides/guide-header.html.twig new file mode 100644 index 00000000..4ea9c2d2 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/guides/guide-header.html.twig @@ -0,0 +1,41 @@ +
+
+ {% if landingURL %} + + {{ field.kicker.value ?: 'Digital.gov Guide' }} + + {% else %} +

{{ field.kicker.value ?: 'Digital.gov Guide' }}

+ {% endif %} + +

{{ node.title.value }}

+
+ {{ field.deck.value }} +
+ {% if node.field_glossary.value %} + + {% endif %} +
+ + {% if node.field_featured_image.value %} +
+ {{ content.field_featured_image | field_value }} + {# NOT-MIGRATED + partial "core/img-flexible.html" (dict "Site" .Site "src" $uid "small" "false") + #} +
+ {% endif %} + +
diff --git a/web/themes/custom/digital_gov/templates/partials/page-header.html.twig b/web/themes/custom/digital_gov/templates/partials/page-header.html.twig new file mode 100644 index 00000000..6e3d81e5 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/page-header.html.twig @@ -0,0 +1,30 @@ +{# ==== +Page header component that displays the title, deck and kicker. + +You can pass any of these params: +- title - the required page title +- deck - an optional summary text displayed below the title +- kicker - an optional short introduction text displayed above the title +- append_title_text - optional text that is appended to the title text field +#} + +
+ {% if kicker %} +

+ {{ kicker }} +

+ {% endif %} + {% if title %} +

+ {{ title }} + {% if append_title_text %} + {{ append_title_text }} + {% endif %} +

+ {% endif %} + {% if deck %} +
+ {{ deck }} +
+ {% endif %} +
diff --git a/web/themes/custom/digital_gov/templates/partials/primary-communities.html.twig b/web/themes/custom/digital_gov/templates/partials/primary-communities.html.twig new file mode 100644 index 00000000..91a68082 --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/primary-communities.html.twig @@ -0,0 +1,50 @@ +{# ====================================== +Displays a vertical list of primary CoP's on the sidebar on event pages. + ====================================== +#} +{# $mainCommunities := (where .Site.Pages "Section" "communities") #} +{# $mainCommunities = (where $mainCommunities ".Params.dg_highlight" "eq" true) #} +{# $featuredCommunity := (where $mainCommunities ".Params.weight" "eq" 2) #} +{# $mainCommunities = union $featuredCommunity $mainCommunities #} +{# $mainCommunities = first 8 ($mainCommunities.ByTitle) #} + +{# Check if there are main community pages to display #} + +{# NOT-MIGRATED #} +{% if mainCommunities %} + +{% endif %} + diff --git a/web/themes/custom/digital_gov/templates/partials/see-all-footer.html.twig b/web/themes/custom/digital_gov/templates/partials/see-all-footer.html.twig new file mode 100644 index 00000000..c857fa7c --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/see-all-footer.html.twig @@ -0,0 +1,29 @@ +{# Creates a reusable component linking to the news page adding consistency to visual design and content. + +** Example Usage: Visit https://digital.gov/ and scroll to the bottom of 'News and Event Section' +#} + + + diff --git a/web/themes/custom/digital_gov/templates/partials/touchpoints-form.html.twig b/web/themes/custom/digital_gov/templates/partials/touchpoints-form.html.twig new file mode 100644 index 00000000..1bcc666a --- /dev/null +++ b/web/themes/custom/digital_gov/templates/partials/touchpoints-form.html.twig @@ -0,0 +1,9 @@ + +
+ +