Tweak top bar
This commit is contained in:
parent
ed6ff4fbf6
commit
f4d7c724cb
3 changed files with 249 additions and 164 deletions
|
|
@ -15,7 +15,7 @@ cd /var/www/html
|
||||||
DRUSH="vendor/bin/drush --root=/var/www/html/web"
|
DRUSH="vendor/bin/drush --root=/var/www/html/web"
|
||||||
|
|
||||||
HAS_TABLES=$($DRUSH sql:query \
|
HAS_TABLES=$($DRUSH sql:query \
|
||||||
"SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='public' AND table_name='config';" \
|
"SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='public' AND table_name='users';" \
|
||||||
2>/dev/null || echo "0")
|
2>/dev/null || echo "0")
|
||||||
|
|
||||||
IS_SETUP=$($DRUSH sql:query \
|
IS_SETUP=$($DRUSH sql:query \
|
||||||
|
|
@ -52,13 +52,13 @@ if [ "$IS_SETUP" != "1" ]; then
|
||||||
|
|
||||||
if ls /var/www/html/config/sync/*.yml >/dev/null 2>&1; then
|
if ls /var/www/html/config/sync/*.yml >/dev/null 2>&1; then
|
||||||
echo "[entrypoint] Importing configuration from sync dir..."
|
echo "[entrypoint] Importing configuration from sync dir..."
|
||||||
$DRUSH config:import -y || echo "[entrypoint] WARNING: config import failed."
|
$DRUSH config:import --partial -y || echo "[entrypoint] WARNING: config import failed."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[entrypoint] Setup complete."
|
echo "[entrypoint] Setup complete."
|
||||||
else
|
else
|
||||||
echo "[entrypoint] Setup already complete, importing configuration..."
|
echo "[entrypoint] Setup already complete, importing configuration..."
|
||||||
$DRUSH config:import -y 2>/dev/null && \
|
$DRUSH config:import -y >/dev/null 2>&1 && \
|
||||||
echo "[entrypoint] Config imported." || \
|
echo "[entrypoint] Config imported." || \
|
||||||
echo "[entrypoint] No config to import, continuing."
|
echo "[entrypoint] No config to import, continuing."
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,111 @@
|
||||||
|
/* ── Hide Olivero's sticky-header toggle ─────────────────── */
|
||||||
|
.sticky-header-toggle {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Header: let the nav take all remaining width ────────── */
|
||||||
|
.site-header__inner__container {
|
||||||
|
gap: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-nav {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Primary nav: flat horizontal list ──────────────────── */
|
||||||
|
.primary-nav__menu--level-1 {
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
border: none !important;
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primary-nav__menu-item--level-1 {
|
||||||
|
border: none !important;
|
||||||
|
background: none !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Plain text nav links */
|
||||||
|
.primary-nav__menu-link--level-1 {
|
||||||
|
font-size: 0.9375rem !important;
|
||||||
|
font-weight: 400 !important;
|
||||||
|
color: #374151 !important;
|
||||||
|
padding: 0.25rem 0.875rem !important;
|
||||||
|
border: none !important;
|
||||||
|
background: none !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primary-nav__menu-link--level-1:hover,
|
||||||
|
.primary-nav__menu-link--level-1:focus {
|
||||||
|
color: #1e3a8a !important;
|
||||||
|
background: none !important;
|
||||||
|
border: none !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Active trail */
|
||||||
|
.primary-nav__menu-link--level-1.primary-nav__menu-link--active-trail {
|
||||||
|
color: #1e3a8a !important;
|
||||||
|
font-weight: 500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Push CTA group to the far right ────────────────────── */
|
||||||
|
.primary-nav__menu-item--level-1:has(> .nav-cta) {
|
||||||
|
margin-left: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primary-nav__menu-item--level-1:has(> .nav-cta)
|
||||||
|
~ .primary-nav__menu-item--level-1:has(> .nav-cta) {
|
||||||
|
margin-left: 0.5rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── CTA buttons — rectangular ──────────────────────────── */
|
||||||
.primary-nav__menu-link.nav-cta {
|
.primary-nav__menu-link.nav-cta {
|
||||||
border: 2px solid #3b82f6;
|
display: inline-block !important;
|
||||||
border-radius: 999px;
|
padding: 0.5rem 1.25rem !important;
|
||||||
color: #3b82f6;
|
border-radius: 4px !important;
|
||||||
padding: 0.25rem 1rem;
|
font-size: 0.9rem !important;
|
||||||
transition: background 0.15s, color 0.15s;
|
font-weight: 500 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
transition: background 0.15s, color 0.15s, border-color 0.15s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.primary-nav__menu-link.nav-cta:hover,
|
/* Contact: outlined */
|
||||||
.primary-nav__menu-link.nav-cta:focus {
|
.primary-nav__menu-link.nav-cta:not(.nav-cta--primary) {
|
||||||
background: #3b82f6;
|
background: transparent !important;
|
||||||
border-color: #3b82f6;
|
color: #1e3a5f !important;
|
||||||
color: #fff;
|
border: 1.5px solid #1e3a5f !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.primary-nav__menu-link.nav-cta:not(.nav-cta--primary):hover,
|
||||||
|
.primary-nav__menu-link.nav-cta:not(.nav-cta--primary):focus {
|
||||||
|
background: #1e3a5f !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Book An Appointment: filled */
|
||||||
.primary-nav__menu-link.nav-cta--primary {
|
.primary-nav__menu-link.nav-cta--primary {
|
||||||
background: #3b82f6;
|
background: #1e3a5f !important;
|
||||||
border-color: #3b82f6;
|
color: #fff !important;
|
||||||
color: #fff;
|
border: 1.5px solid #1e3a5f !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.primary-nav__menu-link.nav-cta--primary:hover,
|
.primary-nav__menu-link.nav-cta--primary:hover,
|
||||||
.primary-nav__menu-link.nav-cta--primary:focus {
|
.primary-nav__menu-link.nav-cta--primary:focus {
|
||||||
background: #1d4ed8;
|
background: #152a45 !important;
|
||||||
border-color: #1d4ed8;
|
border-color: #152a45 !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Inner span inside each link — remove Olivero padding ── */
|
||||||
|
.primary-nav__menu-link-inner--level-1 {
|
||||||
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,26 +9,38 @@ use Drupal\field\Entity\FieldStorageConfig;
|
||||||
use Drupal\field\Entity\FieldConfig;
|
use Drupal\field\Entity\FieldConfig;
|
||||||
|
|
||||||
function riverside_pt_install() {
|
function riverside_pt_install() {
|
||||||
array_walk([
|
// Pass 1: types, roles, and field storages (no inter-dependencies).
|
||||||
// Appointment
|
|
||||||
NodeType::create([
|
NodeType::create([
|
||||||
'type' => 'appointment',
|
'type' => 'appointment',
|
||||||
'name' => 'Appointment',
|
'name' => 'Appointment',
|
||||||
'description' => 'A booking between a Patient and a Provider at a particular time.',
|
'description' => 'A booking between a Patient and a Provider at a particular time.',
|
||||||
'new_revision' => FALSE,
|
'new_revision' => FALSE,
|
||||||
'display_submitted' => FALSE,
|
'display_submitted' => FALSE,
|
||||||
]),
|
])->save();
|
||||||
|
|
||||||
|
NodeType::create([
|
||||||
|
'type' => 'provider_availability',
|
||||||
|
'name' => 'Provider Availability',
|
||||||
|
'description' => 'A window of time during which a Provider is available for appointments.',
|
||||||
|
'new_revision' => FALSE,
|
||||||
|
'display_submitted' => FALSE,
|
||||||
|
])->save();
|
||||||
|
|
||||||
|
Role::create(['id' => 'provider', 'label' => 'Provider'])->save();
|
||||||
|
|
||||||
FieldStorageConfig::create([
|
FieldStorageConfig::create([
|
||||||
'field_name' => 'field_appointment_date',
|
'field_name' => 'field_appointment_date',
|
||||||
'entity_type' => 'node',
|
'entity_type' => 'node',
|
||||||
'type' => 'datetime',
|
'type' => 'datetime',
|
||||||
'settings' => ['datetime_type' => 'datetime'],
|
'settings' => ['datetime_type' => 'datetime'],
|
||||||
]),
|
])->save();
|
||||||
|
|
||||||
FieldStorageConfig::create([
|
FieldStorageConfig::create([
|
||||||
'field_name' => 'field_duration_minutes',
|
'field_name' => 'field_duration_minutes',
|
||||||
'entity_type' => 'node',
|
'entity_type' => 'node',
|
||||||
'type' => 'integer',
|
'type' => 'integer',
|
||||||
]),
|
])->save();
|
||||||
|
|
||||||
FieldStorageConfig::create([
|
FieldStorageConfig::create([
|
||||||
'field_name' => 'field_service_type',
|
'field_name' => 'field_service_type',
|
||||||
'entity_type' => 'node',
|
'entity_type' => 'node',
|
||||||
|
|
@ -41,34 +53,57 @@ function riverside_pt_install() {
|
||||||
'neurological_pt' => 'Neurological PT',
|
'neurological_pt' => 'Neurological PT',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
]),
|
])->save();
|
||||||
|
|
||||||
FieldStorageConfig::create([
|
FieldStorageConfig::create([
|
||||||
'field_name' => 'field_provider',
|
'field_name' => 'field_provider',
|
||||||
'entity_type' => 'node',
|
'entity_type' => 'node',
|
||||||
'type' => 'entity_reference',
|
'type' => 'entity_reference',
|
||||||
'settings' => ['target_type' => 'user'],
|
'settings' => ['target_type' => 'user'],
|
||||||
]),
|
])->save();
|
||||||
|
|
||||||
|
FieldStorageConfig::create([
|
||||||
|
'field_name' => 'field_start_datetime',
|
||||||
|
'entity_type' => 'node',
|
||||||
|
'type' => 'datetime',
|
||||||
|
'settings' => ['datetime_type' => 'datetime'],
|
||||||
|
])->save();
|
||||||
|
|
||||||
|
FieldStorageConfig::create([
|
||||||
|
'field_name' => 'field_end_datetime',
|
||||||
|
'entity_type' => 'node',
|
||||||
|
'type' => 'datetime',
|
||||||
|
'settings' => ['datetime_type' => 'datetime'],
|
||||||
|
])->save();
|
||||||
|
|
||||||
|
// Clear field definition cache so FieldConfig::preSave() can find the storages.
|
||||||
|
\Drupal::service('entity_field.manager')->clearCachedFieldDefinitions();
|
||||||
|
|
||||||
|
// Pass 2: field configs (depend on storages being in the DB).
|
||||||
FieldConfig::create([
|
FieldConfig::create([
|
||||||
'field_name' => 'field_appointment_date',
|
'field_name' => 'field_appointment_date',
|
||||||
'entity_type' => 'node',
|
'entity_type' => 'node',
|
||||||
'bundle' => 'appointment',
|
'bundle' => 'appointment',
|
||||||
'label' => 'Appointment Date',
|
'label' => 'Appointment Date',
|
||||||
'required' => TRUE,
|
'required' => TRUE,
|
||||||
]),
|
])->save();
|
||||||
|
|
||||||
FieldConfig::create([
|
FieldConfig::create([
|
||||||
'field_name' => 'field_duration_minutes',
|
'field_name' => 'field_duration_minutes',
|
||||||
'entity_type' => 'node',
|
'entity_type' => 'node',
|
||||||
'bundle' => 'appointment',
|
'bundle' => 'appointment',
|
||||||
'label' => 'Duration (Minutes)',
|
'label' => 'Duration (Minutes)',
|
||||||
'required' => TRUE,
|
'required' => TRUE,
|
||||||
]),
|
])->save();
|
||||||
|
|
||||||
FieldConfig::create([
|
FieldConfig::create([
|
||||||
'field_name' => 'field_service_type',
|
'field_name' => 'field_service_type',
|
||||||
'entity_type' => 'node',
|
'entity_type' => 'node',
|
||||||
'bundle' => 'appointment',
|
'bundle' => 'appointment',
|
||||||
'label' => 'Service Type',
|
'label' => 'Service Type',
|
||||||
'required' => TRUE,
|
'required' => TRUE,
|
||||||
]),
|
])->save();
|
||||||
|
|
||||||
FieldConfig::create([
|
FieldConfig::create([
|
||||||
'field_name' => 'field_provider',
|
'field_name' => 'field_provider',
|
||||||
'entity_type' => 'node',
|
'entity_type' => 'node',
|
||||||
|
|
@ -78,40 +113,11 @@ function riverside_pt_install() {
|
||||||
'settings' => [
|
'settings' => [
|
||||||
'handler' => 'default:user',
|
'handler' => 'default:user',
|
||||||
'handler_settings' => [
|
'handler_settings' => [
|
||||||
'filter' => [
|
'filter' => ['type' => '_role', 'role' => ['provider' => 'provider']],
|
||||||
'type' => '_role',
|
|
||||||
'role' => ['provider' => 'provider'],
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
])->save();
|
||||||
]),
|
|
||||||
|
|
||||||
// Provider
|
|
||||||
Role::create([
|
|
||||||
'id' => 'provider',
|
|
||||||
'label' => 'Provider',
|
|
||||||
]),
|
|
||||||
|
|
||||||
// Provider Availability
|
|
||||||
NodeType::create([
|
|
||||||
'type' => 'provider_availability',
|
|
||||||
'name' => 'Provider Availability',
|
|
||||||
'description' => 'A window of time during which a Provider is available for appointments.',
|
|
||||||
'new_revision' => FALSE,
|
|
||||||
'display_submitted' => FALSE,
|
|
||||||
]),
|
|
||||||
FieldStorageConfig::create([
|
|
||||||
'field_name' => 'field_start_datetime',
|
|
||||||
'entity_type' => 'node',
|
|
||||||
'type' => 'datetime',
|
|
||||||
'settings' => ['datetime_type' => 'datetime'],
|
|
||||||
]),
|
|
||||||
FieldStorageConfig::create([
|
|
||||||
'field_name' => 'field_end_datetime',
|
|
||||||
'entity_type' => 'node',
|
|
||||||
'type' => 'datetime',
|
|
||||||
'settings' => ['datetime_type' => 'datetime'],
|
|
||||||
]),
|
|
||||||
FieldConfig::create([
|
FieldConfig::create([
|
||||||
'field_name' => 'field_provider',
|
'field_name' => 'field_provider',
|
||||||
'entity_type' => 'node',
|
'entity_type' => 'node',
|
||||||
|
|
@ -121,28 +127,26 @@ function riverside_pt_install() {
|
||||||
'settings' => [
|
'settings' => [
|
||||||
'handler' => 'default:user',
|
'handler' => 'default:user',
|
||||||
'handler_settings' => [
|
'handler_settings' => [
|
||||||
'filter' => [
|
'filter' => ['type' => '_role', 'role' => ['provider' => 'provider']],
|
||||||
'type' => '_role',
|
|
||||||
'role' => ['provider' => 'provider'],
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
])->save();
|
||||||
]),
|
|
||||||
FieldConfig::create([
|
FieldConfig::create([
|
||||||
'field_name' => 'field_start_datetime',
|
'field_name' => 'field_start_datetime',
|
||||||
'entity_type' => 'node',
|
'entity_type' => 'node',
|
||||||
'bundle' => 'provider_availability',
|
'bundle' => 'provider_availability',
|
||||||
'label' => 'Start',
|
'label' => 'Start',
|
||||||
'required' => TRUE,
|
'required' => TRUE,
|
||||||
]),
|
])->save();
|
||||||
|
|
||||||
FieldConfig::create([
|
FieldConfig::create([
|
||||||
'field_name' => 'field_end_datetime',
|
'field_name' => 'field_end_datetime',
|
||||||
'entity_type' => 'node',
|
'entity_type' => 'node',
|
||||||
'bundle' => 'provider_availability',
|
'bundle' => 'provider_availability',
|
||||||
'label' => 'End',
|
'label' => 'End',
|
||||||
'required' => TRUE,
|
'required' => TRUE,
|
||||||
]),
|
])->save();
|
||||||
], fn($entity) => $entity->save());
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_riverside_pt_build_navigation();
|
_riverside_pt_build_navigation();
|
||||||
|
|
@ -159,15 +163,12 @@ function riverside_pt_install() {
|
||||||
function _riverside_pt_build_navigation(): void {
|
function _riverside_pt_build_navigation(): void {
|
||||||
$em = \Drupal::entityTypeManager();
|
$em = \Drupal::entityTypeManager();
|
||||||
|
|
||||||
// Remove whatever links Standard profile put in the main menu.
|
|
||||||
foreach ($em->getStorage('menu_link_content')->loadByProperties(['menu_name' => 'main']) as $link) {
|
foreach ($em->getStorage('menu_link_content')->loadByProperties(['menu_name' => 'main']) as $link) {
|
||||||
$link->delete();
|
$link->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create placeholder basic pages.
|
|
||||||
foreach (['Services', 'About', 'FAQ', 'Contact'] as $title) {
|
foreach (['Services', 'About', 'FAQ', 'Contact'] as $title) {
|
||||||
$existing = $em->getStorage('node')->loadByProperties(['title' => $title, 'type' => 'page']);
|
if ($em->getStorage('node')->loadByProperties(['title' => $title, 'type' => 'page'])) {
|
||||||
if ($existing) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$node = Node::create(['type' => 'page', 'title' => $title, 'status' => 1]);
|
$node = Node::create(['type' => 'page', 'title' => $title, 'status' => 1]);
|
||||||
|
|
@ -179,7 +180,6 @@ function _riverside_pt_build_navigation(): void {
|
||||||
])->save();
|
])->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the primary navigation.
|
|
||||||
$defs = [
|
$defs = [
|
||||||
['title' => 'Home', 'uri' => 'route:<front>', 'weight' => 0, 'class' => NULL],
|
['title' => 'Home', 'uri' => 'route:<front>', 'weight' => 0, 'class' => NULL],
|
||||||
['title' => 'Services', 'uri' => 'internal:/services', 'weight' => 1, 'class' => NULL],
|
['title' => 'Services', 'uri' => 'internal:/services', 'weight' => 1, 'class' => NULL],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue