Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHS-5184: Add active trail indicator to main nav #1435

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dependencies:
config:
- field.field.paragraph.hs_collection.field_hs_collection_items
- field.field.paragraph.hs_collection.field_hs_collection_per_row
- field.field.paragraph.hs_collection.field_hs_collection_uh
- field.field.paragraph.hs_collection.field_paragraph_style
- field.field.paragraph.hs_collection.field_raised_cards
- paragraphs.paragraphs_type.hs_collection
Expand All @@ -17,7 +18,7 @@ mode: default
content:
field_hs_collection_items:
type: paragraphs_browser
weight: 3
weight: 4
region: content
settings:
title: Component
Expand All @@ -36,13 +37,40 @@ content:
paragraphs_browser: content
modal_width: 80%
modal_height: auto
show_group_label: true
show_group_filter: true
third_party_settings: { }
field_hs_collection_per_row:
type: options_select
weight: 0
region: content
settings: { }
third_party_settings: { }
field_hs_collection_uh:
type: boolean_checkbox
weight: 3
region: content
settings:
display_label: true
third_party_settings:
conditional_fields:
d755369a-3372-40fb-896b-2cfddbdaff67:
entity_type: paragraph
bundle: hs_collection
dependee: field_raised_cards
settings:
state: visible
reset: false
condition: checked
grouping: AND
values_set: 1
value: ''
values: { }
value_form:
value: false
effect: show
effect_options: { }
selector: ''
field_paragraph_style:
type: options_select
weight: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dependencies:
config:
- field.field.paragraph.hs_collection.field_hs_collection_items
- field.field.paragraph.hs_collection.field_hs_collection_per_row
- field.field.paragraph.hs_collection.field_hs_collection_uh
- field.field.paragraph.hs_collection.field_paragraph_style
- field.field.paragraph.hs_collection.field_raised_cards
- paragraphs.paragraphs_type.hs_collection
Expand All @@ -26,6 +27,7 @@ content:
region: content
hidden:
field_hs_collection_per_row: true
field_hs_collection_uh: true
field_paragraph_style: true
field_raised_cards: true
search_api_excerpt: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
uuid: 0297c036-02a9-4fd7-8d37-b9effb034279
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_hs_collection_uh
- paragraphs.paragraphs_type.hs_collection
id: paragraph.hs_collection.field_hs_collection_uh
field_name: field_hs_collection_uh
entity_type: paragraph
bundle: hs_collection
label: 'Uniform Height'
description: 'Applies the uniform height styling to the raised cards. This option is decorative.'
required: false
translatable: false
default_value:
-
value: 1
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
18 changes: 18 additions & 0 deletions config/default/field.storage.paragraph.field_hs_collection_uh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
uuid: c9d0623e-1800-4484-ba92-5fdfb0e22159
langcode: en
status: true
dependencies:
module:
- paragraphs
id: paragraph.field_hs_collection_uh
field_name: field_hs_collection_uh
entity_type: paragraph
type: boolean
settings: { }
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
14 changes: 12 additions & 2 deletions config/default/image.style.postcard_vertical_linked_465px_.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
uuid: 0efc58c0-7388-4724-8a2c-27e9449a9e1a
langcode: en
status: true
dependencies: { }
dependencies:
module:
- focal_point
name: postcard_vertical_linked_465px_
label: 'Postcard Vertical Linked (465px)'
effects: { }
effects:
b23bdb1a-2736-4aad-bcfc-ae1e65188c6a:
uuid: b23bdb1a-2736-4aad-bcfc-ae1e65188c6a
id: focal_point_scale_and_crop
weight: 1
data:
width: 465
height: 323
crop_type: focal_point
2 changes: 2 additions & 0 deletions config/default/user.role.anonymous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- eck
- field_permissions
- media
- media_entity_download
- system
_core:
default_config_hash: j5zLMOdJBqC0bMvSdth5UebkprJB8g_2FXHqhfpJzow
Expand All @@ -15,6 +16,7 @@ weight: -1
is_admin: false
permissions:
- 'access content'
- 'download media'
- 'view any course_collections entities'
- 'view any event_collections entities'
- 'view any publications_collections entities'
Expand Down
2 changes: 2 additions & 0 deletions config/default/user.role.authenticated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
- filter
- fontawesome
- media
- media_entity_download
- shortcut
- system
_core:
Expand All @@ -25,6 +26,7 @@ permissions:
- 'access fontawesome additional settings'
- 'access shortcuts'
- 'delete own files'
- 'download media'
- 'use text format basic_html_without_media'
- 'use text format webform_default'
- 'view any course_collections entities'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* @file
* Deploy hooks for paragraph components.
*/

/**
* Update existing hs_collection content if raised cards is enabled.
*/
function hs_paragraph_types_deploy_hs_collection_uh_field(&$sandbox) {
$paragraph_storage = \Drupal::entityTypeManager()->getStorage('paragraph');
if (empty($sandbox['ids'])) {
$sandbox['ids'] = $paragraph_storage->getQuery()
->accessCheck(FALSE)
->condition('type', 'hs_collection')
->condition('field_raised_cards', TRUE)
->execute();
$sandbox['total'] = count($sandbox['ids']);
}
$paragraph_ids = array_splice($sandbox['ids'], 0, 10);

foreach ($paragraph_storage->loadMultiple($paragraph_ids) as $paragraph) {
$paragraph->set('field_hs_collection_uh', TRUE);
$paragraph->save();
}

$sandbox['#finished'] = count($sandbox['ids']) ? 1 - count($sandbox['ids']) / $sandbox['total'] : 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* hs_postcard.install
*/

use Drupal\user\UserInterface;

/**
* Implements hook_install().
*/
Expand All @@ -21,3 +23,12 @@ function hs_postcard_install() {
}

}

/**
* Set the permissions for the postcard download links.
*/
function hs_postcard_update_10000() {
$perms = ['download media'];
user_role_grant_permissions(UserInterface::ANONYMOUS_ROLE, $perms);
user_role_grant_permissions(UserInterface::AUTHENTICATED_ROLE, $perms);
}

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docroot/themes/humsci/humsci_airy/css/humsci_airy.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function addToCalAria() {
const addToCal = document.querySelectorAll('.addtocal');
const body = document.querySelector('body');

// For each .addtocal button, when clicked, change aria-expanded to true.
addToCal.forEach((button) => {
button.addEventListener('click', () => {
if (button.getAttribute('aria-expanded') === 'true') {
button.setAttribute('aria-expanded', 'false');
} else {
button.setAttribute('aria-expanded', 'true');
}
});
});

// When the body except button is clicked, change aria-expanded to false.
body.addEventListener('click', (e) => {
addToCal.forEach((button) => {
if (e.target !== button) {
button.setAttribute('aria-expanded', 'false');
}
});
});
}

addToCalAria();
1 change: 1 addition & 0 deletions docroot/themes/humsci/humsci_basic/src/scss/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ $fa-font-path: "../../humsci_basic/node_modules/@fortawesome/fontawesome-free/we
'components/pattern.photo-album-grid',
'components/pattern.accordion',
'components/editoria11y', // customizations for editoria11y component.
'components/add-to-cal',

// =====================================================================
// 7. Admin
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.addtocal-inner {
@include hb-global-color('background-color', 'white');

position: relative;
display: flex;
margin-top: -(hb-calculate-rems(38px));
margin-left: -(hb-calculate-rems(4px));
padding: hb-calculate-rems(11px) hb-calculate-rems(6px) hb-calculate-rems(8px) hb-calculate-rems(18px);
border: 2px solid;
border-radius: hb-calculate-rems(12px);

@include hb-pairing-color('border-color', 'tertiary-darken-20');

@include hb-traditional {
margin-top: -(hb-calculate-rems(40px));
border-radius: 0;
}
}

.addtocal-title {
@include hb-pairing-color('color', 'secondary');

font-size: hb-calculate-rems(16px);
margin: 0 hb-calculate-rems(6px);

@include hb-traditional {
margin-left: hb-calculate-rems(11px);
font-family: $hb-traditional-font--sans;
font-weight: hb-theme-font-weight(semibold);
}
}

.addtocal-links {
margin: 0;
}

.addtocal-link {
margin-bottom: hb-calculate-rems(4px);
font-size: hb-calculate-rems(16px);

&:last-child {
margin-bottom: 0;
}

a {
@include hb-global-color('color', 'gray-dark');

display: flex;
align-items: center;
background-image: none;
text-decoration: none;

&:hover,
&:focus {
@include hb-pairing-color('color', 'secondary');

background-image: none;

&::before {
@include hb-icon-background('plus', 'secondary');
}
}

&::before {
@include hb-icon-background('plus', 'white');

content: ' ';
display: block;
width: hb-calculate-rems(10px);
height: hb-calculate-rems(10px);
margin-right: hb-calculate-rems(4px);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,12 @@
left: 0;
}

@include hb-colorful {
.hc-pairing-ocean & {
@include hb-pairing-color('background-color', 'secondary-darken-12');
}
}

&:only-child {
position: relative;
bottom: auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ $item-line-height-lg: 110%;
@include hb-pairing-color('background-color', 'secondary');
}


.js &:hover {
background-color: transparent;

Expand All @@ -301,6 +302,14 @@ $item-line-height-lg: 110%;
}
}

.hb-main-nav__menu-lv1 > .hb-main-nav__item--active-trail > & {
@include grid-media-min('lg') {
.js &:not(.hb-main-nav__link--active-trail)::before {
@include hb-pairing-color('background-color', 'secondary');
}
}
}

.hb-main-nav__menu.hb-main-nav__menu-lv2 & {
@include grid-media-min('lg') {
.js & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
border: none;
@include hb-pairing-color('color', 'tertiary-reversed');
}

@include hb-colorful {
.hc-pairing-ocean & {
@include hb-pairing-color('color', 'secondary-darken-12');
}
}
}
}
}
Expand Down
Loading