Initial Drupal 11 with DDEV setup
This commit is contained in:
@ -0,0 +1,74 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a details element.
|
||||
*
|
||||
* This variation is used for theming the details of a Vertical Tabs element.
|
||||
*
|
||||
* Available variables
|
||||
* - attributes: A list of HTML attributes for the details element.
|
||||
* - errors: (optional) Any errors for this details element, may not be set.
|
||||
* - title: (optional) The title of the element, may not be set.
|
||||
* - description: (optional) The description of the element, may not be set.
|
||||
* - children: (optional) The children of the element, may not be set.
|
||||
* - value: (optional) The value of the element, may not be set.
|
||||
* - accordion: whether the details element should look as an accordion.
|
||||
* - accordion_item: whether the details element is an item of an accordion
|
||||
* list.
|
||||
*
|
||||
* @see template_preprocess_details()
|
||||
* @see claro_preprocess_details()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'claro-details',
|
||||
'claro-details--vertical-tabs-item',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set content_wrapper_classes = [
|
||||
'claro-details__wrapper',
|
||||
'details-wrapper',
|
||||
'claro-details__wrapper--vertical-tabs-item',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set inner_wrapper_classes = [
|
||||
'claro-details__content',
|
||||
'claro-details__content--vertical-tabs-item',
|
||||
]
|
||||
%}
|
||||
<details{{ attributes.addClass(classes) }}>
|
||||
{%- if title -%}
|
||||
{%
|
||||
set summary_classes = [
|
||||
'claro-details__summary',
|
||||
'claro-details__summary--vertical-tabs-item',
|
||||
required ? 'js-form-required',
|
||||
required ? 'form-required',
|
||||
]
|
||||
%}
|
||||
<summary{{ summary_attributes.addClass(summary_classes) }}>
|
||||
{{- title -}}
|
||||
</summary>
|
||||
{%- endif -%}
|
||||
<div{{ content_attributes.addClass(content_wrapper_classes) }}>
|
||||
<div{{ create_attribute({class: inner_wrapper_classes}) }}>
|
||||
{% if errors %}
|
||||
<div class="form-item form-item__error-message">
|
||||
{{ errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- if description -%}
|
||||
<div class="claro-details__description">{{ description }}</div>
|
||||
{%- endif -%}
|
||||
{%- if children -%}
|
||||
{{ children }}
|
||||
{%- endif -%}
|
||||
{%- if value -%}
|
||||
{{ value }}
|
||||
{%- endif -%}
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
@ -0,0 +1,58 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a toolbar menu.
|
||||
*
|
||||
* If Claro is the admin theme, this template will be used by the active theme
|
||||
* even if the active theme is not Claro.
|
||||
*
|
||||
* Available variables:
|
||||
* - menu_name: The machine name of the menu.
|
||||
* - items: A nested list of menu items. Each menu item contains:
|
||||
* - attributes: HTML attributes for the menu item.
|
||||
* - below: The menu item child items.
|
||||
* - title: The menu link title.
|
||||
* - url: The menu link URL, instance of \Drupal\Core\Url
|
||||
* - localized_options: Menu link localized options.
|
||||
* - is_expanded: TRUE if the link has visible children within the current
|
||||
* menu tree.
|
||||
* - is_collapsed: TRUE if the link has children within the current menu tree
|
||||
* that are not currently visible.
|
||||
* - in_active_trail: TRUE if the link is in the active trail.
|
||||
*/
|
||||
#}
|
||||
{% import _self as menus %}
|
||||
|
||||
{#
|
||||
We call a macro which calls itself to render the full tree.
|
||||
@see https://twig.symfony.com/doc/3.x/tags/macro.html
|
||||
#}
|
||||
{{ menus.menu_links(items, attributes, 0) }}
|
||||
|
||||
{% macro menu_links(items, attributes, menu_level) %}
|
||||
{% import _self as menus %}
|
||||
{% if items %}
|
||||
{% if menu_level == 0 %}
|
||||
<ul{{ attributes.addClass('toolbar-menu', 'claro-toolbar-menu') }}>
|
||||
{% else %}
|
||||
<ul class="toolbar-menu">
|
||||
{% endif %}
|
||||
{% for item in items %}
|
||||
{%
|
||||
set classes = [
|
||||
'menu-item',
|
||||
item.is_expanded ? 'menu-item--expanded',
|
||||
item.is_collapsed ? 'menu-item--collapsed',
|
||||
item.in_active_trail ? 'menu-item--active-trail',
|
||||
]
|
||||
%}
|
||||
<li{{ item.attributes.addClass(classes) }}>
|
||||
{{ link(item.title, item.url) }}
|
||||
{% if item.below %}
|
||||
{{ menus.menu_links(item.below, attributes, menu_level + 1) }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
@ -0,0 +1,19 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a local task link.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the wrapper element.
|
||||
* - is_active: Whether the task item is an active tab.
|
||||
* - link: A rendered link element.
|
||||
*
|
||||
* Note: This template renders the content for each task item in
|
||||
* menu-local-tasks.html.twig.
|
||||
*
|
||||
* @see template_preprocess_menu_local_task()
|
||||
*
|
||||
* @todo remove this after https://www.drupal.org/node/3051605 has been solved.
|
||||
*/
|
||||
#}
|
||||
<li{{ attributes.addClass(is_active ? 'is-active') }}>{{ link }}</li>
|
||||
@ -0,0 +1,33 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a local task link.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the wrapper element.
|
||||
* - is_active: Whether the task item is an active tab.
|
||||
* - link: A rendered link element.
|
||||
* - level: The menu level where the tab is rendered.
|
||||
*
|
||||
* Note: This template renders the content for each task item in
|
||||
* menu-local-tasks.html.twig.
|
||||
*
|
||||
* @see template_preprocess_menu_local_task()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'tabs__tab',
|
||||
level == 'primary' ? 'js-tab',
|
||||
is_active ? 'is-active',
|
||||
is_active ? 'js-active-tab',
|
||||
]
|
||||
%}
|
||||
<li{{ attributes.addClass(classes) }}>
|
||||
{{ link }}
|
||||
{% if is_active and level == 'primary' %}
|
||||
<button class="reset-appearance tabs__trigger" type="button" aria-label="{{ 'Tabs display toggle'|t }}" data-drupal-nav-tabs-trigger>
|
||||
{% include "@claro/../images/src/hamburger-menu.svg" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
</li>
|
||||
47
web/core/themes/claro/templates/navigation/toolbar.html.twig
Normal file
47
web/core/themes/claro/templates/navigation/toolbar.html.twig
Normal file
@ -0,0 +1,47 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the administrative toolbar.
|
||||
*
|
||||
* If Claro is the admin theme, this template will be used by the active theme
|
||||
* even if the active theme is not Claro.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the wrapper.
|
||||
* - toolbar_attributes: HTML attributes to apply to the toolbar.
|
||||
* - toolbar_heading: The heading or label for the toolbar.
|
||||
* - tabs: List of tabs for the toolbar.
|
||||
* - attributes: HTML attributes for the tab container.
|
||||
* - link: Link or button for the menu tab.
|
||||
* - trays: Toolbar tray list, each associated with a tab. Each tray in trays
|
||||
* contains:
|
||||
* - attributes: HTML attributes to apply to the tray.
|
||||
* - label: The tray's label.
|
||||
* - links: The tray menu links.
|
||||
* - remainder: Any non-tray, non-tab elements left to be rendered.
|
||||
*
|
||||
* @see template_preprocess_toolbar()
|
||||
*/
|
||||
#}
|
||||
<div{{ attributes.addClass('toolbar', 'claro-toolbar') }}>
|
||||
<nav{{ toolbar_attributes.addClass('toolbar-bar', 'clearfix') }}>
|
||||
<h2 class="visually-hidden">{{ toolbar_heading }}</h2>
|
||||
{% for key, tab in tabs %}
|
||||
{% set tray = trays[key] %}
|
||||
<div{{ tab.attributes.addClass('toolbar-tab') }}>
|
||||
{{ tab.link }}
|
||||
<div{{ tray.attributes }}>
|
||||
{% if tray.label %}
|
||||
<nav class="toolbar-lining clearfix" role="navigation" aria-label="{{ tray.label }}">
|
||||
<h3 class="toolbar-tray-name visually-hidden">{{ tray.label }}</h3>
|
||||
{% else %}
|
||||
<nav class="toolbar-lining clearfix" role="navigation">
|
||||
{% endif %}
|
||||
{{- tray.links -}}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
{{ remainder }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user