Initial Drupal 11 with DDEV setup
This commit is contained in:
@ -0,0 +1,40 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation to display a navigation_block.
|
||||
*
|
||||
* Available variables:
|
||||
* - plugin_id: The ID of the navigation_block implementation.
|
||||
* - label: The configured label of the navigation_block if visible.
|
||||
* - configuration: A list of the navigation_block's configuration values.
|
||||
* - label: The configured label for the navigation_block.
|
||||
* - label_display: The display settings for the label.
|
||||
* - provider: The module or other provider that provided this
|
||||
navigation_block plugin.
|
||||
* - Navigation block plugin specific settings will also be stored here.
|
||||
* - content: The content of this navigation_block.
|
||||
* - attributes: array of HTML attributes populated by modules, intended to
|
||||
* be added to the main container tag of this template.
|
||||
* - id: A valid HTML ID and guaranteed unique.
|
||||
* - title_attributes: Same as attributes, except applied to the main title
|
||||
* 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.
|
||||
*
|
||||
* @see template_preprocess_navigation_block()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
<div{{ attributes.addClass('toolbar-block') }}>
|
||||
{{ title_prefix }}
|
||||
{% if label %}
|
||||
<h2{{ title_attributes.addClass('toolbar-block__title').setAttribute('data-drupal-tooltip', label).setAttribute('data-drupal-tooltip-class', 'toolbar-block__title-tooltip') }}>{{ label }}</h2>
|
||||
{% endif %}
|
||||
{{ title_suffix }}
|
||||
{% block content %}
|
||||
{{ content }}
|
||||
{% endblock %}
|
||||
</div>
|
||||
4
web/core/modules/navigation/templates/logo.svg.twig
Normal file
4
web/core/modules/navigation/templates/logo.svg.twig
Normal file
@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 32 32" role="img" aria-label="{{ label }}">
|
||||
<rect fill="{{ bg_color|default('#347efe') }}" width="32" height="32" rx="8"/>
|
||||
<path fill="{{ fg_color|default('#fff') }}" d="M19,10.3C17.67,9,16.38,7.68,16,6.23,15.62,7.67,14.33,9,13,10.3c-2,2-4.31,4.31-4.31,7.74a7.32,7.32,0,0,0,14.64,0C23.32,14.61,21,12.32,19,10.3Zm-7.22,9.44c-.45,0-2.11-2.87,1-5.91l2,2.22a.18.18,0,0,1,0,.25h0A19.3,19.3,0,0,0,12,19.6C11.92,19.75,11.83,19.74,11.79,19.74ZM16,23.51A2.52,2.52,0,0,1,13.48,21a2.56,2.56,0,0,1,.63-1.66c.45-.56,1.89-2.12,1.89-2.12s1.41,1.59,1.89,2.11A2.5,2.5,0,0,1,18.52,21,2.52,2.52,0,0,1,16,23.51Zm4.82-4.09c-.06.12-.18.32-.35.33s-.32-.14-.55-.47c-.48-.71-4.67-5.09-5.46-5.94s-.09-1.27.18-1.55L16,10.44a35.72,35.72,0,0,1,4.25,4.8A4.5,4.5,0,0,1,20.82,19.42Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 841 B |
@ -0,0 +1,33 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation to display a single message in the navigation toolbar.
|
||||
*
|
||||
* Available variables:
|
||||
* - content: The message to display.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'toolbar-message',
|
||||
'toolbar-message--type--' ~ type,
|
||||
]
|
||||
%}
|
||||
|
||||
{% if url is not empty %}
|
||||
<a {{ attributes.addClass(classes).setAttribute('href', url).setAttribute('data-drupal-tooltip', content).setAttribute('data-drupal-tooltip-class', 'admin-toolbar__tooltip') }}>
|
||||
{{ icon('navigation', type, { class: 'toolbar-message__icon', size: 20 }) }}
|
||||
<div class="toolbar-message__label">
|
||||
{{ content }}
|
||||
</div>
|
||||
</a>
|
||||
{% else %}
|
||||
<div {{ attributes.addClass(classes) }}>
|
||||
{{ icon('navigation', type, { class: 'toolbar-message__icon', size: 20 }) }}
|
||||
<div class="toolbar-message__label">
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -0,0 +1,17 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation to display messages in the navigation toolbar.
|
||||
*
|
||||
* Available variables:
|
||||
* - messages: An array containing the messages to display.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{{ attach_library('navigation/internal.navigation-messages') }}
|
||||
<div class="toolbar-block__list">
|
||||
{% for message in message_list %}
|
||||
{{ message }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@ -0,0 +1,17 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation to display the navigation content_top section.
|
||||
*
|
||||
* Available variables:
|
||||
* - items: An associative array of renderable elements to display in the
|
||||
* content_top section.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{% if items is not empty %}
|
||||
<div class="admin-toolbar__content-top">
|
||||
{{ items }}
|
||||
</div>
|
||||
{% endif %}
|
||||
152
web/core/modules/navigation/templates/navigation-menu.html.twig
Normal file
152
web/core/modules/navigation/templates/navigation-menu.html.twig
Normal file
@ -0,0 +1,152 @@
|
||||
{% import _self as menus %}
|
||||
<div class="admin-toolbar__item">
|
||||
<h4 class="visually-hidden focusable">{{ title }}</h4>
|
||||
<ul class="toolbar-block__list">
|
||||
{{ menus.menu_items(items, attributes, 0) }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% macro menu_items(items, attributes, menu_level) %}
|
||||
{% for item in items %}
|
||||
|
||||
{% set item_link_tag = 'a' %}
|
||||
|
||||
{% if item.url.isRouted %}
|
||||
{% if item.url.routeName == '<nolink>' %}
|
||||
{% set item_link_tag = constant('\\Drupal\\Core\\GeneratedNoLink::TAG') %}
|
||||
{% elseif item.url.routeName == '<button>' %}
|
||||
{% set item_link_tag = constant('\\Drupal\\Core\\GeneratedButton::TAG') %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if item.url.options.attributes is empty %}
|
||||
{% set item_link_attributes = create_attribute() %}
|
||||
{% else %}
|
||||
{% set item_link_attributes = create_attribute(item.url.options.attributes) %}
|
||||
{% endif %}
|
||||
|
||||
{% set item_id = ('navigation-link--' ~ item.original_link.pluginId)|clean_unique_id %}
|
||||
{% if menu_level == 0 %}
|
||||
{% if item.below is empty %}
|
||||
<li id="{{ item_id }}" class="toolbar-block__list-item">
|
||||
{% include 'navigation:toolbar-button' with {
|
||||
attributes: item_link_attributes.setAttribute('href', item.url|render|default(null)).setAttribute('data-drupal-tooltip', item.title).setAttribute('data-drupal-tooltip-class', 'admin-toolbar__tooltip'),
|
||||
icon: item.icon,
|
||||
html_tag: item_link_tag,
|
||||
text: item.title,
|
||||
modifiers: [
|
||||
'collapsible',
|
||||
item_link_tag == 'span' ? 'non-interactive' : null
|
||||
]|filter(v => v is not null),
|
||||
} only %}
|
||||
</li>
|
||||
{% else %}
|
||||
<li id="{{ item_id }}" class="toolbar-block__list-item toolbar-popover" data-toolbar-popover>
|
||||
{% include 'navigation:toolbar-button' with {
|
||||
action: 'Extend'|t,
|
||||
attributes: create_attribute({
|
||||
'aria-expanded': 'false',
|
||||
'aria-controls': item_id,
|
||||
'data-toolbar-popover-control': true,
|
||||
'data-has-safe-triangle': true,
|
||||
}),
|
||||
icon: item.icon,
|
||||
text: item.title,
|
||||
modifiers: [
|
||||
'expand--side',
|
||||
'collapsible',
|
||||
],
|
||||
extra_classes: [
|
||||
'toolbar-popover__control',
|
||||
],
|
||||
} only %}
|
||||
<div class="toolbar-popover__wrapper" data-toolbar-popover-wrapper inert>
|
||||
{% if item.url %}
|
||||
{% include 'navigation:toolbar-button' with {
|
||||
attributes: item_link_attributes.setAttribute('href', item.url|render),
|
||||
html_tag: item_link_tag,
|
||||
text: item.title,
|
||||
modifiers: [
|
||||
'large',
|
||||
'dark',
|
||||
],
|
||||
extra_classes: [
|
||||
'toolbar-popover__header',
|
||||
],
|
||||
} only %}
|
||||
{% else %}
|
||||
{% include 'navigation:toolbar-button' with {
|
||||
attributes: create_attribute(),
|
||||
modifiers: [
|
||||
'large',
|
||||
'dark',
|
||||
'non-interactive',
|
||||
],
|
||||
extra_classes: [
|
||||
'toolbar-popover__header',
|
||||
],
|
||||
html_tag: 'span',
|
||||
text: item.title,
|
||||
} only %}
|
||||
{% endif %}
|
||||
<ul class="toolbar-menu toolbar-popover__menu">
|
||||
{{ menus.menu_items(item.below, attributes, 1) }}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% elseif menu_level == 1 %}
|
||||
<li class="toolbar-menu__item toolbar-menu__item--level-{{ menu_level }}">
|
||||
{% if item.below is empty %}
|
||||
{% include 'navigation:toolbar-button' with {
|
||||
attributes: item_link_attributes.setAttribute('href', item.url|render|default(null)),
|
||||
text: item.title,
|
||||
html_tag: item_link_tag,
|
||||
extra_classes: [
|
||||
item_link_tag == 'span' ? 'toolbar-button--non-interactive'
|
||||
],
|
||||
} only %}
|
||||
{% else %}
|
||||
{% include 'navigation:toolbar-button' with {
|
||||
attributes: create_attribute({
|
||||
'aria-expanded': 'false',
|
||||
'data-toolbar-menu-trigger': menu_level,
|
||||
}),
|
||||
text: item.title,
|
||||
modifiers: ['expand--down'],
|
||||
} only %}
|
||||
<ul class="toolbar-menu toolbar-menu--level-{{ menu_level + 1 }}" inert>
|
||||
{{ menus.menu_items(item.below, attributes, menu_level + 1) }}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="toolbar-menu__item toolbar-menu__item--level-{{ menu_level }}">
|
||||
{% if item.below is empty %}
|
||||
{{ link(item.title, item.url, {
|
||||
'class': [
|
||||
'toolbar-menu__link',
|
||||
'toolbar-menu__link--' ~ menu_level,
|
||||
],
|
||||
'data-index-text': item.title|first|lower
|
||||
}) }}
|
||||
{% else %}
|
||||
<button
|
||||
class="toolbar-menu__link toolbar-menu__link--{{ menu_level }}"
|
||||
data-toolbar-menu-trigger="{{ menu_level }}"
|
||||
aria-expanded="false"
|
||||
data-index-text="{{ item.title|first|lower }}"
|
||||
>
|
||||
<span data-toolbar-action class="toolbar-menu__link-action visually-hidden">{{ 'Extend'|t }}</span>
|
||||
<span class="toolbar-menu__link-title">{{ item.title }}</span>
|
||||
{{ icon('navigation', 'chevron', { class: 'toolbar-menu__chevron', size: 16 }) }}
|
||||
</button>
|
||||
<ul class="toolbar-menu toolbar-menu--level-{{ menu_level + 1 }}" inert>
|
||||
{{ menus.menu_items(item.below, attributes, menu_level + 1) }}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
@ -0,0 +1,12 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation for a single navigation top bar page action.
|
||||
*
|
||||
* Available variables:
|
||||
* - link: Link render element.
|
||||
*/
|
||||
#}
|
||||
<li class="toolbar-dropdown__item">
|
||||
{{ link|add_class('toolbar-dropdown__link') }}
|
||||
</li>
|
||||
@ -0,0 +1,44 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation for navigation top bar page actions.
|
||||
*
|
||||
* Available variables:
|
||||
* - page_actions: Array of page actions for the current route.
|
||||
* - featured_page_actions: The page actions to show featured before the dropdown.
|
||||
*/
|
||||
#}
|
||||
{% set dropdown_id = 'top-bar-page-actions'|clean_unique_id %}
|
||||
|
||||
{% for featured_page_action in featured_page_actions %}
|
||||
{% set link = featured_page_action.page_action['#link'] %}
|
||||
{% include 'navigation:toolbar-button' with {
|
||||
text: link['#title'],
|
||||
html_tag: 'a',
|
||||
attributes: create_attribute(link['#attributes']|default([])).setAttribute('href', link['#url']|render|default(null)),
|
||||
modifiers: ['primary'],
|
||||
icon: featured_page_action.icon,
|
||||
} only %}
|
||||
{% endfor %}
|
||||
|
||||
{% if page_actions %}
|
||||
{% include 'navigation:toolbar-button' with {
|
||||
icon: { icon_id: 'dots' },
|
||||
action: 'More actions'|t,
|
||||
attributes: create_attribute(
|
||||
{
|
||||
'aria-expanded': 'false',
|
||||
'aria-controls': dropdown_id,
|
||||
'data-drupal-dropdown': 'true'
|
||||
}
|
||||
),
|
||||
} only %}
|
||||
|
||||
<div class="toolbar-dropdown__menu" id={{ dropdown_id }}>
|
||||
<ul class="toolbar-dropdown__list">
|
||||
{% for page_action in page_actions %}
|
||||
{{ page_action }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
31
web/core/modules/navigation/templates/top-bar.html.twig
Normal file
31
web/core/modules/navigation/templates/top-bar.html.twig
Normal file
@ -0,0 +1,31 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation for the navigation top bar.
|
||||
*
|
||||
* Available variables:
|
||||
* - element: The top bar render element.
|
||||
* - tools: The tools region of the top bar.
|
||||
* - context: The context region of the top bar.
|
||||
* - actions: The actions region of the top bar.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{% set attributes = create_attribute() %}
|
||||
{% if tools or context|render or actions|render %}
|
||||
<aside {{ attributes.addClass('top-bar').setAttribute('data-drupal-admin-styles', '').setAttribute('aria-labelledby', 'top-bar__title').setAttribute('data-offset-top', true) }}>
|
||||
<h3 id="top-bar__title" class="visually-hidden">{{ 'Administrative top bar'|t }}</h3>
|
||||
<div class="top-bar__content">
|
||||
<div class="top-bar__tools">
|
||||
{{- tools -}}
|
||||
</div>
|
||||
<div class="top-bar__context">
|
||||
{{- context -}}
|
||||
</div>
|
||||
<div class="top-bar__actions">
|
||||
{{- actions -}}
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user