Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
azinck committed Apr 20, 2023
2 parents 613caba + f1103a2 commit 3711007
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ field_name: field_flag_card_alignment
entity_type: paragraph
bundle: card
label: 'Flag card alignment'
description: 'If the card group''s selected style is "Flag (50/50)" then this field controls how the card''s media displays. Either aligned left or aligned right. See <a href="https://designsystem.digital.gov/components/card/#flag-layout-card">Flag Layout Card</a>.'
description: 'If the card group''s selected style is "Flag (50/50)" then this field controls how the card''s media displays. By default images are alternated left and right, but you can override that using this field. See <a href="https://designsystem.digital.gov/components/card/#flag-layout-card">Flag Layout Card</a>.'
required: true
translatable: false
default_value:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ settings:
allowed_values:
-
value: default
label: 'Left align (default)'
label: Default
-
value: left
label: 'Left align'
-
value: right
label: 'Right align'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,12 +803,19 @@ function epa_workflow_form_revision_overview_form_alter(&$form, FormStateInterfa

// Is in the “Draft, approved” state.
if ($latest_revision_moderation_state == 'draft_approved') {
$message = '<br>The revision will publish on ' . $latest_formatted_date_time . '.';
$message = t('<br>The revision will publish on %date.',['%date' => $latest_formatted_date_time]);
$form['node_revisions_table'][0]['revision']['#context']['message']['#markup'] .= $message;
}
// Is in any other draft state.
elseif ($latest_revision_moderation_state == 'draft' || $latest_revision_moderation_state == 'draft_needs_review') {
$message = '<br>The revision is scheduled to publish on ' . $latest_formatted_date_time . ', but will only do so if this draft is approved. Currently, the draft is NOT approved.';
// If publish date is in the future give user some guidance.
if ($latest_revision->field_publish_date->date->getTimestamp() > time()) {
$message = t('<br>The revision is scheduled to publish on %date, but will only do so if this draft is approved. Currently, the draft is NOT approved.', ['%date' => $latest_formatted_date_time]);
}
// If publish date is in the past indicate the draft will publish immediately.
else {
$message = t('<br>Since the scheduled publish date has already passed, this draft will publish immediately if it is approved. Remove or change the publish date if you do not wish for that to occur.');
}
$form['node_revisions_table'][0]['revision']['#context']['message']['#markup'] .= $message;
}
}
Expand Down
4 changes: 2 additions & 2 deletions services/drupal/web/themes/epa_theme/includes/paragraph.inc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function epa_theme_preprocess_paragraph__card(&$variables) {

// If the 'flag layout' field is set, add modifier classes to the card.
if ($style == 'flag') {
if ($card->get('field_flag_card_alignment')->isEmpty()) {
if ($card->get('field_flag_card_alignment')->isEmpty() || $card->get('field_flag_card_alignment')->value == 'default') {
// Add left/right classes based on paragraph index if alignment isn’t
// already set.
if($card->index % 2 == 0) {
Expand Down Expand Up @@ -69,7 +69,7 @@ function epa_theme_preprocess_paragraph__card(&$variables) {
$variables['modifier_classes'] .= ' usa-card--media-right';
}
}
else {
elseif($card->get('field_flag_card_alignment')->value == 'left') {
if (!isset($variables['modifier_classes'])) {
$variables['modifier_classes'] = 'usa-card--media-left';
}
Expand Down

0 comments on commit 3711007

Please sign in to comment.