Initial Drupal 11 with DDEV setup
This commit is contained in:
@ -0,0 +1,36 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Claro's theme implementation for the content of an administrative block.
|
||||
*
|
||||
* Available variables:
|
||||
* - content: List of administrative menu items. Each menu item contains:
|
||||
* - link: Link to the admin section.
|
||||
* - title: Short name of the section.
|
||||
* - description: Description of the administrative menu item.
|
||||
* - url: URI to the admin section.
|
||||
* - options: URL options. See \Drupal\Core\Url::fromUri() for details.
|
||||
* - attributes: HTML attributes to be added to the element.
|
||||
* - compact: Boolean indicating whether compact mode is turned on or not.
|
||||
*
|
||||
* @see template_preprocess_admin_block_content()
|
||||
* @see claro_preprocess_admin_block_content()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set item_classes = [
|
||||
'admin-item',
|
||||
]
|
||||
%}
|
||||
{% if content %}
|
||||
<dl{{ attributes.addClass('admin-list') }}>
|
||||
{% for item in content %}
|
||||
<div{{ create_attribute({class: item_classes}) }}>
|
||||
<dt class="admin-item__title">{{ item.link }}</dt>
|
||||
{% if item.description %}
|
||||
<dd class="admin-item__description">{{ item.description }}</dd>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
{% endif %}
|
||||
25
web/core/themes/claro/templates/admin/admin-page.html.twig
Normal file
25
web/core/themes/claro/templates/admin/admin-page.html.twig
Normal file
@ -0,0 +1,25 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for an administrative page.
|
||||
*
|
||||
* Available variables:
|
||||
* - system_compact_link: Themed link to toggle compact view.
|
||||
* - containers: An list of administrative blocks keyed by position: left or
|
||||
* right. Contains:
|
||||
* - blocks: A list of blocks within a container.
|
||||
*
|
||||
* @see template_preprocess_admin_page()
|
||||
*/
|
||||
#}
|
||||
|
||||
{{ system_compact_link }}
|
||||
<div class="layout-row clearfix">
|
||||
{% for container in containers %}
|
||||
<div class="layout-column layout-column--half">
|
||||
{% for block in container.blocks %}
|
||||
{{ block }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@ -0,0 +1,19 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a form element in config_translation.
|
||||
*
|
||||
* Available variables:
|
||||
* - element: Array that represents the element shown in the form.
|
||||
* - source: The source of the translation.
|
||||
* - translation: The translation for the target language.
|
||||
*/
|
||||
#}
|
||||
<div class="translation-set layout-row clearfix">
|
||||
<div class="layout-column layout-column--half translation-set__source">
|
||||
{{ element.source }}
|
||||
</div>
|
||||
<div class="layout-column layout-column--half translation-set__translated">
|
||||
{{ element.translation }}
|
||||
</div>
|
||||
</div>
|
||||
36
web/core/themes/claro/templates/admin/indentation.html.twig
Normal file
36
web/core/themes/claro/templates/admin/indentation.html.twig
Normal file
@ -0,0 +1,36 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a set of indentation divs.
|
||||
*
|
||||
* These <div> tags are used for drag and drop tables.
|
||||
*
|
||||
* Available variables:
|
||||
* - size: Optional. The number of indentations to create.
|
||||
*/
|
||||
#}
|
||||
{% if size > 0 %}{% for i in 1..size %}<div class="js-indentation indentation">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="tree"
|
||||
width="25"
|
||||
height="25"
|
||||
viewBox="0 0 25 25">
|
||||
<path
|
||||
class="tree__item tree__item-child-ltr tree__item-child-last-ltr tree__item-horizontal tree__item-horizontal-right"
|
||||
d="M12,12.5 H25"
|
||||
stroke="#888"/>
|
||||
<path
|
||||
class="tree__item tree__item-child-rtl tree__item-child-last-rtl tree__item-horizontal tree__horizontal-left"
|
||||
d="M0,12.5 H13"
|
||||
stroke="#888"/>
|
||||
<path
|
||||
class="tree__item tree__item-child-ltr tree__item-child-rtl tree__item-child-last-ltr tree__item-child-last-rtl tree__vertical tree__vertical-top"
|
||||
d="M12.5,12 v-99"
|
||||
stroke="#888"/>
|
||||
<path
|
||||
class="tree__item tree__item-child-ltr tree__item-child-rtl tree__vertical tree__vertical-bottom"
|
||||
d="M12.5,12 v99"
|
||||
stroke="#888"/>
|
||||
</svg>
|
||||
</div>{% endfor %}{% endif %}
|
||||
@ -0,0 +1,75 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation for the modules listing page.
|
||||
*
|
||||
* Displays a list of all packages in a project.
|
||||
*
|
||||
* Available variables:
|
||||
* - modules: Contains multiple module instances. Each module contains:
|
||||
* - attributes: Attributes on the row.
|
||||
* - checkbox: A checkbox for enabling the module.
|
||||
* - name: The human-readable name of the module.
|
||||
* - id: A unique identifier for interacting with the details element.
|
||||
* - enable_id: A unique identifier for interacting with the checkbox element.
|
||||
* - description: The description of the module.
|
||||
* - machine_name: The module's machine name.
|
||||
* - version: Information about the module version.
|
||||
* - requires: A list of modules that this module requires.
|
||||
* - required_by: A list of modules that require this module.
|
||||
* - links: A list of administration links provided by the module.
|
||||
*
|
||||
* @see template_preprocess_system_modules_details()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
<table class="responsive-enabled module-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="checkbox visually-hidden">{{ 'Installed'|t }}</th>
|
||||
<th class="name visually-hidden">{{ 'Name'|t }}</th>
|
||||
<th class="description visually-hidden priority-low">{{ 'Description'|t }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for module in modules %}
|
||||
<tr{{ module.attributes.addClass('module-list__module') }}>
|
||||
<td class="module-list__checkbox">
|
||||
{{ module.checkbox }}
|
||||
</td>
|
||||
<td class="module-list__module">
|
||||
<label id="{{ module.id }}" for="{{ module.enable_id }}" class="module-list__module-name table-filter-text-source">{{ module.name }}</label>
|
||||
</td>
|
||||
<td class="expand priority-low module-list__description">
|
||||
<details class="js-form-wrapper form-wrapper module-list__module-details claro-details" id="{{ module.enable_id }}-description">
|
||||
<summary aria-controls="{{ module.enable_id }}-description" role="button" aria-expanded="false" class="claro-details__summary module-list__module-summary"><span class="text module-description">{{ module.description }}</span></summary>
|
||||
<div class="claro-details__wrapper module-details__wrapper">
|
||||
<div class="module-details__description">
|
||||
<div class="module-details__requirements">
|
||||
<div class="module-details__requirement">{{ 'Machine name: <span dir="ltr" class="table-filter-text-source">@machine-name</span>'|t({'@machine-name': module.machine_name}) }}</div>
|
||||
{% if module.version %}
|
||||
<div class="module-details__requirement">{{ 'Version: @module-version'|t({'@module-version': module.version}) }}</div>
|
||||
{% endif %}
|
||||
{% if module.requires %}
|
||||
<div class="module-details__requirement">{{ 'Requires: @module-list'|t({'@module-list': module.requires}) }}</div>
|
||||
{% endif %}
|
||||
{% if module.required_by %}
|
||||
<div class="module-details__requirement">{{ 'Required by: @module-list'|t({'@module-list': module.required_by}) }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if module.links %}
|
||||
<div class="module-details__links">
|
||||
{% for link_type in ['help', 'permissions', 'configure'] %}
|
||||
{{ module.links[link_type] }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
@ -0,0 +1,28 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for displaying a tablesort indicator.
|
||||
*
|
||||
* Available variables:
|
||||
* - style: Either 'asc' or 'desc', indicating the sorting direction.
|
||||
*
|
||||
* @todo Remove after https://www.drupal.org/node/1973418 is in.
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'tablesort',
|
||||
'tablesort--' ~ style,
|
||||
]
|
||||
%}
|
||||
<span{{ attributes.addClass(classes) }}>
|
||||
{% if style in ['asc', 'desc'] %}
|
||||
<span class="visually-hidden">
|
||||
{% if style == 'asc' -%}
|
||||
{{ 'Sort ascending'|t }}
|
||||
{% else -%}
|
||||
{{ 'Sort descending'|t }}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
@ -0,0 +1,46 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the version display of a project.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes suitable for a container element.
|
||||
* - title: The title of the project.
|
||||
* - core_compatibility_details: Render array of core compatibility details.
|
||||
* - version: A list of data about the latest released version, containing:
|
||||
* - version: The version number.
|
||||
* - date: The date of the release.
|
||||
* - download_link: The URL for the downloadable file.
|
||||
* - release_link: The URL for the release notes.
|
||||
* - core_compatible: A flag indicating whether the project is compatible
|
||||
* with the currently installed version of Drupal core. This flag is not
|
||||
* set for the Drupal core project itself.
|
||||
* - core_compatibility_message: A message indicating the versions of Drupal
|
||||
* core with which this project is compatible. This message is also
|
||||
* contained within the 'core_compatibility_details' variable documented
|
||||
* above. This message is not set for the Drupal core project itself.
|
||||
*
|
||||
* @see template_preprocess_update_version()
|
||||
*/
|
||||
#}
|
||||
<div class="{{ attributes.class }} project-update__version"{{ attributes|without('class') }}>
|
||||
<div class="layout-row clearfix">
|
||||
<div class="project-update__version-title layout-column layout-column--quarter">{{ title }}</div>
|
||||
<div class="project-update__version-details layout-column layout-column--quarter">
|
||||
<a href="{{ version.release_link }}">{{ version.version }}</a>
|
||||
<span class="project-update__version-date">({{ version.date|date('Y-M-d') }})</span>
|
||||
</div>
|
||||
<div class="layout-column layout-column--half">
|
||||
<ul class="project-update__version-links">
|
||||
<li class="project-update__release-notes-link">
|
||||
<a href="{{ version.release_link }}">{{ 'Release notes'|t }}</a>
|
||||
</li>
|
||||
{% if core_compatibility_details %}
|
||||
<li class="project-update__compatibility-details">
|
||||
{{ core_compatibility_details }}
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,14 @@
|
||||
{% extends "@block/block.html.twig" %}
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for local actions (primary admin actions.)
|
||||
*/
|
||||
#}
|
||||
{% block content %}
|
||||
{% if content %}
|
||||
<ul class="local-actions">
|
||||
{{ content }}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@ -0,0 +1,20 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Claro's theme implementation to display a list of content block types.
|
||||
*
|
||||
* Available variables:
|
||||
* - bundles: List of blockcontent types, each with the following properties:
|
||||
* - label: Block content type label
|
||||
* - add_link: \Drupal\Core\Link link instance to create an entity of this
|
||||
* block content type. This is a GeneratedLink originally and is switched by
|
||||
* claro_preprocess_block_content_add_list().
|
||||
* - description: A description of this content block type.
|
||||
*
|
||||
* @todo Revisit after https://www.drupal.org/node/3026221 has been solved.
|
||||
*
|
||||
* @see template_preprocess_block_content_add_list()
|
||||
* @see claro_preprocess_block_content_add_list()
|
||||
*/
|
||||
#}
|
||||
{% extends '@claro/entity-add-list.html.twig' %}
|
||||
@ -0,0 +1,12 @@
|
||||
{% extends "block.html.twig" %}
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for tabs.
|
||||
*/
|
||||
#}
|
||||
{% block content %}
|
||||
{% if content %}
|
||||
{{ content }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
25
web/core/themes/claro/templates/breadcrumb.html.twig
Normal file
25
web/core/themes/claro/templates/breadcrumb.html.twig
Normal file
@ -0,0 +1,25 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a breadcrumb trail.
|
||||
*
|
||||
* Available variables:
|
||||
* - breadcrumb: Breadcrumb trail items.
|
||||
*/
|
||||
#}
|
||||
{% if breadcrumb %}
|
||||
<nav class="breadcrumb" role="navigation" aria-labelledby="system-breadcrumb">
|
||||
<h2 id="system-breadcrumb" class="visually-hidden">{{ 'Breadcrumb'|t }}</h2>
|
||||
<ol class="breadcrumb__list">
|
||||
{% for item in breadcrumb %}
|
||||
<li class="breadcrumb__item">
|
||||
{% if item.url %}
|
||||
<a href="{{ item.url }}" class="breadcrumb__link">{{ item.text }}</a>
|
||||
{% else %}
|
||||
{{ item.text }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</nav>
|
||||
{% endif %}
|
||||
8
web/core/themes/claro/templates/classy/README.txt
Normal file
8
web/core/themes/claro/templates/classy/README.txt
Normal file
@ -0,0 +1,8 @@
|
||||
WHAT IS THIS DIRECTORY FOR?
|
||||
--------------------------------
|
||||
This directory is for templates previously inherited from the Classy theme.
|
||||
|
||||
WHY WERE CLASSY TEMPLATES COPIED HERE?
|
||||
-------------------------------------------
|
||||
Classy was removed in Drupal 10. To prepare for Classy's removal, templates that
|
||||
would otherwise be inherited from Classy are copied here.
|
||||
@ -0,0 +1,46 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the search form block.
|
||||
*
|
||||
* Available variables:
|
||||
* - plugin_id: The ID of the block implementation.
|
||||
* - label: The configured label of the block if visible.
|
||||
* - configuration: A list of the block's configuration values, including:
|
||||
* - label: The configured label for the block.
|
||||
* - label_display: The display settings for the label.
|
||||
* - provider: The module or other provider that provided this block plugin.
|
||||
* - Block plugin specific settings will also be stored here.
|
||||
* - in_preview: Whether the plugin is being rendered in preview mode.
|
||||
* - content: The content of this block.
|
||||
* - attributes: A list HTML attributes populated by modules, intended to
|
||||
* be added to the main container tag of this template. Includes:
|
||||
* - 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_block()
|
||||
* @see search_preprocess_block()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'block',
|
||||
'block-search',
|
||||
'container-inline',
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
{{ title_prefix }}
|
||||
{% if label %}
|
||||
<h2{{ title_attributes }}>{{ label }}</h2>
|
||||
{% endif %}
|
||||
{{ title_suffix }}
|
||||
{% block content %}
|
||||
{{ content }}
|
||||
{% endblock %}
|
||||
</div>
|
||||
@ -0,0 +1,30 @@
|
||||
{% extends "block.html.twig" %}
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a branding block.
|
||||
*
|
||||
* Each branding element variable (logo, name, slogan) is only available if
|
||||
* enabled in the block configuration.
|
||||
*
|
||||
* Available variables:
|
||||
* - site_logo: Logo for site as defined in Appearance or theme settings.
|
||||
* - site_name: Name for site as defined in Site information settings.
|
||||
* - site_slogan: Slogan for site as defined in Site information settings.
|
||||
*/
|
||||
#}
|
||||
{% block content %}
|
||||
{% if site_logo %}
|
||||
<a href="{{ path('<front>') }}" rel="home" class="site-logo">
|
||||
<img src="{{ site_logo }}" alt="{{ 'Home'|t }}" fetchpriority="high" />
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if site_name %}
|
||||
<div class="site-name">
|
||||
<a href="{{ path('<front>') }}" rel="home">{{ site_name }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if site_slogan %}
|
||||
<div class="site-slogan">{{ site_slogan }}</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@ -0,0 +1,57 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a menu block.
|
||||
*
|
||||
* Available variables:
|
||||
* - plugin_id: The ID of the block implementation.
|
||||
* - label: The configured label of the block if visible.
|
||||
* - configuration: A list of the block's configuration values.
|
||||
* - label: The configured label for the block.
|
||||
* - label_display: The display settings for the label.
|
||||
* - provider: The module or other provider that provided this block plugin.
|
||||
* - Block plugin specific settings will also be stored here.
|
||||
* - in_preview: Whether the plugin is being rendered in preview mode.
|
||||
* - content: The content of this block.
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - id: A valid HTML ID and guaranteed unique.
|
||||
* - title_attributes: HTML attributes for the title element.
|
||||
* - content_attributes: HTML attributes for the content element.
|
||||
* - 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.
|
||||
*
|
||||
* Headings should be used on navigation menus that consistently appear on
|
||||
* multiple pages. When this menu block's label is configured to not be
|
||||
* displayed, it is automatically made invisible using the 'visually-hidden' CSS
|
||||
* class, which still keeps it visible for screen-readers and assistive
|
||||
* technology. Headings allow screen-reader and keyboard only users to navigate
|
||||
* to or skip the links.
|
||||
* See http://juicystudio.com/article/screen-readers-display-none.php and
|
||||
* https://www.w3.org/TR/WCAG-TECHS/H42.html for more information.
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'block',
|
||||
'block-menu',
|
||||
'navigation',
|
||||
'menu--' ~ derivative_plugin_id|clean_class,
|
||||
]
|
||||
%}
|
||||
{% set heading_id = attributes.id ~ '-menu'|clean_id %}
|
||||
<nav role="navigation" aria-labelledby="{{ heading_id }}"{{ attributes.addClass(classes)|without('role', 'aria-labelledby') }}>
|
||||
{# Label. If not displayed, we still provide it for screen readers. #}
|
||||
{% if not configuration.label_display %}
|
||||
{% set title_attributes = title_attributes.addClass('visually-hidden') %}
|
||||
{% endif %}
|
||||
{{ title_prefix }}
|
||||
<h2{{ title_attributes.setAttribute('id', heading_id) }}>{{ configuration.label }}</h2>
|
||||
{{ title_suffix }}
|
||||
|
||||
{# Menu. #}
|
||||
{% block content %}
|
||||
{{ content }}
|
||||
{% endblock %}
|
||||
</nav>
|
||||
45
web/core/themes/claro/templates/classy/block/block.html.twig
Normal file
45
web/core/themes/claro/templates/classy/block/block.html.twig
Normal file
@ -0,0 +1,45 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a block.
|
||||
*
|
||||
* Available variables:
|
||||
* - plugin_id: The ID of the block implementation.
|
||||
* - label: The configured label of the block if visible.
|
||||
* - configuration: A list of the block's configuration values.
|
||||
* - label: The configured label for the block.
|
||||
* - label_display: The display settings for the label.
|
||||
* - provider: The module or other provider that provided this block plugin.
|
||||
* - Block plugin specific settings will also be stored here.
|
||||
* - in_preview: Whether the plugin is being rendered in preview mode.
|
||||
* - content: The content of this 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_block()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'block',
|
||||
'block-' ~ configuration.provider|clean_class,
|
||||
'block-' ~ plugin_id|clean_class,
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
{{ title_prefix }}
|
||||
{% if label %}
|
||||
<h2{{ title_attributes }}>{{ label }}</h2>
|
||||
{% endif %}
|
||||
{{ title_suffix }}
|
||||
{% block content %}
|
||||
{{ content }}
|
||||
{% endblock %}
|
||||
</div>
|
||||
@ -0,0 +1,18 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a filter caption.
|
||||
*
|
||||
* Returns HTML for a captioned image, audio, video or other tag.
|
||||
*
|
||||
* Available variables
|
||||
* - string node: The complete HTML tag whose contents are being captioned.
|
||||
* - string tag: The name of the HTML tag whose contents are being captioned.
|
||||
* - string caption: The caption text.
|
||||
* - string classes: The classes of the captioned HTML tag.
|
||||
*/
|
||||
#}
|
||||
<figure role="group" class="caption caption-{{ tag }}{%- if classes %} {{ classes }}{%- endif %}">
|
||||
{{ node }}
|
||||
<figcaption>{{ caption }}</figcaption>
|
||||
</figure>
|
||||
115
web/core/themes/claro/templates/classy/content/comment.html.twig
Normal file
115
web/core/themes/claro/templates/classy/content/comment.html.twig
Normal file
@ -0,0 +1,115 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for comments.
|
||||
*
|
||||
* Available variables:
|
||||
* - author: (optional) Comment author. Can be a link or plain text.
|
||||
* - content: The content-related items for the comment display. Use
|
||||
* {{ content }} to print them all, or print a subset such as
|
||||
* {{ content.field_example }}. Use the following code to temporarily suppress
|
||||
* the printing of a given child element:
|
||||
* @code
|
||||
* {{ content|without('field_example') }}
|
||||
* @endcode
|
||||
* - created: (optional) Formatted date and time for when the comment was
|
||||
* created. Preprocess functions can reformat it by calling
|
||||
* DateFormatter::format() with the desired parameters on the
|
||||
* 'comment.created' variable.
|
||||
* - changed: (optional) Formatted date and time for when the comment was last
|
||||
* changed. Preprocess functions can reformat it by calling
|
||||
* DateFormatter::format() with the desired parameters on the
|
||||
* 'comment.changed' variable.
|
||||
* - permalink: Comment permalink.
|
||||
* - submitted: (optional) Submission information created from author and
|
||||
* created during template_preprocess_comment().
|
||||
* - user_picture: (optional) The comment author's profile picture.
|
||||
* - status: Comment status. Possible values are:
|
||||
* unpublished, published, or preview.
|
||||
* - title: (optional) Comment title, linked to the comment.
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* The attributes.class may contain one or more of the following classes:
|
||||
* - comment: The current template type; e.g., 'theming hook'.
|
||||
* - by-anonymous: Comment by an unregistered user.
|
||||
* - by-{entity-type}-author: Comment by the author of the parent entity,
|
||||
* eg. by-node-author.
|
||||
* - preview: When previewing a new or edited comment.
|
||||
* The following applies only to viewers who are registered users:
|
||||
* - unpublished: An unpublished comment visible only to administrators.
|
||||
* - 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.
|
||||
* - content_attributes: List of classes for the styling of the comment content.
|
||||
* - title_attributes: Same as attributes, except applied to the main title
|
||||
* tag that appears in the template.
|
||||
* - threaded: A flag indicating whether the comments are threaded or not.
|
||||
*
|
||||
* These variables are provided to give context about the parent comment (if
|
||||
* any, optional):
|
||||
* - parent_comment: Full parent comment entity (if any).
|
||||
* - parent_author: Equivalent to author for the parent comment.
|
||||
* - parent_created: Equivalent to created for the parent comment.
|
||||
* - parent_changed: Equivalent to changed for the parent comment.
|
||||
* - parent_title: Equivalent to title for the parent comment.
|
||||
* - parent_permalink: Equivalent to permalink for the parent comment.
|
||||
* - parent: A text string of parent comment submission information created from
|
||||
* 'parent_author' and 'parent_created' during template_preprocess_comment().
|
||||
* This information is presented to help screen readers follow lengthy
|
||||
* discussion threads. You can hide this from sighted users using the class
|
||||
* visually-hidden.
|
||||
*
|
||||
* These two variables are provided for context:
|
||||
* - comment: Full comment object.
|
||||
* - commented_entity: Entity the comments are attached to.
|
||||
*
|
||||
* @see template_preprocess_comment()
|
||||
*/
|
||||
#}
|
||||
{% if threaded %}
|
||||
{{ attach_library('claro/classy.indented') }}
|
||||
{% endif %}
|
||||
{%
|
||||
set classes = [
|
||||
'comment',
|
||||
'js-comment',
|
||||
status != 'published' ? status,
|
||||
comment.owner.anonymous ? 'by-anonymous',
|
||||
author_id and author_id == commented_entity.getOwnerId() ? 'by-' ~ commented_entity.getEntityTypeId() ~ '-author',
|
||||
]
|
||||
%}
|
||||
<article{{ attributes.addClass(classes) }}>
|
||||
{#
|
||||
Hide the "new" indicator by default, let a piece of JavaScript ask the
|
||||
server which comments are new for the user. Rendering the final "new"
|
||||
indicator here would break the render cache.
|
||||
#}
|
||||
<mark class="hidden" data-comment-timestamp="{{ new_indicator_timestamp }}"></mark>
|
||||
|
||||
{% if submitted %}
|
||||
<footer class="comment__meta">
|
||||
{{ user_picture }}
|
||||
<p class="comment__submitted">{{ submitted }}</p>
|
||||
|
||||
{#
|
||||
Indicate the semantic relationship between parent and child comments for
|
||||
accessibility. The list is difficult to navigate in a screen reader
|
||||
without this information.
|
||||
#}
|
||||
{% if parent %}
|
||||
<p class="parent visually-hidden">{{ parent }}</p>
|
||||
{% endif %}
|
||||
|
||||
{{ permalink }}
|
||||
</footer>
|
||||
{% endif %}
|
||||
|
||||
<div{{ content_attributes.addClass('content') }}>
|
||||
{% if title %}
|
||||
{{ title_prefix }}
|
||||
<h3{{ title_attributes }}>{{ title }}</h3>
|
||||
{{ title_suffix }}
|
||||
{% endif %}
|
||||
{{ content }}
|
||||
</div>
|
||||
</article>
|
||||
@ -0,0 +1,40 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display node links.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: Attributes for the UL containing the list of links.
|
||||
* - links: Links to be output.
|
||||
* Each link will have the following elements:
|
||||
* - link: (optional) A render array that returns a link. See
|
||||
* template_preprocess_links() for details how it is generated.
|
||||
* - text: The link text.
|
||||
* - attributes: HTML attributes for the list item element.
|
||||
* - text_attributes: (optional) HTML attributes for the span element if no
|
||||
* 'url' was supplied.
|
||||
* - heading: (optional) A heading to precede the links.
|
||||
* - text: The heading text.
|
||||
* - level: The heading level (e.g. 'h2', 'h3').
|
||||
* - attributes: (optional) A keyed list of attributes for the heading.
|
||||
* If the heading is a string, it will be used as the text of the heading and
|
||||
* the level will default to 'h2'.
|
||||
*
|
||||
* Headings should be used on navigation menus and any list of links that
|
||||
* consistently appears on multiple pages. To make the heading invisible use
|
||||
* the 'visually-hidden' CSS class. Do not use 'display:none', which
|
||||
* removes it from screen readers and assistive technology. Headings allow
|
||||
* screen reader and keyboard only users to navigate to or skip the links.
|
||||
* See http://juicystudio.com/article/screen-readers-display-none.php and
|
||||
* https://www.w3.org/TR/WCAG-TECHS/H42.html for more information.
|
||||
*
|
||||
* @see \Drupal\Core\Theme\ThemePreprocess::preprocessLinks()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{% if links %}
|
||||
<div class="node__links">
|
||||
{% include "links.html.twig" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -0,0 +1,20 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a marker for new or updated content.
|
||||
*
|
||||
* Available variables:
|
||||
* - status: Number representing the marker status to display. Use the constants
|
||||
* below for comparison:
|
||||
* - MARK_NEW
|
||||
* - MARK_UPDATED
|
||||
* - MARK_READ
|
||||
*/
|
||||
#}
|
||||
{% if logged_in %}
|
||||
{% if status is constant('MARK_NEW') %}
|
||||
<span class="marker">{{ 'New'|t }}</span>
|
||||
{% elseif status is constant('MARK_UPDATED') %}
|
||||
<span class="marker">{{ 'Updated'|t }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@ -0,0 +1,21 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a missing media error.
|
||||
*
|
||||
* Available variables
|
||||
* - message: The message text.
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
*
|
||||
* When a response from the back end can't be returned, a related error message
|
||||
* is displayed from JavaScript.
|
||||
*
|
||||
* @see Drupal.theme.mediaEmbedPreviewError
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{{ attach_library('claro/classy.media_embed_error') }}
|
||||
<div{{ attributes.addClass('media-embed-error', 'media-embed-error--missing-source') }}>
|
||||
{{ message }}
|
||||
</div>
|
||||
@ -0,0 +1,28 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a media item.
|
||||
*
|
||||
* Available variables:
|
||||
* - name: Name of the media.
|
||||
* - content: Media content.
|
||||
*
|
||||
* @see template_preprocess_media()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'media',
|
||||
'media--type-' ~ media.bundle()|clean_class,
|
||||
not media.isPublished() ? 'media--unpublished',
|
||||
view_mode ? 'media--view-mode-' ~ view_mode|clean_class,
|
||||
]
|
||||
%}
|
||||
<article{{ attributes.addClass(classes) }}>
|
||||
{{ title_suffix.contextual_links }}
|
||||
{% if content %}
|
||||
{{ content }}
|
||||
{% endif %}
|
||||
</article>
|
||||
@ -0,0 +1,98 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a node.
|
||||
*
|
||||
* Available variables:
|
||||
* - node: The node entity with limited access to object properties and methods.
|
||||
* Only method names starting with "get", "has", or "is" and a few common
|
||||
* methods such as "id", "label", and "bundle" are available. For example:
|
||||
* - node.getCreatedTime() will return the node creation timestamp.
|
||||
* - node.hasField('field_example') returns TRUE if the node bundle includes
|
||||
* field_example. (This does not indicate the presence of a value in this
|
||||
* field.)
|
||||
* - node.isPublished() will return whether the node is published or not.
|
||||
* Calling other methods, such as node.delete(), will result in an exception.
|
||||
* See \Drupal\node\Entity\Node for a full list of public properties and
|
||||
* methods for the node object.
|
||||
* - label: (optional) The title of the node.
|
||||
* - content: All node items. Use {{ content }} to print them all,
|
||||
* or print a subset such as {{ content.field_example }}. Use
|
||||
* {{ content|without('field_example') }} to temporarily suppress the printing
|
||||
* of a given child element.
|
||||
* - author_picture: The node author user entity, rendered using the "compact"
|
||||
* view mode.
|
||||
* - date: (optional) Themed creation date field.
|
||||
* - author_name: (optional) Themed author name field.
|
||||
* - url: Direct URL of the current node.
|
||||
* - display_submitted: Whether submission information should be displayed.
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* The attributes.class element may contain one or more of the following
|
||||
* classes:
|
||||
* - node: The current template type (also known as a "theming hook").
|
||||
* - node--type-[type]: The current node type. For example, if the node is an
|
||||
* "Article" it would result in "node--type-article". Note that the machine
|
||||
* name will often be in a short form of the human readable label.
|
||||
* - node--view-mode-[view_mode]: The View Mode of the node; for example, a
|
||||
* teaser would result in: "node--view-mode-teaser", and
|
||||
* full: "node--view-mode-full".
|
||||
* The following are controlled through the node publishing options.
|
||||
* - node--promoted: Appears on nodes promoted to the front page.
|
||||
* - node--sticky: Appears on nodes ordered above other non-sticky nodes in
|
||||
* teaser listings.
|
||||
* - node--unpublished: Appears on unpublished nodes visible only to site
|
||||
* admins.
|
||||
* - title_attributes: Same as attributes, except applied to the main title
|
||||
* tag that appears in the template.
|
||||
* - content_attributes: Same as attributes, except applied to the main
|
||||
* content tag that appears in the template.
|
||||
* - author_attributes: Same as attributes, except applied to the author of
|
||||
* the node 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.
|
||||
* - view_mode: View mode; for example, "teaser" or "full".
|
||||
* - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'.
|
||||
* - page: Flag for the full page state. Will be true if view_mode is 'full'.
|
||||
*
|
||||
* @see template_preprocess_node()
|
||||
*
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'node',
|
||||
'node--type-' ~ node.bundle|clean_class,
|
||||
node.isPromoted() ? 'node--promoted',
|
||||
node.isSticky() ? 'node--sticky',
|
||||
not node.isPublished() ? 'node--unpublished',
|
||||
view_mode ? 'node--view-mode-' ~ view_mode|clean_class,
|
||||
]
|
||||
%}
|
||||
{{ attach_library('claro/classy.node') }}
|
||||
<article{{ attributes.addClass(classes) }}>
|
||||
|
||||
{{ title_prefix }}
|
||||
{% if label and not page %}
|
||||
<h2{{ title_attributes }}>
|
||||
<a href="{{ url }}" rel="bookmark">{{ label }}</a>
|
||||
</h2>
|
||||
{% endif %}
|
||||
{{ title_suffix }}
|
||||
|
||||
{% if display_submitted %}
|
||||
<footer class="node__meta">
|
||||
{{ author_picture }}
|
||||
<div{{ author_attributes.addClass('node__submitted') }}>
|
||||
{% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
|
||||
{{ metadata }}
|
||||
</div>
|
||||
</footer>
|
||||
{% endif %}
|
||||
|
||||
<div{{ content_attributes.addClass('node__content') }}>
|
||||
{{ content }}
|
||||
</div>
|
||||
|
||||
</article>
|
||||
@ -0,0 +1,19 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for page titles.
|
||||
*
|
||||
* Available variables:
|
||||
* - title_attributes: HTML attributes for the page title element.
|
||||
* - title_prefix: Additional output populated by modules, intended to be
|
||||
* displayed in front of the main title tag that appears in the template.
|
||||
* - title: The page title, for use in the actual content.
|
||||
* - title_suffix: Additional output populated by modules, intended to be
|
||||
* displayed after the main title tag that appears in the template.
|
||||
*/
|
||||
#}
|
||||
{{ title_prefix }}
|
||||
{% if title %}
|
||||
<h1{{ title_attributes.addClass('page-title') }}>{{ title }}</h1>
|
||||
{% endif %}
|
||||
{{ title_suffix }}
|
||||
@ -0,0 +1,72 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for displaying a single search result.
|
||||
*
|
||||
* This template renders a single search result. The list of results is
|
||||
* rendered using '#theme' => 'item_list', with suggestions of:
|
||||
* - item_list__search_results__(plugin_id)
|
||||
* - item_list__search_results
|
||||
*
|
||||
* Available variables:
|
||||
* - url: URL of the result.
|
||||
* - title: Title of the result.
|
||||
* - snippet: A small preview of the result. Does not apply to user searches.
|
||||
* - info: String of all the meta information ready for print. Does not apply
|
||||
* to user searches.
|
||||
* - plugin_id: The machine-readable name of the plugin being executed,such
|
||||
* as "node_search" or "user_search".
|
||||
* - 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.
|
||||
* - info_split: Contains same data as info, but split into separate parts.
|
||||
* - info_split.type: Node type (or item type string supplied by module).
|
||||
* - info_split.user: Author of the node linked to users profile. Depends
|
||||
* on permission.
|
||||
* - info_split.date: Last update of the node. Short formatted.
|
||||
* - info_split.comment: Number of comments output as "% comments", %
|
||||
* being the count. (Depends on comment.module).
|
||||
* @todo The info variable needs to be made drillable and each of these sub
|
||||
* items should instead be within info and renamed info.foo, info.bar, etc.
|
||||
*
|
||||
* Other variables:
|
||||
* - title_attributes: HTML attributes for the title.
|
||||
* - content_attributes: HTML attributes for the content.
|
||||
*
|
||||
* Since info_split is keyed, a direct print of the item is possible.
|
||||
* This array does not apply to user searches so it is recommended to check
|
||||
* for its existence before printing. The default keys of 'type', 'user' and
|
||||
* 'date' always exist for node searches. Modules may provide other data.
|
||||
* @code
|
||||
* {% if (info_split.comment) %}
|
||||
* <span class="info-comment">
|
||||
* {{ info_split.comment }}
|
||||
* </span>
|
||||
* {% endif %}
|
||||
* @endcode
|
||||
*
|
||||
* To check for all available data within info_split, use the code below.
|
||||
* @code
|
||||
* <pre>
|
||||
* {{ dump(info_split) }}
|
||||
* </pre>
|
||||
* @endcode
|
||||
*
|
||||
* @see template_preprocess_search_result()
|
||||
*/
|
||||
#}
|
||||
{{ attach_library('claro/classy.search-results') }}
|
||||
{{ title_prefix }}
|
||||
<h3{{ title_attributes.addClass('search-result__title') }}>
|
||||
<a href="{{ url }}">{{ title }}</a>
|
||||
</h3>
|
||||
{{ title_suffix }}
|
||||
<div class="search-result__snippet-info">
|
||||
{% if snippet %}
|
||||
<p{{ content_attributes.addClass('search-result__snippet') }}>{{ snippet }}</p>
|
||||
{% endif %}
|
||||
{% if info %}
|
||||
<p class="search-result__info">{{ info }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
@ -0,0 +1,41 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a taxonomy term.
|
||||
*
|
||||
* Available variables:
|
||||
* - url: URL of the current term.
|
||||
* - name: (optional) Name of the current term.
|
||||
* - content: Items for the content of the term (fields and description).
|
||||
* Use 'content' to print them all, or print a subset such as
|
||||
* 'content.description'. Use the following code to exclude the
|
||||
* printing of a given child element:
|
||||
* @code
|
||||
* {{ content|without('description') }}
|
||||
* @endcode
|
||||
* - attributes: HTML attributes for the wrapper.
|
||||
* - page: Flag for the full page state.
|
||||
* - term: The taxonomy term entity, including:
|
||||
* - id: The ID of the taxonomy term.
|
||||
* - bundle: Machine name of the current vocabulary.
|
||||
* - view_mode: View mode, e.g. 'full', 'teaser', etc.
|
||||
*
|
||||
* @see template_preprocess_taxonomy_term()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'taxonomy-term',
|
||||
'vocabulary-' ~ term.bundle|clean_class,
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.setAttribute('id', 'taxonomy-term-' ~ term.id).addClass(classes) }}>
|
||||
{{ title_prefix }}
|
||||
{% if name and not page %}
|
||||
<h2><a href="{{ url }}">{{ name }}</a></h2>
|
||||
{% endif %}
|
||||
{{ title_suffix }}
|
||||
<div class="content">
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,29 @@
|
||||
{% extends "item-list.html.twig" %}
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for an item list of search results.
|
||||
*
|
||||
* Available variables:
|
||||
* - items: A list of items. Each item contains:
|
||||
* - attributes: HTML attributes to be applied to each list item.
|
||||
* - value: The content of the list element.
|
||||
* - title: The title of the list.
|
||||
* - list_type: The tag for list element ("ul" or "ol").
|
||||
* - attributes: HTML attributes to be applied to the list.
|
||||
* - empty: A message to display when there are no items. Allowed value is a
|
||||
* string or render array.
|
||||
* - context: An list of contextual data associated with the list. For search
|
||||
* results, the following data is set:
|
||||
* - plugin: The search plugin ID, for example "node_search".
|
||||
*
|
||||
* @see template_preprocess_item_list()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'search-results',
|
||||
context.plugin ~ '-results',
|
||||
]
|
||||
%}
|
||||
{% set attributes = attributes.addClass(classes) %}
|
||||
@ -0,0 +1,41 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for an item list.
|
||||
*
|
||||
* Available variables:
|
||||
* - items: A list of items. Each item contains:
|
||||
* - attributes: HTML attributes to be applied to each list item.
|
||||
* - value: The content of the list element.
|
||||
* - title: The title of the list.
|
||||
* - list_type: The tag for list element ("ul" or "ol").
|
||||
* - wrapper_attributes: HTML attributes to be applied to the list wrapper.
|
||||
* - attributes: HTML attributes to be applied to the list.
|
||||
* - empty: A message to display when there are no items. Allowed value is a
|
||||
* string or render array.
|
||||
* - context: A list of contextual data associated with the list. May contain:
|
||||
* - list_style: The custom list style.
|
||||
*
|
||||
* @see template_preprocess_item_list()
|
||||
*/
|
||||
#}
|
||||
{% if context.list_style %}
|
||||
{%- set wrapper_attributes = wrapper_attributes.addClass('item-list--' ~ context.list_style) %}
|
||||
{%- set attributes = attributes.addClass('item-list__' ~ context.list_style) %}
|
||||
{% endif %}
|
||||
{% if items or empty -%}
|
||||
<div{{ wrapper_attributes.addClass('item-list') }}>
|
||||
{%- if title is not empty -%}
|
||||
<h3>{{ title }}</h3>
|
||||
{%- endif -%}
|
||||
{%- if items -%}
|
||||
<{{ list_type }}{{ attributes }}>
|
||||
{%- for item in items -%}
|
||||
<li{{ item.attributes }}>{{ item.value }}</li>
|
||||
{%- endfor -%}
|
||||
</{{ list_type }}>
|
||||
{%- else -%}
|
||||
{{- empty -}}
|
||||
{%- endif -%}
|
||||
</div>
|
||||
{%- endif %}
|
||||
115
web/core/themes/claro/templates/classy/dataset/table.html.twig
Normal file
115
web/core/themes/claro/templates/classy/dataset/table.html.twig
Normal file
@ -0,0 +1,115 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a table.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes to apply to the <table> tag.
|
||||
* - caption: A localized string for the <caption> tag.
|
||||
* - colgroups: Column groups. Each group contains the following properties:
|
||||
* - attributes: HTML attributes to apply to the <col> tag.
|
||||
* Note: Drupal currently supports only one table header row, see
|
||||
* https://www.drupal.org/node/893530 and
|
||||
* http://api.drupal.org/api/drupal/includes!theme.inc/function/theme_table/7#comment-5109.
|
||||
* - header: Table header cells. Each cell contains the following properties:
|
||||
* - tag: The HTML tag name to use; either 'th' or 'td'.
|
||||
* - attributes: HTML attributes to apply to the tag.
|
||||
* - content: A localized string for the title of the column.
|
||||
* - field: Field name (required for column sorting).
|
||||
* - sort: Default sort order for this column ("asc" or "desc").
|
||||
* - sticky: A flag indicating whether to use a "sticky" table header.
|
||||
* - rows: Table rows. Each row contains the following properties:
|
||||
* - attributes: HTML attributes to apply to the <tr> tag.
|
||||
* - data: Table cells.
|
||||
* - no_striping: A flag indicating that the row should receive no
|
||||
* 'even / odd' styling. Defaults to FALSE.
|
||||
* - cells: Table cells of the row. Each cell contains the following keys:
|
||||
* - tag: The HTML tag name to use; either 'th' or 'td'.
|
||||
* - attributes: Any HTML attributes, such as "colspan", to apply to the
|
||||
* table cell.
|
||||
* - content: The string to display in the table cell.
|
||||
* - active_table_sort: A boolean indicating whether the cell is the active
|
||||
table sort.
|
||||
* - header: Boolean indicating whether the cell should be rendered as a
|
||||
* header (<th>) or not (<td>).
|
||||
* - footer: Table footer rows, in the same format as the rows variable.
|
||||
* - empty: The message to display in an extra row if table does not have
|
||||
* any rows.
|
||||
* - no_striping: A boolean indicating that the row should receive no striping.
|
||||
* - header_columns: The number of columns in the header.
|
||||
*
|
||||
* @see template_preprocess_table()
|
||||
*/
|
||||
#}
|
||||
<table{{ attributes }}>
|
||||
{% if caption %}
|
||||
<caption>{{ caption }}</caption>
|
||||
{% endif %}
|
||||
|
||||
{% for colgroup in colgroups %}
|
||||
{% if colgroup.cols %}
|
||||
<colgroup{{ colgroup.attributes }}>
|
||||
{% for col in colgroup.cols %}
|
||||
<col{{ col.attributes }} />
|
||||
{% endfor %}
|
||||
</colgroup>
|
||||
{% else %}
|
||||
<colgroup{{ colgroup.attributes }} />
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if header %}
|
||||
<thead>
|
||||
<tr>
|
||||
{% for cell in header %}
|
||||
{%
|
||||
set cell_classes = [
|
||||
cell.active_table_sort ? 'is-active',
|
||||
]
|
||||
%}
|
||||
<{{ cell.tag }}{{ cell.attributes.addClass(cell_classes) }}>
|
||||
{{- cell.content -}}
|
||||
</{{ cell.tag }}>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
{% endif %}
|
||||
|
||||
{% if rows %}
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
{%
|
||||
set row_classes = [
|
||||
not no_striping ? cycle(['odd', 'even'], loop.index0),
|
||||
]
|
||||
%}
|
||||
<tr{{ row.attributes.addClass(row_classes) }}>
|
||||
{% for cell in row.cells %}
|
||||
<{{ cell.tag }}{{ cell.attributes }}>
|
||||
{{- cell.content -}}
|
||||
</{{ cell.tag }}>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
{% elseif empty %}
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td colspan="{{ header_columns }}" class="empty message">{{ empty }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
{% endif %}
|
||||
{% if footer %}
|
||||
<tfoot>
|
||||
{% for row in footer %}
|
||||
<tr{{ row.attributes }}>
|
||||
{% for cell in row.cells %}
|
||||
<{{ cell.tag }}{{ cell.attributes }}>
|
||||
{{- cell.content -}}
|
||||
</{{ cell.tag }}>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tfoot>
|
||||
{% endif %}
|
||||
</table>
|
||||
@ -0,0 +1,57 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for comment fields.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - label_hidden: Whether to show the field label or not.
|
||||
* - title_attributes: HTML attributes for the title.
|
||||
* - label: The label for the field.
|
||||
* - 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 title output populated by modules, intended to
|
||||
* be displayed after the main title tag that appears in the template.
|
||||
* - comments: List of comments rendered through comment.html.twig.
|
||||
* - comment_form: The 'Add new comment' form.
|
||||
* - comment_display_mode: Is the comments are threaded.
|
||||
* - comment_type: The comment type bundle ID for the comment field.
|
||||
* - entity_type: The entity type to which the field belongs.
|
||||
* - field_name: The name of the field.
|
||||
* - field_type: The type of the field.
|
||||
* - label_display: The display settings for the label.
|
||||
*
|
||||
* @see template_preprocess_field()
|
||||
* @see comment_preprocess_field()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'field',
|
||||
'field--name-' ~ field_name|clean_class,
|
||||
'field--type-' ~ field_type|clean_class,
|
||||
'field--label-' ~ label_display,
|
||||
'comment-wrapper',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set title_classes = [
|
||||
'title',
|
||||
label_display == 'visually_hidden' ? 'visually-hidden',
|
||||
]
|
||||
%}
|
||||
<section{{ attributes.addClass(classes) }}>
|
||||
{% if comments and not label_hidden %}
|
||||
{{ title_prefix }}
|
||||
<h2{{ title_attributes.addClass(title_classes) }}>{{ label }}</h2>
|
||||
{{ title_suffix }}
|
||||
{% endif %}
|
||||
|
||||
{{ comments }}
|
||||
|
||||
{% if comment_form %}
|
||||
<h2 class="title comment-form__title">{{ 'Add new comment'|t }}</h2>
|
||||
{{ comment_form }}
|
||||
{% endif %}
|
||||
|
||||
</section>
|
||||
@ -0,0 +1,44 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the node created field.
|
||||
*
|
||||
* This is an override of field.html.twig for the node created field. See that
|
||||
* template for documentation about its details and overrides.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing span element.
|
||||
* - items: List of all the field items. Each item contains:
|
||||
* - attributes: List of HTML attributes for each item.
|
||||
* - content: The field item content.
|
||||
* - entity_type: The entity type to which the field belongs.
|
||||
* - field_name: The name of the field.
|
||||
* - field_type: The type of the field.
|
||||
* - label_display: The display settings for the label.
|
||||
* - is_inline: If false, display an ordinary field.
|
||||
* If true, display an inline format, suitable for inside elements such as
|
||||
* <span>, <h2> and so on.
|
||||
*
|
||||
* @see field.html.twig
|
||||
* @see node_preprocess_field__node()
|
||||
*
|
||||
* @todo Delete as part of https://www.drupal.org/node/3015623
|
||||
*/
|
||||
#}
|
||||
{% if not is_inline %}
|
||||
{% include "field.html.twig" %}
|
||||
{% else %}
|
||||
{%
|
||||
set classes = [
|
||||
'field',
|
||||
'field--name-' ~ field_name|clean_class,
|
||||
'field--type-' ~ field_type|clean_class,
|
||||
'field--label-' ~ label_display,
|
||||
]
|
||||
%}
|
||||
<span{{ attributes.addClass(classes) }}>
|
||||
{%- for item in items -%}
|
||||
{{ item.content }}
|
||||
{%- endfor -%}
|
||||
</span>
|
||||
{% endif %}
|
||||
@ -0,0 +1,44 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the node title field.
|
||||
*
|
||||
* This is an override of field.html.twig for the node title field. See that
|
||||
* template for documentation about its details and overrides.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing span element.
|
||||
* - items: List of all the field items. Each item contains:
|
||||
* - attributes: List of HTML attributes for each item.
|
||||
* - content: The field item content.
|
||||
* - entity_type: The entity type to which the field belongs.
|
||||
* - field_name: The name of the field.
|
||||
* - field_type: The type of the field.
|
||||
* - label_display: The display settings for the label.
|
||||
* - is_inline: If false, display an ordinary field.
|
||||
* If true, display an inline format, suitable for inside elements such as
|
||||
* <span>, <h2> and so on.
|
||||
*
|
||||
* @see field.html.twig
|
||||
* @see node_preprocess_field__node()
|
||||
*
|
||||
* @todo Delete as part of https://www.drupal.org/node/3015623
|
||||
*/
|
||||
#}
|
||||
{% if not is_inline %}
|
||||
{% include "field.html.twig" %}
|
||||
{% else %}
|
||||
{%
|
||||
set classes = [
|
||||
'field',
|
||||
'field--name-' ~ field_name|clean_class,
|
||||
'field--type-' ~ field_type|clean_class,
|
||||
'field--label-' ~ label_display,
|
||||
]
|
||||
%}
|
||||
<span{{ attributes.addClass(classes) }}>
|
||||
{%- for item in items -%}
|
||||
{{ item.content }}
|
||||
{%- endfor -%}
|
||||
</span>
|
||||
{% endif %}
|
||||
@ -0,0 +1,44 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the node user field.
|
||||
*
|
||||
* This is an override of field.html.twig for the node user field. See that
|
||||
* template for documentation about its details and overrides.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing span element.
|
||||
* - items: List of all the field items. Each item contains:
|
||||
* - attributes: List of HTML attributes for each item.
|
||||
* - content: The field item content.
|
||||
* - entity_type: The entity type to which the field belongs.
|
||||
* - field_name: The name of the field.
|
||||
* - field_type: The type of the field.
|
||||
* - label_display: The display settings for the label.
|
||||
* - is_inline: If false, display an ordinary field.
|
||||
* If true, display an inline format, suitable for inside elements such as
|
||||
* <span>, <h2> and so on.
|
||||
*
|
||||
* @see field.html.twig
|
||||
* @see node_preprocess_field__node()
|
||||
*
|
||||
* @todo Delete as part of https://www.drupal.org/node/3015623
|
||||
*/
|
||||
#}
|
||||
{% if not is_inline %}
|
||||
{% include "field.html.twig" %}
|
||||
{% else %}
|
||||
{%
|
||||
set classes = [
|
||||
'field',
|
||||
'field--name-' ~ field_name|clean_class,
|
||||
'field--type-' ~ field_type|clean_class,
|
||||
'field--label-' ~ label_display,
|
||||
]
|
||||
%}
|
||||
<span{{ attributes.addClass(classes) }}>
|
||||
{%- for item in items -%}
|
||||
{{ item.content }}
|
||||
{%- endfor -%}
|
||||
</span>
|
||||
{% endif %}
|
||||
@ -0,0 +1 @@
|
||||
{% extends "field--text.html.twig" %}
|
||||
@ -0,0 +1 @@
|
||||
{% extends "field--text.html.twig" %}
|
||||
@ -0,0 +1,28 @@
|
||||
{% extends "field.html.twig" %}
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation for a text field.
|
||||
*
|
||||
* A 'clearfix' class is added, because 'text' fields have a 'format' property
|
||||
* that allows a Text Format to be associated with the entered text, which then
|
||||
* applies filtering on output. A common use case is to align images to the left
|
||||
* or right, and without this 'clearfix' class, such aligned images may be
|
||||
* rendered outside of the 'text' field formatter's boundaries, and hence
|
||||
* overlap with other fields. By setting the 'clearfix' class on all 'text'
|
||||
* fields, we prevent that.
|
||||
*
|
||||
* @see https://www.drupal.org/node/2358529
|
||||
*
|
||||
* A 'text-formatted' class is added to assist with default styling of base
|
||||
* elements such as paragraphs and lists that may not have classes assigned to
|
||||
* them. This allows user entered content to have default styling without
|
||||
* interfering with the styles of other UI components such as system generated
|
||||
* lists or other dynamic content.
|
||||
*
|
||||
* @see https://www.drupal.org/node/2539860
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{% set attributes = attributes.addClass('clearfix', 'text-formatted') %}
|
||||
81
web/core/themes/claro/templates/classy/field/field.html.twig
Normal file
81
web/core/themes/claro/templates/classy/field/field.html.twig
Normal file
@ -0,0 +1,81 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a field.
|
||||
*
|
||||
* To override output, copy the "field.html.twig" from the templates directory
|
||||
* to your theme's directory and customize it, just like customizing other
|
||||
* Drupal templates such as page.html.twig or node.html.twig.
|
||||
*
|
||||
* Instead of overriding the theming for all fields, you can also just override
|
||||
* theming for a subset of fields using
|
||||
* @link themeable Theme hook suggestions. @endlink For example,
|
||||
* here are some theme hook suggestions that can be used for a field_foo field
|
||||
* on an article node type:
|
||||
* - field--node--field-foo--article.html.twig
|
||||
* - field--node--field-foo.html.twig
|
||||
* - field--node--article.html.twig
|
||||
* - field--field-foo.html.twig
|
||||
* - field--text-with-summary.html.twig
|
||||
* - field.html.twig
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - label_hidden: Whether to show the field label or not.
|
||||
* - title_attributes: HTML attributes for the title.
|
||||
* - label: The label for the field.
|
||||
* - multiple: TRUE if a field can contain multiple items.
|
||||
* - items: List of all the field items. Each item contains:
|
||||
* - attributes: List of HTML attributes for each item.
|
||||
* - content: The field item's content.
|
||||
* - entity_type: The entity type to which the field belongs.
|
||||
* - field_name: The name of the field.
|
||||
* - field_type: The type of the field.
|
||||
* - label_display: The display settings for the label.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_field()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'field',
|
||||
'field--name-' ~ field_name|clean_class,
|
||||
'field--type-' ~ field_type|clean_class,
|
||||
'field--label-' ~ label_display,
|
||||
label_display == 'inline' ? 'clearfix',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set title_classes = [
|
||||
'field__label',
|
||||
label_display == 'visually_hidden' ? 'visually-hidden',
|
||||
]
|
||||
%}
|
||||
|
||||
{% if label_hidden %}
|
||||
{% if multiple %}
|
||||
<div{{ attributes.addClass(classes, 'field__items') }}>
|
||||
{% for item in items %}
|
||||
<div{{ item.attributes.addClass('field__item') }}>{{ item.content }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% for item in items %}
|
||||
<div{{ attributes.addClass(classes, 'field__item') }}>{{ item.content }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
<div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
|
||||
{% if multiple %}
|
||||
<div class="field__items">
|
||||
{% endif %}
|
||||
{% for item in items %}
|
||||
<div{{ item.attributes.addClass('field__item') }}>{{ item.content }}</div>
|
||||
{% endfor %}
|
||||
{% if multiple %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -0,0 +1,23 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation to display the file entity as an audio tag.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: An array of HTML attributes, intended to be added to the
|
||||
* audio tag.
|
||||
* - files: And array of files to be added as sources for the audio tag. Each
|
||||
* element is an array with the following elements:
|
||||
* - file: The full file object.
|
||||
* - source_attributes: An array of HTML attributes for to be added to the
|
||||
* source tag.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{{ attach_library('claro/classy.file') }}
|
||||
<audio {{ attributes }}>
|
||||
{% for file in files %}
|
||||
<source {{ file.source_attributes }} />
|
||||
{% endfor %}
|
||||
</audio>
|
||||
@ -0,0 +1,23 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation to display the file entity as a video tag.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: An array of HTML attributes, intended to be added to the
|
||||
* video tag.
|
||||
* - files: And array of files to be added as sources for the video tag. Each
|
||||
* element is an array with the following elements:
|
||||
* - file: The full file object.
|
||||
* - source_attributes: An array of HTML attributes for to be added to the
|
||||
* source tag.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{{ attach_library('claro/classy.file') }}
|
||||
<video {{ attributes }}>
|
||||
{% for file in files %}
|
||||
<source {{ file.source_attributes }} />
|
||||
{% endfor %}
|
||||
</video>
|
||||
18
web/core/themes/claro/templates/classy/field/image.html.twig
Normal file
18
web/core/themes/claro/templates/classy/field/image.html.twig
Normal file
@ -0,0 +1,18 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override of an image.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the img tag.
|
||||
* - style_name: (optional) The name of the image style applied.
|
||||
*
|
||||
* @see template_preprocess_image()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
style_name ? 'image-style-' ~ style_name|clean_class,
|
||||
]
|
||||
%}
|
||||
<img{{ attributes.addClass(classes) }} />
|
||||
@ -0,0 +1,19 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override of a link with separate title and URL elements.
|
||||
*
|
||||
* Available variables:
|
||||
* - link: The link that has already been formatted by l().
|
||||
* - title: (optional) A descriptive or alternate title for the link, which may
|
||||
* be different than the actual link text.
|
||||
*
|
||||
* @see template_preprocess_link_formatter_link_separate()
|
||||
*/
|
||||
#}
|
||||
<div class="link-item">
|
||||
{%- if title -%}
|
||||
<div class="link-title">{{- title -}}</div>
|
||||
{%- endif -%}
|
||||
<div class="link-url">{{- link -}}</div>
|
||||
</div>
|
||||
22
web/core/themes/claro/templates/classy/field/time.html.twig
Normal file
22
web/core/themes/claro/templates/classy/field/time.html.twig
Normal file
@ -0,0 +1,22 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a date / time element.
|
||||
*
|
||||
* Available variables
|
||||
* - timestamp: (optional) A UNIX timestamp for the datetime attribute. If the
|
||||
* datetime cannot be represented as a UNIX timestamp, use a valid datetime
|
||||
* attribute value in attributes.datetime.
|
||||
* - text: (optional) The content to display within the <time> element.
|
||||
* Defaults to a human-readable representation of the timestamp value or the
|
||||
* datetime attribute value using DateFormatter::format().
|
||||
* - attributes: (optional) HTML attributes to apply to the <time> element.
|
||||
* A datetime attribute in 'attributes' overrides the 'timestamp'. To
|
||||
* create a valid datetime attribute value from a UNIX timestamp, use
|
||||
* DateFormatter::format() with one of the predefined 'html_*' formats.
|
||||
*
|
||||
* @see \Drupal\Core\Datetime\DatePreprocess::preprocessTime()
|
||||
* @see https://www.w3.org/TR/html5-author/the-time-element.html#attr-time-datetime
|
||||
*/
|
||||
#}
|
||||
<time{{ attributes.addClass('datetime') }}>{{ text }}</time>
|
||||
55
web/core/themes/claro/templates/classy/layout/html.html.twig
Normal file
55
web/core/themes/claro/templates/classy/layout/html.html.twig
Normal file
@ -0,0 +1,55 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the basic structure of a single Drupal page.
|
||||
*
|
||||
* Variables:
|
||||
* - logged_in: A flag indicating if user is logged in.
|
||||
* - root_path: The root path of the current page (e.g., node, admin, user).
|
||||
* - node_type: The content type for the current node, if the page is a node.
|
||||
* - head_title: List of text elements that make up the head_title variable.
|
||||
* May contain one or more of the following:
|
||||
* - title: The title of the page.
|
||||
* - name: The name of the site.
|
||||
* - slogan: The slogan of the site.
|
||||
* - page_top: Initial rendered markup. This should be printed before 'page'.
|
||||
* - page: The rendered page markup.
|
||||
* - page_bottom: Closing rendered markup. This variable should be printed after
|
||||
* 'page'.
|
||||
* - db_offline: A flag indicating if the database is offline.
|
||||
* - placeholder_token: The token for generating head, css, js and js-bottom
|
||||
* placeholders.
|
||||
*
|
||||
* @see \Drupal\Core\Theme\ThemePreprocess::preprocessHtml()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set body_classes = [
|
||||
logged_in ? 'user-logged-in',
|
||||
not root_path ? 'path-frontpage' : 'path-' ~ root_path|clean_class,
|
||||
node_type ? 'page-node-type-' ~ node_type|clean_class,
|
||||
db_offline ? 'db-offline',
|
||||
]
|
||||
%}
|
||||
<!DOCTYPE html>
|
||||
<html{{ html_attributes }}>
|
||||
<head>
|
||||
<head-placeholder token="{{ placeholder_token }}">
|
||||
<title>{{ head_title|safe_join(' | ') }}</title>
|
||||
<css-placeholder token="{{ placeholder_token }}">
|
||||
<js-placeholder token="{{ placeholder_token }}">
|
||||
</head>
|
||||
<body{{ attributes.addClass(body_classes) }}>
|
||||
{#
|
||||
Keyboard navigation/accessibility link to main content section in
|
||||
page.html.twig.
|
||||
#}
|
||||
<a href="#main-content" class="visually-hidden focusable skip-link">
|
||||
{{ 'Skip to main content'|t }}
|
||||
</a>
|
||||
{{ page_top }}
|
||||
{{ page }}
|
||||
{{ page_bottom }}
|
||||
<js-bottom-placeholder token="{{ placeholder_token }}">
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,25 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a region.
|
||||
*
|
||||
* Available variables:
|
||||
* - content: The content for this region, typically blocks.
|
||||
* - attributes: HTML attributes for the region <div>.
|
||||
* - region: The name of the region variable as defined in the theme's
|
||||
* .info.yml file.
|
||||
*
|
||||
* @see template_preprocess_region()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'region',
|
||||
'region-' ~ region|clean_class,
|
||||
]
|
||||
%}
|
||||
{% if content %}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
{{ content }}
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -0,0 +1,28 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme implementation the content area of the modal media library dialog.
|
||||
*
|
||||
* The content area is everything that is not the menu of available media
|
||||
* types. This includes the form to add new media items, if available, and
|
||||
* the view of available media to select.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - children: The rendered child elements of the container.
|
||||
* - has_parent: A flag to indicate that the container has one or more parent
|
||||
containers.
|
||||
*
|
||||
* @see \Drupal\Core\Theme\ThemePreprocess::preprocessContainer()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
has_parent ? 'js-form-wrapper',
|
||||
has_parent ? 'form-wrapper',
|
||||
'media-library-content',
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>{{ children }}</div>
|
||||
@ -0,0 +1,28 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme implementation of a wrapper for selected media items.
|
||||
*
|
||||
* This is used to wrap around the set of media items that are currently
|
||||
* selected in the media library widget (not the modal dialog), which may
|
||||
* be used for entity reference fields that target media.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - children: The rendered child elements of the container.
|
||||
* - has_parent: A flag to indicate that the container has one or more parent
|
||||
containers.
|
||||
*
|
||||
* @see \Drupal\Core\Theme\ThemePreprocess::preprocessContainer()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
has_parent ? 'js-form-wrapper',
|
||||
has_parent ? 'form-wrapper',
|
||||
'media-library-selection',
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>{{ children }}</div>
|
||||
@ -0,0 +1,35 @@
|
||||
{% extends "links.html.twig" %}
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme implementation of the media type menu in the media library dialog.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: Attributes for the UL containing the list of links.
|
||||
* - links: Links to be output.
|
||||
* Each link will have the following elements:
|
||||
* - link: (optional) A render array that returns a link. See
|
||||
* template_preprocess_links() for details how it is generated.
|
||||
* - text: The link text.
|
||||
* - attributes: HTML attributes for the list item element.
|
||||
* - text_attributes: (optional) HTML attributes for the span element if no
|
||||
* 'url' was supplied.
|
||||
* - heading: (optional) A heading to precede the links.
|
||||
* - text: The heading text.
|
||||
* - level: The heading level (e.g. 'h2', 'h3').
|
||||
* - attributes: (optional) A keyed list of attributes for the heading.
|
||||
* If the heading is a string, it will be used as the text of the heading and
|
||||
* the level will default to 'h2'.
|
||||
*
|
||||
* Headings should be used on navigation menus and any list of links that
|
||||
* consistently appears on multiple pages. To make the heading invisible use
|
||||
* the 'visually-hidden' CSS class. Do not use 'display:none', which
|
||||
* removes it from screen readers and assistive technology. Headings allow
|
||||
* screen reader and keyboard only users to navigate to or skip the links.
|
||||
* See http://juicystudio.com/article/screen-readers-display-none.php and
|
||||
* https://www.w3.org/TR/WCAG-TECHS/H42.html for more information.
|
||||
*
|
||||
* @see \Drupal\Core\Theme\ThemePreprocess::preprocessLinks()
|
||||
*/
|
||||
#}
|
||||
{% set attributes = attributes.addClass('media-library-menu') %}
|
||||
@ -0,0 +1,29 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation of a media library item.
|
||||
*
|
||||
* This is used when displaying selected media items, either in the field
|
||||
* widget or in the "Additional selected media" area when adding new
|
||||
* media items in the media library modal dialog.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - content: The content of the media library item, plus any additional
|
||||
* fields or elements surrounding it.
|
||||
*
|
||||
* @see template_preprocess_media_library_item()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'media-library-item',
|
||||
'media-library-item--grid',
|
||||
'media-library-item--small',
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
{{ content }}
|
||||
</div>
|
||||
@ -0,0 +1,28 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation of a media library item.
|
||||
*
|
||||
* This is used when displaying selected media items, either in the field
|
||||
* widget or in the "Additional selected media" area when adding new
|
||||
* media items in the media library modal dialog.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - content: The content of the media library item, plus any additional
|
||||
* fields or elements surrounding it.
|
||||
*
|
||||
* @see template_preprocess_media_library_item()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'media-library-item',
|
||||
'media-library-item--grid',
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
{{ content }}
|
||||
</div>
|
||||
@ -0,0 +1,21 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override of a container used to wrap the media library's modal dialog
|
||||
* interface.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - menu: The menu of available media types to choose from.
|
||||
* - content: The form to add new media items, followed by the grid or table of
|
||||
* existing media items to choose from.
|
||||
*
|
||||
* @see template_preprocess_media_library_wrapper()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
<div{{ attributes.addClass('media-library-wrapper') }}>
|
||||
{{ menu }}
|
||||
{{ content }}
|
||||
</div>
|
||||
@ -0,0 +1,48 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a section of the help page.
|
||||
*
|
||||
* This implementation divides the links into 4 columns.
|
||||
*
|
||||
* Available variables:
|
||||
* - title: The section title.
|
||||
* - description: The description text for the section.
|
||||
* - links: Links to display in the section.
|
||||
* - empty: Text to display if there are no links.
|
||||
*/
|
||||
#}
|
||||
<div class="clearfix">
|
||||
<h2>{{ title }}</h2>
|
||||
<p>{{ description }}</p>
|
||||
{% if links %}
|
||||
{# Calculate the column length, to divide links into 4 columns. #}
|
||||
{% set size = links|length // 4 %}
|
||||
{% if size * 4 < links|length %}
|
||||
{% set size = size + 1 %}
|
||||
{% endif %}
|
||||
|
||||
{# Output the links in 4 columns. #}
|
||||
{% set count = 0 %}
|
||||
{% for link in links %}
|
||||
{% if count == 0 %}
|
||||
{# Start a new column. #}
|
||||
<div class="layout-column layout-column--quarter"><ul>
|
||||
{% endif %}
|
||||
<li>{{ link }}</li>
|
||||
{% set count = count + 1 %}
|
||||
{% if count >= size %}
|
||||
{# End the current column. #}
|
||||
{% set count = 0 %}
|
||||
</ul></div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{# End the last column, if one is open. #}
|
||||
{% if count > 0 %}
|
||||
</ul></div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p>{{ empty }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
@ -0,0 +1,22 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a progress bar.
|
||||
*
|
||||
* Note that the core Batch API uses this only for non-JavaScript batch jobs.
|
||||
*
|
||||
* Available variables:
|
||||
* - label: The label of the working task.
|
||||
* - percent: The percentage of the progress.
|
||||
* - message: A string containing information to be displayed.
|
||||
*/
|
||||
#}
|
||||
{{ attach_library('claro/classy.progress') }}
|
||||
<div class="progress" data-drupal-progress>
|
||||
{% if label %}
|
||||
<div class="progress__label">{{ label }}</div>
|
||||
{% endif %}
|
||||
<div class="progress__track"><div class="progress__bar" style="width: {{ percent }}%"></div></div>
|
||||
<div class="progress__percentage">{{ percent }}%</div>
|
||||
<div class="progress__description">{{ message }}</div>
|
||||
</div>
|
||||
@ -0,0 +1,55 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a menu.
|
||||
*
|
||||
* 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('menu') }}>
|
||||
{% else %}
|
||||
<ul class="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,44 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the administrative toolbar.
|
||||
*
|
||||
* 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') }}>
|
||||
<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>
|
||||
23
web/core/themes/claro/templates/classy/user/user.html.twig
Normal file
23
web/core/themes/claro/templates/classy/user/user.html.twig
Normal file
@ -0,0 +1,23 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to present all user data.
|
||||
*
|
||||
* This template is used when viewing a registered user's page,
|
||||
* e.g., example.com/user/123. 123 being the user's ID.
|
||||
*
|
||||
* Available variables:
|
||||
* - content: A list of content items. Use 'content' to print all content, or
|
||||
* print a subset such as 'content.field_example'. Fields attached to a user
|
||||
* such as 'user_picture' are available as 'content.user_picture'.
|
||||
* - attributes: HTML attributes for the container element.
|
||||
* - user: A Drupal User entity.
|
||||
*
|
||||
* @see template_preprocess_user()
|
||||
*/
|
||||
#}
|
||||
<article{{ attributes.addClass('profile') }}>
|
||||
{% if content %}
|
||||
{{- content -}}
|
||||
{% endif %}
|
||||
</article>
|
||||
@ -0,0 +1,29 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for displaying a username.
|
||||
*
|
||||
* Available variables:
|
||||
* - account: The full account information for the user.
|
||||
* - uid: The user ID, or zero if not a user. As used in anonymous comments.
|
||||
* - name: The user's name, sanitized, and optionally truncated.
|
||||
* - name_raw: The user's name, un-truncated.
|
||||
* - truncated: Whether the user's name was truncated.
|
||||
* - extra: Additional text to append to the user's name, sanitized.
|
||||
* - profile_access: Whether the current user has permission to access this
|
||||
users profile page.
|
||||
* - link_path: The path or URL of the user's profile page, home page,
|
||||
* or other desired page to link to for more information about the user.
|
||||
* - homepage: (optional) The home page of the account, only set for non users.
|
||||
* - link_options: Options to set on the \Drupal\Core\Url object if linking the
|
||||
* user's name to the user's page.
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
*
|
||||
* @see template_preprocess_username()
|
||||
*/
|
||||
#}
|
||||
{% if link_path -%}
|
||||
<a{{ attributes.addClass('username') }}>{{ name }}{{ extra }}</a>
|
||||
{%- else -%}
|
||||
<span{{ attributes }}>{{ name }}{{ extra }}</span>
|
||||
{%- endif -%}
|
||||
@ -0,0 +1,20 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a single views grouping.
|
||||
*
|
||||
* Available variables:
|
||||
* - view: The view object.
|
||||
* - grouping: The grouping instruction.
|
||||
* - grouping_level: A number indicating the hierarchical level of the grouping.
|
||||
* - title: The group heading.
|
||||
* - content: The content to be grouped.
|
||||
* - rows: The rows returned from the view.
|
||||
*
|
||||
* @see template_preprocess_views_view_grouping()
|
||||
*/
|
||||
#}
|
||||
<div class="view-grouping">
|
||||
<div class="view-grouping-header">{{ title }}</div>
|
||||
<div class="view-grouping-content">{{ content }}</div>
|
||||
</div>
|
||||
@ -0,0 +1,30 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display an item in a views RSS feed.
|
||||
*
|
||||
* Available variables:
|
||||
* - title: RSS item title.
|
||||
* - link: RSS item link.
|
||||
* - description: RSS body text.
|
||||
* - item_elements: RSS item elements to be rendered as XML (pubDate, creator,
|
||||
* guid).
|
||||
*
|
||||
* @see template_preprocess_views_view_row_rss()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
<item>
|
||||
<title>{{ title }}</title>
|
||||
<link>{{ link }}</link>
|
||||
<description>{{ description }}</description>
|
||||
{% for item in item_elements -%}
|
||||
<{{ item.key }}{{ item.attributes -}}
|
||||
{% if item.value -%}
|
||||
>{{ item.value }}</{{ item.key }}>
|
||||
{% else -%}
|
||||
{{ ' />' }}
|
||||
{% endif %}
|
||||
{%- endfor %}
|
||||
</item>
|
||||
@ -0,0 +1,31 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for unformatted summary links.
|
||||
*
|
||||
* Available variables:
|
||||
* - rows: The rows contained in this view.
|
||||
* - url: The URL to this row's content.
|
||||
* - count: The number of items this summary item represents.
|
||||
* - separator: A separator between each row.
|
||||
* - attributes: HTML attributes for a row.
|
||||
* - active: A flag indicating whether the row is active.
|
||||
* - options: Flags indicating how each row should be displayed. This contains:
|
||||
* - count: A flag indicating whether the row's 'count' should be displayed.
|
||||
* - inline: A flag indicating whether the item should be wrapped in an inline
|
||||
* or block level HTML element.
|
||||
*
|
||||
* @see template_preprocess_views_view_summary_unformatted()
|
||||
*/
|
||||
#}
|
||||
{% for row in rows %}
|
||||
{{ options.inline ? '<span' : '<div' }} class="views-summary views-summary-unformatted">
|
||||
{% if row.separator -%}
|
||||
{{ row.separator }}
|
||||
{%- endif %}
|
||||
<a href="{{ row.url }}"{{ row.attributes.addClass(row.active ? 'is-active')|without('href') }}>{{ row.link }}</a>
|
||||
{% if options.count %}
|
||||
({{ row.count }})
|
||||
{% endif %}
|
||||
{{ options.inline ? '</span>' : '</div>' }}
|
||||
{% endfor %}
|
||||
@ -0,0 +1,31 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a list of summary lines.
|
||||
*
|
||||
* Available variables:
|
||||
* - rows: The rows contained in this view.
|
||||
* Each row contains:
|
||||
* - url: The summary link URL.
|
||||
* - link: The summary link text.
|
||||
* - count: The number of items under this grouping.
|
||||
* - attributes: HTML attributes to apply to each row.
|
||||
* - active: A flag indicating whether the row is active.
|
||||
* - options: Flags indicating how the summary should be displayed.
|
||||
* This contains:
|
||||
* - count: A flag indicating whether the count should be displayed.
|
||||
*
|
||||
* @see template_preprocess_views_view_summary()
|
||||
*/
|
||||
#}
|
||||
<div class="item-list">
|
||||
<ul class="views-summary">
|
||||
{% for row in rows %}
|
||||
<li><a href="{{ row.url }}"{{ row.attributes.addClass(row.active ? 'is-active')|without('href') }}>{{ row.link }}</a>
|
||||
{% if options.count %}
|
||||
({{ row.count }})
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
@ -0,0 +1,95 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a main view template.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: Remaining HTML attributes for the element.
|
||||
* - css_name: A CSS-safe version of the view name.
|
||||
* - css_class: The user-specified classes names, if any.
|
||||
* - header: The optional header.
|
||||
* - footer: The optional footer.
|
||||
* - rows: The results of the view query, if any.
|
||||
* - empty: The content to display if there are no rows.
|
||||
* - pager: The optional pager next/prev links to display.
|
||||
* - exposed: Exposed widget form/info to display.
|
||||
* - feed_icons: Optional feed icons to display.
|
||||
* - more: An optional link to the next page of results.
|
||||
* - title: Title of the view, only used when displaying in the admin preview.
|
||||
* - title_prefix: Additional output populated by modules, intended to be
|
||||
* displayed in front of the view title.
|
||||
* - title_suffix: Additional output populated by modules, intended to be
|
||||
* displayed after the view title.
|
||||
* - attachment_before: An optional attachment view to be displayed before the
|
||||
* view content.
|
||||
* - attachment_after: An optional attachment view to be displayed after the
|
||||
* view content.
|
||||
* - dom_id: Unique id for every view being printed to give unique class for
|
||||
* JavaScript.
|
||||
*
|
||||
* @see template_preprocess_views_view()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'view',
|
||||
'view-' ~ id|clean_class,
|
||||
'view-id-' ~ id,
|
||||
'view-display-id-' ~ display_id,
|
||||
dom_id ? 'js-view-dom-id-' ~ dom_id,
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
{{ title_prefix }}
|
||||
{% if title %}
|
||||
{{ title }}
|
||||
{% endif %}
|
||||
{{ title_suffix }}
|
||||
{% if header %}
|
||||
<div class="view-header">
|
||||
{{ header }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if exposed %}
|
||||
<div class="view-filters">
|
||||
{{ exposed }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if attachment_before %}
|
||||
<div class="attachment attachment-before">
|
||||
{{ attachment_before }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if rows %}
|
||||
<div class="view-content">
|
||||
{{ rows }}
|
||||
</div>
|
||||
{% elseif empty %}
|
||||
<div class="view-empty">
|
||||
{{ empty }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if pager %}
|
||||
{{ pager }}
|
||||
{% endif %}
|
||||
{% if attachment_after %}
|
||||
<div class="attachment attachment-after">
|
||||
{{ attachment_after }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if more %}
|
||||
{{ more }}
|
||||
{% endif %}
|
||||
{% if footer %}
|
||||
<div class="view-footer">
|
||||
{{ footer }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if feed_icons %}
|
||||
<div class="feed-icons">
|
||||
{{ feed_icons }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@ -0,0 +1,67 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a file form widget.
|
||||
*
|
||||
* Available variables:
|
||||
* - main_items: Main render elements of the file or image widget:
|
||||
* file name, upload input, upload and remove buttons and hidden inputs.
|
||||
* - data: Other render elements of the image widget like preview, alt or title,
|
||||
* or the description input and the display checkbox of the file widget.
|
||||
* - display: A flag indicating whether the display field is visible.
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - multiple: Whether this widget is the part of a multi-value file widget or
|
||||
* not.
|
||||
* - upload: Whether the file upload input is displayed or not.
|
||||
* - has_value: true if the widget already contains a file.
|
||||
* - has_meta: true when the display checkbox or the description, alt or title
|
||||
* inputs are enabled and at least one of them is visible.
|
||||
*
|
||||
* @see template_preprocess_file_managed_file()
|
||||
* @see claro_preprocess_file_managed_file()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'js-form-managed-file',
|
||||
'form-managed-file',
|
||||
multiple ? 'is-multiple' : 'is-single',
|
||||
upload ? 'has-upload' : 'no-upload',
|
||||
has_value ? 'has-value' : 'no-value',
|
||||
has_meta ? 'has-meta' : 'no-meta',
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes).removeClass('clearfix') }}>
|
||||
<div class="form-managed-file__main">
|
||||
{{ main_items.filename }}
|
||||
{{ main_items|without('filename') }}
|
||||
</div>
|
||||
|
||||
{% if has_meta or data.preview %}
|
||||
<div class="form-managed-file__meta-wrapper">
|
||||
<div class="form-managed-file__meta">
|
||||
{% if data.preview %}
|
||||
<div class="form-managed-file__image-preview image-preview">
|
||||
<div class="image-preview__img-wrapper">
|
||||
{{ data.preview }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if data.description or display or data.alt or data.title %}
|
||||
<div class="form-managed-file__meta-items">
|
||||
{{ data.description }}
|
||||
{% if display %}
|
||||
{{ data.display }}
|
||||
{% endif %}
|
||||
{{ data.alt }}
|
||||
{{ data.title }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# Every third-party addition will be rendered here. #}
|
||||
{{ data|without('preview', 'alt', 'title', 'description', 'display') }}
|
||||
</div>
|
||||
@ -0,0 +1,20 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a multiple file upload form widget.
|
||||
*
|
||||
* Available variables:
|
||||
* - table: Table of previously uploaded files.
|
||||
* - element: The form element for uploading another file.
|
||||
* - has_table: True when the table is not empty AND can be accessed.
|
||||
*
|
||||
* @see template_preprocess_file_widget_multiple()
|
||||
* @see claro_preprocess_file_widget_multiple()
|
||||
*/
|
||||
#}
|
||||
<div class="file-widget-multiple{{ has_table ? ' has-table' }}">
|
||||
<div class="file-widget-multiple__table-wrapper">
|
||||
{{ table }}
|
||||
{{ element }}
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,26 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for an image field widget.
|
||||
*
|
||||
* Available variables:
|
||||
* - main_items: Main render elements of the image widget:
|
||||
* file name, upload input, upload and remove buttons and hidden inputs.
|
||||
* - data: Other render elements of the image widget like preview, alt or title.
|
||||
* - display: A flag indicating whether the display field is visible.
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - multiple: Whether this widget is the part of a multi-value file widget or
|
||||
* not.
|
||||
* - upload: Whether the file upload input is displayed or not.
|
||||
* - has_value: true if the widget already contains a file.
|
||||
* - has_meta: true when at least one of the alt or title inputs is enabled and
|
||||
* visible.
|
||||
*
|
||||
* @see template_preprocess_image_widget()
|
||||
* @see claro_preprocess_image_widget()
|
||||
*/
|
||||
#}
|
||||
|
||||
{% extends '@claro/content-edit/file-managed-file.html.twig' %}
|
||||
|
||||
{% set attributes = attributes.addClass('form-managed-file--image') %}
|
||||
15
web/core/themes/claro/templates/datetime-form.html.twig
Normal file
15
web/core/themes/claro/templates/datetime-form.html.twig
Normal file
@ -0,0 +1,15 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override of a datetime form element.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the datetime form element.
|
||||
* - content: The datelist form element to be output.
|
||||
*
|
||||
* @see \Drupal\Core\Datetime\DatePreprocess::preprocessDatetimeForm()
|
||||
*/
|
||||
#}
|
||||
<div{{ attributes.addClass('form-items-inline') }}>
|
||||
{{ content }}
|
||||
</div>
|
||||
32
web/core/themes/claro/templates/datetime-wrapper.html.twig
Normal file
32
web/core/themes/claro/templates/datetime-wrapper.html.twig
Normal file
@ -0,0 +1,32 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override of a datetime form wrapper.
|
||||
*
|
||||
* @see template_preprocess_form_element()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set title_classes = [
|
||||
'form-item__label',
|
||||
required ? 'js-form-required',
|
||||
required ? 'form-required',
|
||||
errors ? 'has-error',
|
||||
]
|
||||
%}
|
||||
<div class="form-item form-datetime-wrapper">
|
||||
{% if title %}
|
||||
<h4{{ title_attributes.addClass(title_classes) }}>{{ title }}</h4>
|
||||
{% endif %}
|
||||
{{ content }}
|
||||
{% if errors %}
|
||||
<div class="form-item__error-message">
|
||||
{{ errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if description %}
|
||||
<div{{ description_attributes.addClass('form-item__description') }}>
|
||||
{{ description }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
91
web/core/themes/claro/templates/details.html.twig
Normal file
91
web/core/themes/claro/templates/details.html.twig
Normal file
@ -0,0 +1,91 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a details 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.
|
||||
* - disabled: whether the details is disabled.
|
||||
*
|
||||
* @see template_preprocess_details()
|
||||
* @see claro_preprocess_details()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'claro-details',
|
||||
accordion ? 'claro-details--accordion',
|
||||
accordion_item ? 'claro-details--accordion-item',
|
||||
element['#module_package_listing'] ? 'claro-details--package-listing',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set content_wrapper_classes = [
|
||||
'claro-details__wrapper',
|
||||
'details-wrapper',
|
||||
accordion ? 'claro-details__wrapper--accordion',
|
||||
accordion_item ? 'claro-details__wrapper--accordion-item',
|
||||
element['#module_package_listing'] ? 'claro-details__wrapper--package-listing',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set inner_wrapper_classes = [
|
||||
'claro-details__content',
|
||||
accordion ? 'claro-details__content--accordion',
|
||||
accordion_item ? 'claro-details__content--accordion-item',
|
||||
element['#module_package_listing'] ? 'claro-details__content--package-listing',
|
||||
]
|
||||
%}
|
||||
<details{{ attributes.addClass(classes) }}>
|
||||
{%- if title -%}
|
||||
{%
|
||||
set summary_classes = [
|
||||
'claro-details__summary',
|
||||
required ? 'js-form-required',
|
||||
required ? 'form-required',
|
||||
accordion ? 'claro-details__summary--accordion',
|
||||
accordion_item ? 'claro-details__summary--accordion-item',
|
||||
element['#module_package_listing'] ? 'claro-details__summary--package-listing',
|
||||
|
||||
]
|
||||
%}
|
||||
<summary{{ summary_attributes.addClass(summary_classes) }}>
|
||||
{{- title -}}
|
||||
{%- if required -%}
|
||||
<span class="required-mark"></span>
|
||||
{%- endif -%}
|
||||
</summary>
|
||||
{%- endif -%}
|
||||
<div{{ content_attributes.addClass(content_wrapper_classes) }}>
|
||||
{% if accordion or accordion_item %}
|
||||
<div{{ create_attribute({class: inner_wrapper_classes}) }}>
|
||||
{% endif %}
|
||||
|
||||
{% if errors %}
|
||||
<div class="form-item form-item__error-message">
|
||||
{{ errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- if description -%}
|
||||
<div class="claro-details__description{{ disabled ? ' is-disabled' }}">{{ description }}</div>
|
||||
{%- endif -%}
|
||||
{%- if children -%}
|
||||
{{ children }}
|
||||
{%- endif -%}
|
||||
{%- if value -%}
|
||||
{{ value }}
|
||||
{%- endif -%}
|
||||
|
||||
{% if accordion or accordion_item %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</details>
|
||||
49
web/core/themes/claro/templates/entity-add-list.html.twig
Normal file
49
web/core/themes/claro/templates/entity-add-list.html.twig
Normal file
@ -0,0 +1,49 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to present a list of available bundles.
|
||||
*
|
||||
* Available variables:
|
||||
* - bundles: A list of bundles, each with the following properties:
|
||||
* - label: Bundle label.
|
||||
* - description: Bundle description.
|
||||
* - add_link: \Drupal\Core\Link link instance to create an entity of this
|
||||
* bundle.
|
||||
* - add_bundle_message: The message shown when there are no bundles. Only
|
||||
* available if the entity type uses bundle entities.
|
||||
*
|
||||
* @see template_preprocess_entity_add_list()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set item_classes = [
|
||||
'admin-item',
|
||||
]
|
||||
%}
|
||||
{% if bundles is not empty %}
|
||||
<dl{{ attributes.addClass('admin-list') }}>
|
||||
{% for bundle in bundles %}
|
||||
{#
|
||||
Add 'admin-item__link' class to the link attributes.
|
||||
This is needed for keeping the original attributes of the link's url.
|
||||
#}
|
||||
{% set bundle_attributes = bundle.add_link.url.getOption('attributes') ?: {} %}
|
||||
{% set link_attributes = create_attribute(bundle_attributes).addClass('admin-item__link') %}
|
||||
<div{{ create_attribute({class: item_classes}) }}>
|
||||
<dt class="admin-item__title">
|
||||
<a href="{{ bundle.add_link.url }}"{{ link_attributes|without('href') }}>
|
||||
{{ bundle.add_link.text }}
|
||||
</a>
|
||||
</dt>
|
||||
{# Don't print empty description wrapper if there is no description #}
|
||||
{% if bundle.description %}
|
||||
<dd class="admin-item__description">{{ bundle.description }}</dd>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
{% elseif add_bundle_message is not empty %}
|
||||
<p>
|
||||
{{ add_bundle_message }}
|
||||
</p>
|
||||
{% endif %}
|
||||
17
web/core/themes/claro/templates/field/file-link.html.twig
Normal file
17
web/core/themes/claro/templates/field/file-link.html.twig
Normal file
@ -0,0 +1,17 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a link to a file.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: The HTML attributes for the containing element.
|
||||
* - link: A link to the file.
|
||||
* - icon: The icon image representing the file type. This seems to be always
|
||||
* empty.
|
||||
* - file_size: The size of the file.
|
||||
*
|
||||
* @see template_preprocess_file_link()
|
||||
*/
|
||||
#}
|
||||
{{ attach_library('claro/classy.file') }}
|
||||
<span{{ attributes }}>{{ link }} <span class="file__size">({{ file_size }})</span></span>
|
||||
103
web/core/themes/claro/templates/fieldset.html.twig
Normal file
103
web/core/themes/claro/templates/fieldset.html.twig
Normal file
@ -0,0 +1,103 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a fieldset element and its children.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the fieldset element.
|
||||
* - errors: (optional) Any errors for this fieldset element, may not be set.
|
||||
* - required: Boolean indicating whether the fieldset element is required.
|
||||
* - legend: The legend element containing the following properties:
|
||||
* - title: Title of the fieldset, intended for use as the text of the legend.
|
||||
* - attributes: HTML attributes to apply to the legend.
|
||||
* - description: The description element containing the following properties:
|
||||
* - content: The description content of the fieldset.
|
||||
* - attributes: HTML attributes to apply to the description container.
|
||||
* - description_display: Description display setting. It can have these values:
|
||||
* - before: The description is output before the element.
|
||||
* - after: The description is output after the element (default).
|
||||
* - invisible: The description is output after the element, hidden visually
|
||||
* but available to screen readers.
|
||||
* - children: The rendered child elements of the fieldset.
|
||||
* - prefix: The content to add before the fieldset children.
|
||||
* - suffix: The content to add after the fieldset children.
|
||||
*
|
||||
* @see template_preprocess_fieldset()
|
||||
* @see claro_preprocess_fieldset()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'fieldset',
|
||||
attributes.hasClass('fieldgroup') ? 'fieldset--group',
|
||||
'js-form-item',
|
||||
'form-item',
|
||||
'js-form-wrapper',
|
||||
'form-wrapper',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set wrapper_classes = [
|
||||
'fieldset__wrapper',
|
||||
attributes.hasClass('fieldgroup') ? 'fieldset__wrapper--group',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set legend_span_classes = [
|
||||
'fieldset__label',
|
||||
attributes.hasClass('fieldgroup') ? 'fieldset__label--group',
|
||||
required ? 'js-form-required',
|
||||
required ? 'form-required',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set legend_classes = [
|
||||
'fieldset__legend',
|
||||
attributes.hasClass('fieldgroup') and not attributes.hasClass('form-composite') ? 'fieldset__legend--group',
|
||||
attributes.hasClass('form-composite') ? 'fieldset__legend--composite',
|
||||
title_display == 'invisible' ? 'fieldset__legend--invisible' : 'fieldset__legend--visible',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set description_classes = [
|
||||
'fieldset__description',
|
||||
]
|
||||
%}
|
||||
|
||||
<fieldset{{ attributes.addClass(classes) }}>
|
||||
{# Always wrap fieldset legends in a <span> for CSS positioning. #}
|
||||
{% if legend.title %}
|
||||
<legend{{ legend.attributes.addClass(legend_classes) }}>
|
||||
<span{{ legend_span.attributes.addClass(legend_span_classes) }}>{{ legend.title }}</span>
|
||||
</legend>
|
||||
{% endif %}
|
||||
|
||||
<div{{ content_attributes.addClass(wrapper_classes) }}>
|
||||
{% if description_display == 'before' and description.content %}
|
||||
<div{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</div>
|
||||
{% endif %}
|
||||
{% if inline_items %}
|
||||
<div class="container-inline">
|
||||
{% endif %}
|
||||
|
||||
{% if prefix %}
|
||||
<span class="fieldset__prefix">{{ prefix }}</span>
|
||||
{% endif %}
|
||||
{{ children }}
|
||||
{% if suffix %}
|
||||
<span class="fieldset__suffix">{{ suffix }}</span>
|
||||
{% endif %}
|
||||
{% if errors %}
|
||||
<div class="fieldset__error-message">
|
||||
{{ errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if description_display in ['after', 'invisible'] and description.content %}
|
||||
<div{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if inline_items %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</fieldset>
|
||||
@ -0,0 +1,29 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for guidelines for a text format.
|
||||
*
|
||||
* Available variables:
|
||||
* - format: Contains information about the current text format, including the
|
||||
* following:
|
||||
* - name: The name of the text format, potentially unsafe and needs to be
|
||||
* escaped.
|
||||
* - format: The machine name of the text format, e.g. 'basic_html'.
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - tips: Descriptions and a CSS ID in the form of 'module-name/filter-id'
|
||||
* (only used when 'long' is TRUE) for each filter in one or more text
|
||||
* formats.
|
||||
*
|
||||
* @see template_preprocess_filter_tips()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'filter-guidelines__item',
|
||||
'filter-guidelines__item--' ~ format.id|clean_class,
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
<h4 class="label">{{ format.label }}</h4>
|
||||
{{ tips }}
|
||||
</div>
|
||||
66
web/core/themes/claro/templates/filter/filter-tips.html.twig
Normal file
66
web/core/themes/claro/templates/filter/filter-tips.html.twig
Normal file
@ -0,0 +1,66 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a set of filter tips.
|
||||
*
|
||||
* Available variables:
|
||||
* - tips: Descriptions and a CSS ID in the form of 'module-name/filter-id'
|
||||
* (only used when 'long' is TRUE) for each filter in one or more text
|
||||
* formats.
|
||||
* - long: A flag indicating whether the passed-in filter tips contain extended
|
||||
* explanations, i.e. intended to be output on the path 'filter/tips'
|
||||
* (TRUE), or are in a short format, i.e. suitable to be displayed below a
|
||||
* form element. Defaults to FALSE.
|
||||
* - multiple: A flag indicating there is more than one filter tip.
|
||||
*
|
||||
* @see template_preprocess_filter_tips()
|
||||
* @see claro_preprocess_filter_tips()
|
||||
*/
|
||||
#}
|
||||
{% if multiple %}
|
||||
<h2>{{ 'Text Formats'|t }}</h2>
|
||||
{% endif %}
|
||||
|
||||
{% if tips|length %}
|
||||
{% if multiple %}
|
||||
<div class="compose-tips">
|
||||
{% endif %}
|
||||
|
||||
{% for name, tip in tips %}
|
||||
{% if multiple %}
|
||||
{%
|
||||
set tip_classes = [
|
||||
'compose-tips__item',
|
||||
'compose-tips__item--name-' ~ name|clean_class,
|
||||
]
|
||||
%}
|
||||
<div{{ tip.attributes.addClass(tip_classes) }}>
|
||||
{% endif %}
|
||||
{% if multiple or long %}
|
||||
<h3>{{ tip.name }}</h3>
|
||||
{% endif %}
|
||||
|
||||
{% if tip.list|length %}
|
||||
<ul class="filter-tips {{ long ? 'filter-tips--long' : 'filter-tips--short' }}">
|
||||
{% for item in tip.list %}
|
||||
{%
|
||||
set item_classes = [
|
||||
'filter-tips__item',
|
||||
long ? 'filter-tips__item--long' : 'filter-tips__item--short',
|
||||
long ? 'filter-tips__item--id-' ~ item.id|clean_class,
|
||||
]
|
||||
%}
|
||||
<li{{ item.attributes.addClass(item_classes) }}>{{ item.tip }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if multiple %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if multiple %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
26
web/core/themes/claro/templates/form-element-label.html.twig
Normal file
26
web/core/themes/claro/templates/form-element-label.html.twig
Normal file
@ -0,0 +1,26 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Template override for a form element label.
|
||||
*
|
||||
* Available variables:
|
||||
* - title: The label's text.
|
||||
* - title_display: Elements title_display setting.
|
||||
* - required: An indicator for whether the associated form element is required.
|
||||
* - attributes: A list of HTML attributes for the label.
|
||||
*
|
||||
* @see template_preprocess_form_element_label()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'form-item__label',
|
||||
title_display == 'after' ? 'option',
|
||||
title_display == 'invisible' ? 'visually-hidden',
|
||||
required ? 'js-form-required',
|
||||
required ? 'form-required',
|
||||
]
|
||||
%}
|
||||
{% if title is not empty or required -%}
|
||||
<label{{ attributes.addClass(classes) }}>{{ title }}</label>
|
||||
{%- endif %}
|
||||
62
web/core/themes/claro/templates/form-element.html.twig
Normal file
62
web/core/themes/claro/templates/form-element.html.twig
Normal file
@ -0,0 +1,62 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a form element.
|
||||
*
|
||||
* @see template_preprocess_form_element()
|
||||
*/
|
||||
#}
|
||||
{#
|
||||
Most of core-provided js assumes that the CSS class pattern js-form-item-[something] or
|
||||
js-form-type-[something] exists on form items. We have to keep them.
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'js-form-item',
|
||||
'form-item',
|
||||
'js-form-type-' ~ type|clean_class,
|
||||
'form-type--' ~ type|clean_class,
|
||||
type in ['checkbox', 'radio'] ? 'form-type--boolean',
|
||||
'js-form-item-' ~ name|clean_class,
|
||||
'form-item--' ~ name|clean_class,
|
||||
title_display not in ['after', 'before'] ? 'form-item--no-label',
|
||||
disabled == 'disabled' ? 'form-item--disabled',
|
||||
errors ? 'form-item--error',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set description_classes = [
|
||||
'form-item__description',
|
||||
description_display == 'invisible' ? 'visually-hidden',
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
{% if label_display in ['before', 'invisible'] %}
|
||||
{{ label }}
|
||||
{% endif %}
|
||||
{% if prefix is not empty %}
|
||||
<span class="form-item__prefix{{ disabled == 'disabled' ? ' is-disabled' }}">{{ prefix }}</span>
|
||||
{% endif %}
|
||||
{% if description_display == 'before' and description.content %}
|
||||
<div{{ description.attributes.addClass(description_classes) }}>
|
||||
{{ description.content }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ children }}
|
||||
{% if suffix is not empty %}
|
||||
<span class="form-item__suffix{{ disabled == 'disabled' ? ' is-disabled' }}">{{ suffix }}</span>
|
||||
{% endif %}
|
||||
{% if label_display == 'after' %}
|
||||
{{ label }}
|
||||
{% endif %}
|
||||
{% if errors %}
|
||||
<div class="form-item__error-message">
|
||||
{{ errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if description_display in ['after', 'invisible'] and description.content %}
|
||||
<div{{ description.attributes.addClass(description_classes) }}>
|
||||
{{ description.content }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
15
web/core/themes/claro/templates/form/checkboxes.html.twig
Normal file
15
web/core/themes/claro/templates/form/checkboxes.html.twig
Normal file
@ -0,0 +1,15 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a 'checkboxes' #type form element.
|
||||
*
|
||||
* Available variables
|
||||
* - attributes: A list of HTML attributes for the wrapper element.
|
||||
* - children: The rendered checkboxes.
|
||||
*
|
||||
* @see template_preprocess_checkboxes()
|
||||
*/
|
||||
@todo: remove this file once https://www.drupal.org/node/1819284 is resolved.
|
||||
This is identical to core/modules/system/templates/container.html.twig
|
||||
#}
|
||||
<div{{ attributes.addClass('form-checkboxes', 'form-boolean-group') }}>{{ children }}</div>
|
||||
@ -0,0 +1,52 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for multiple value form element.
|
||||
*
|
||||
* Available variables for all fields:
|
||||
* - multiple: Whether there are multiple instances of the field.
|
||||
* - disabled: Whether the input is disabled.
|
||||
*
|
||||
* Available variables for single cardinality fields:
|
||||
* - elements: Form elements to be rendered.
|
||||
*
|
||||
* Available variables when there are multiple fields.
|
||||
* - table: Table of field items.
|
||||
* - description: The description element containing the following properties:
|
||||
* - content: The description content of the form element.
|
||||
* - attributes: HTML attributes to apply to the description container.
|
||||
* - button: "Add another item" button.
|
||||
*
|
||||
* @see template_preprocess_field_multiple_value_form()
|
||||
* @see claro_preprocess_field_multiple_value_form()
|
||||
*/
|
||||
#}
|
||||
{% if multiple %}
|
||||
{%
|
||||
set classes = [
|
||||
'js-form-item',
|
||||
'form-item',
|
||||
'form-item--multiple',
|
||||
disabled ? 'form-item--disabled',
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set description_classes = [
|
||||
'form-item__description',
|
||||
disabled ? 'is-disabled',
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
{{ table }}
|
||||
{% if description.content %}
|
||||
<div{{ description.attributes.addClass(description_classes) }} >{{ description.content }}</div>
|
||||
{% endif %}
|
||||
{% if button %}
|
||||
<div class="field-actions">{{ button }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% for element in elements %}
|
||||
{{ element }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
@ -0,0 +1,20 @@
|
||||
<div class="layout-form clearfix">
|
||||
<div class="layout-region layout-region--main">
|
||||
<div class="layout-region__content">
|
||||
{% block main %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout-region layout-region--secondary">
|
||||
<div class="layout-region__content">
|
||||
{% block secondary %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout-region layout-region--footer">
|
||||
<div class="layout-region__content">
|
||||
{% block footer %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
21
web/core/themes/claro/templates/form/input.html.twig
Normal file
21
web/core/themes/claro/templates/form/input.html.twig
Normal file
@ -0,0 +1,21 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for an 'input' #type form element.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: A list of HTML attributes for the input element.
|
||||
* - children: Optional additional rendered elements.
|
||||
*
|
||||
* @see template_preprocess_input()
|
||||
* @see claro_preprocess_input()
|
||||
*/
|
||||
#}
|
||||
{% if autocomplete_message %}
|
||||
<div class="claro-autocomplete">
|
||||
<input{{ attributes }}/><div class="claro-autocomplete__message hidden" data-drupal-selector="autocomplete-message">{{ autocomplete_message }}</div>
|
||||
</div>
|
||||
{{- children -}}
|
||||
{% else %}
|
||||
<input{{ attributes }}/>{{- children -}}
|
||||
{% endif %}
|
||||
13
web/core/themes/claro/templates/form/radios.html.twig
Normal file
13
web/core/themes/claro/templates/form/radios.html.twig
Normal file
@ -0,0 +1,13 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a 'radios' #type form element.
|
||||
*
|
||||
* Available variables
|
||||
* - attributes: A list of HTML attributes for the wrapper element.
|
||||
* - children: The rendered radios.
|
||||
*
|
||||
* @see template_preprocess_radios()
|
||||
*/
|
||||
#}
|
||||
<div{{ attributes.addClass('form-radios', 'form-boolean-group') }}>{{ children }}</div>
|
||||
28
web/core/themes/claro/templates/form/textarea.html.twig
Normal file
28
web/core/themes/claro/templates/form/textarea.html.twig
Normal file
@ -0,0 +1,28 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a 'textarea' #type form element.
|
||||
*
|
||||
* Available variables
|
||||
* - wrapper_attributes: A list of HTML attributes for the wrapper element.
|
||||
* - attributes: A list of HTML attributes for the <textarea> element.
|
||||
* - resizable: An indicator for whether the textarea is resizable.
|
||||
* - required: An indicator for whether the textarea is required.
|
||||
* - value: The textarea content.
|
||||
*
|
||||
* @see template_preprocess_textarea()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'form-textarea',
|
||||
resizable ? 'resize-' ~ resizable,
|
||||
required ? 'required',
|
||||
'form-element',
|
||||
'form-element--type-textarea',
|
||||
'form-element--api-textarea',
|
||||
]
|
||||
%}
|
||||
<div{{ wrapper_attributes.addClass('form-textarea-wrapper') }}>
|
||||
<textarea{{ attributes.addClass(classes) }}>{{ value }}</textarea>
|
||||
</div>
|
||||
51
web/core/themes/claro/templates/install-page.html.twig
Normal file
51
web/core/themes/claro/templates/install-page.html.twig
Normal file
@ -0,0 +1,51 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Claro theme implementation to display a Drupal installation page.
|
||||
*
|
||||
* All available variables are mirrored in page.html.twig.
|
||||
* Some may be blank but they are provided for consistency.
|
||||
*
|
||||
* @see template_preprocess_install_page()
|
||||
*/
|
||||
#}
|
||||
<div class="layout-container">
|
||||
|
||||
<header role="banner">
|
||||
{% if site_name %}
|
||||
<h1 class="site-name">
|
||||
{{ site_name }}
|
||||
{% if site_version %}
|
||||
<span class="site-version">{{ site_version }}</span>
|
||||
{% endif %}
|
||||
</h1>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
{% if page.sidebar_first %}
|
||||
<aside class="layout-sidebar-first" role="complementary">
|
||||
{{ page.sidebar_first }}
|
||||
</aside>{# /.layout-sidebar-first #}
|
||||
{% endif %}
|
||||
|
||||
<main role="main" class="main-content">
|
||||
{% if title %}
|
||||
<h2 class="heading-c">{{ title }}</h2>
|
||||
{% endif %}
|
||||
{{ page.highlighted }}
|
||||
{{ page.content }}
|
||||
</main>
|
||||
|
||||
{% if page.sidebar_second %}
|
||||
<aside class="layout-sidebar-second" role="complementary">
|
||||
{{ page.sidebar_second }}
|
||||
</aside>{# /.layout-sidebar-second #}
|
||||
{% endif %}
|
||||
|
||||
{% if page.page_bottom %}
|
||||
<footer role="contentinfo">
|
||||
{{ page.page_bottom }}
|
||||
</footer>
|
||||
{% endif %}
|
||||
|
||||
</div>{# /.layout-container #}
|
||||
@ -0,0 +1,45 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Claro's theme implementation to display the maintenance page as frontpage.
|
||||
*
|
||||
* This is template used for rendering the page displayed for users when the
|
||||
* site is under maintenance.
|
||||
*
|
||||
* All available variables are mirrored in page.html.twig.
|
||||
* Some may be blank but they are provided for consistency.
|
||||
*
|
||||
* @see template_preprocess_maintenance_page()
|
||||
*/
|
||||
#}
|
||||
<div class="layout-container">
|
||||
|
||||
<header role="banner">
|
||||
{% if site_name %}
|
||||
<h2 class="site-name site-name--subtle">{{ site_name }}</h2>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
{% if page.sidebar_first %}
|
||||
<aside class="layout-sidebar-first" role="complementary">
|
||||
{{ page.sidebar_first }}
|
||||
</aside>{# /.layout-sidebar-first #}
|
||||
{% endif %}
|
||||
|
||||
<main role="main" class="main-content main-content--attached">
|
||||
{% if title %}
|
||||
<h1 class="title title--broad">{{ title }}</h1>
|
||||
{% endif %}
|
||||
{{ page.highlighted }}
|
||||
<div class="content content--subtle">
|
||||
{{ page.content }}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% if page.page_bottom %}
|
||||
<footer role="contentinfo">
|
||||
{{ page.page_bottom }}
|
||||
</footer>
|
||||
{% endif %}
|
||||
|
||||
</div>{# /.layout-container #}
|
||||
46
web/core/themes/claro/templates/maintenance-page.html.twig
Normal file
46
web/core/themes/claro/templates/maintenance-page.html.twig
Normal file
@ -0,0 +1,46 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Claro's theme implementation for maintenance page.
|
||||
*
|
||||
* This template is used for rendering non-frontpage maintenance pages. An
|
||||
* example of this is /update.php.
|
||||
*
|
||||
* All available variables are mirrored in page.html.twig.
|
||||
* Some may be blank but they are provided for consistency.
|
||||
*
|
||||
* @see template_preprocess_maintenance_page()
|
||||
* @see maintenance-page--front.html.twig
|
||||
*/
|
||||
#}
|
||||
<div class="layout-container">
|
||||
|
||||
<header role="banner">
|
||||
{% if site_name %}
|
||||
<h2 class="site-name">{{ site_name }}</h2>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
{% if page.sidebar_first %}
|
||||
<aside class="layout-sidebar-first" role="complementary">
|
||||
{{ page.sidebar_first }}
|
||||
</aside>{# /.layout-sidebar-first #}
|
||||
{% endif %}
|
||||
|
||||
<main role="main" class="main-content">
|
||||
{% if title %}
|
||||
<h1 class="title">{{ title }}</h1>
|
||||
{% endif %}
|
||||
{{ page.highlighted }}
|
||||
<div class="content">
|
||||
{{ page.content }}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{% if page.page_bottom %}
|
||||
<footer role="contentinfo">
|
||||
{{ page.page_bottom }}
|
||||
</footer>
|
||||
{% endif %}
|
||||
|
||||
</div>{# /.layout-container #}
|
||||
@ -0,0 +1,11 @@
|
||||
{% extends "details.html.twig" %}
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the "Additional selected media" area of the modal media
|
||||
* library dialog.
|
||||
*
|
||||
* @see template_preprocess_details()
|
||||
*/
|
||||
#}
|
||||
{% set attributes = attributes.addClass('media-library-add-form__selected-media') %}
|
||||
@ -0,0 +1,24 @@
|
||||
{% extends 'fieldset.html.twig' %}
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the media library widget.
|
||||
*
|
||||
* @see claro_preprocess_fieldset__media_library_widget()
|
||||
* @see claro_preprocess_fieldset()
|
||||
* @see template_preprocess_fieldset()
|
||||
*/
|
||||
#}
|
||||
{% macro media_library_prefix(prefix) %}
|
||||
{% if prefix.empty_selection %}
|
||||
<p class="media-library-widget-empty-text">{{ prefix }}</p>
|
||||
{% else %}
|
||||
{{ prefix }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
{%
|
||||
set attributes = attributes.addClass('media-library-widget')
|
||||
%}
|
||||
{%
|
||||
set prefix = _self.media_library_prefix(prefix)
|
||||
%}
|
||||
@ -0,0 +1,35 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a list of new, unsaved media items being added in the
|
||||
* modal media library dialog.
|
||||
*
|
||||
* Renders the item list without a wrapper div.
|
||||
*
|
||||
* Available variables:
|
||||
* - items: A list of items. Each item contains:
|
||||
* - attributes: HTML attributes to be applied to each list item.
|
||||
* - value: The content of the list element.
|
||||
* - title: The title of the list.
|
||||
* - list_type: The tag for list element ("ul" or "ol").
|
||||
* - wrapper_attributes: HTML attributes to be applied to the list wrapper.
|
||||
* - attributes: HTML attributes to be applied to the list.
|
||||
* - empty: A message to display when there are no items. Allowed value is a
|
||||
* string or render array.
|
||||
* - context: A list of contextual data associated with the list. May contain:
|
||||
* - list_style: The custom list style.
|
||||
*
|
||||
* @see claro_preprocess_item_list__media_library_add_form_media_list()
|
||||
* @see template_preprocess_item_list()
|
||||
*/
|
||||
#}
|
||||
{% if items -%}
|
||||
{%- if title is not empty -%}
|
||||
<h3>{{ title }}</h3>
|
||||
{%- endif -%}
|
||||
<{{ list_type }}{{ attributes.addClass('media-library-add-form__added-media') }}>
|
||||
{%- for item in items -%}
|
||||
<li{{ item.attributes.addClass('media-library-add-form__media') }}>{{ item.value }}</li>
|
||||
{%- endfor -%}
|
||||
</{{ list_type }}>
|
||||
{%- endif %}
|
||||
@ -0,0 +1,55 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override of a media item in the media library.
|
||||
*
|
||||
* This is used for media that the user can select from the grid of media
|
||||
* items. It is not used for items that have already been selected in the
|
||||
* corresponding field widget, or for items that have been previously selected
|
||||
* before adding new media to the library.
|
||||
*
|
||||
* Available variables:
|
||||
* - media: The entity with limited access to object properties and methods.
|
||||
* Only method names starting with "get", "has", or "is" and a few common
|
||||
* methods such as "id", "label", and "bundle" are available. For example:
|
||||
* - entity.getEntityTypeId() will return the entity type ID.
|
||||
* - entity.hasField('field_example') returns TRUE if the entity includes
|
||||
* field_example. (This does not indicate the presence of a value in this
|
||||
* field.)
|
||||
* Calling other methods, such as entity.delete(), will result in an exception.
|
||||
* See \Drupal\Core\Entity\EntityInterface for a full list of methods.
|
||||
* - name: Name of the media.
|
||||
* - content: Media content.
|
||||
* - 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.
|
||||
* - view_mode: View mode; for example, "teaser" or "full".
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - title_attributes: Same as attributes, except applied to the main title
|
||||
* tag that appears in the template.
|
||||
* - url: Direct URL of the media.
|
||||
* - preview_attributes: HTML attributes for the preview wrapper.
|
||||
* - metadata_attributes: HTML attributes for the expandable metadata area.
|
||||
* - status: Whether or not the Media is published.
|
||||
*
|
||||
* @see template_preprocess_media()
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
<article{{ attributes.addClass('media-library-item__preview-wrapper') }}>
|
||||
{% if content %}
|
||||
<div{{ preview_attributes.addClass('media-library-item__preview js-media-library-item-preview') }}>
|
||||
{{ content|without('name') }}
|
||||
</div>
|
||||
{% if not status %}
|
||||
<div class="media-library-item__status">{{ "unpublished"|t }}</div>
|
||||
{% endif %}
|
||||
<div{{ metadata_attributes.addClass('media-library-item__attributes') }}>
|
||||
<div class="media-library-item__name">
|
||||
{{ name }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</article>
|
||||
@ -0,0 +1,97 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the media_library view template.
|
||||
*
|
||||
* Exposed filters precede views header.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: Remaining HTML attributes for the element.
|
||||
* - css_name: A css-safe version of the view name.
|
||||
* - css_class: The user-specified classes names, if any.
|
||||
* - header: The optional header.
|
||||
* - footer: The optional footer.
|
||||
* - rows: The results of the view query, if any.
|
||||
* - empty: The content to display if there are no rows.
|
||||
* - pager: The optional pager next/prev links to display.
|
||||
* - exposed: Exposed widget form/info to display.
|
||||
* - feed_icons: Optional feed icons to display.
|
||||
* - more: An optional link to the next page of results.
|
||||
* - title: Title of the view, only used when displaying in the admin preview.
|
||||
* - title_prefix: Additional output populated by modules, intended to be
|
||||
* displayed in front of the view title.
|
||||
* - title_suffix: Additional output populated by modules, intended to be
|
||||
* displayed after the view title.
|
||||
* - attachment_before: An optional attachment view to be displayed before the
|
||||
* view content.
|
||||
* - attachment_after: An optional attachment view to be displayed after the
|
||||
* view content.
|
||||
* - dom_id: Unique id for every view being printed to give unique class for
|
||||
* Javascript.
|
||||
*
|
||||
* @see template_preprocess_views_view()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'view',
|
||||
'view-' ~ id|clean_class,
|
||||
'view-id-' ~ id,
|
||||
'view-display-id-' ~ display_id,
|
||||
dom_id ? 'js-view-dom-id-' ~ dom_id,
|
||||
]
|
||||
%}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
{{ title_prefix }}
|
||||
{% if title %}
|
||||
{{ title }}
|
||||
{% endif %}
|
||||
{{ title_suffix }}
|
||||
{% if exposed %}
|
||||
<div class="view-filters">
|
||||
{{ exposed }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if header %}
|
||||
<div class="view-header">
|
||||
{{ header }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if attachment_before %}
|
||||
<div class="attachment attachment-before">
|
||||
{{ attachment_before }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if rows %}
|
||||
<div class="view-content">
|
||||
{{ rows }}
|
||||
</div>
|
||||
{% elseif empty %}
|
||||
<div class="view-empty">
|
||||
{{ empty }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if pager %}
|
||||
{{ pager }}
|
||||
{% endif %}
|
||||
{% if attachment_after %}
|
||||
<div class="attachment attachment-after">
|
||||
{{ attachment_after }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if more %}
|
||||
{{ more }}
|
||||
{% endif %}
|
||||
{% if footer %}
|
||||
<div class="view-footer">
|
||||
{{ footer }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if feed_icons %}
|
||||
<div class="feed-icons">
|
||||
{{ feed_icons }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@ -0,0 +1,34 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the media_library display of unformatted rows.
|
||||
*
|
||||
* Available variables:
|
||||
* - title: The title of this group of rows. May be empty.
|
||||
* - rows: A list of the view's row items.
|
||||
* - attributes: The row's HTML attributes.
|
||||
* - content: The row's content.
|
||||
* - view: The view object.
|
||||
* - default_row_class: A flag indicating whether default classes should be
|
||||
* used on rows.
|
||||
*
|
||||
* @see template_preprocess_views_view_unformatted()
|
||||
*/
|
||||
#}
|
||||
{% if title %}
|
||||
<h3>{{ title }}</h3>
|
||||
{% endif %}
|
||||
<div class="media-library-views-form__rows">
|
||||
{% for row in rows %}
|
||||
{%
|
||||
set row_classes = [
|
||||
default_row_class ? 'views-row',
|
||||
'media-library-item',
|
||||
'media-library-item--grid',
|
||||
]
|
||||
%}
|
||||
<div{{ row.attributes.addClass(row_classes) }}>
|
||||
{{- row.content -}}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
32
web/core/themes/claro/templates/menu-link-form.html.twig
Normal file
32
web/core/themes/claro/templates/menu-link-form.html.twig
Normal file
@ -0,0 +1,32 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a menu link form.
|
||||
*
|
||||
* Two-column template for the menu link add/edit form.
|
||||
*
|
||||
* This template will be used when a menu link form specifies
|
||||
* 'menu_link_form' as its #theme callback. Otherwise, by default,
|
||||
* menu_link add/edit forms will be themed by form.html.twig.
|
||||
*
|
||||
* Available variables:
|
||||
* - form: The menu link add/edit form.
|
||||
*
|
||||
* @see claro_form_menu_link_content_form_alter()
|
||||
*/
|
||||
#}
|
||||
{% extends '@claro/form/form-two-columns.html.twig' %}
|
||||
{% block main %}
|
||||
{{ form|without('advanced', 'menu_parent', 'actions') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block secondary %}
|
||||
<div class="entity-meta">
|
||||
{{ form.menu_parent }}
|
||||
{{ form.advanced }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{{ form.actions }}
|
||||
{% endblock %}
|
||||
27
web/core/themes/claro/templates/menu-local-tasks.html.twig
Normal file
27
web/core/themes/claro/templates/menu-local-tasks.html.twig
Normal file
@ -0,0 +1,27 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Claro theme implementation to display primary and secondary local tasks.
|
||||
*
|
||||
* Available variables:
|
||||
* - primary: HTML list items representing primary tasks.
|
||||
* - secondary: HTML list items representing secondary tasks.
|
||||
*
|
||||
* Each item in these variables (primary and secondary) can be individually
|
||||
* themed in menu-local-task.html.twig.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{% if primary %}
|
||||
<h2 id="primary-tabs-title" class="visually-hidden">{{ 'Primary tabs'|t }}</h2>
|
||||
<nav role="navigation" class="tabs-wrapper is-horizontal is-collapsible" aria-labelledby="primary-tabs-title" data-drupal-nav-tabs>
|
||||
<ul class="tabs tabs--primary clearfix" data-drupal-nav-tabs-target>{{ primary }}</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% if secondary %}
|
||||
<h2 id="secondary-tabs-title" class="visually-hidden">{{ 'Secondary tabs'|t }}</h2>
|
||||
<nav role="navigation" class="tabs-wrapper tabs-wrapper--secondary is-horizontal is-collapsible" aria-labelledby="secondary-tabs-title" data-drupal-nav-tabs>
|
||||
<ul class="tabs tabs--secondary clearfix" data-drupal-nav-tabs-target>{{ secondary }}</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
@ -0,0 +1,74 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for status messages.
|
||||
*
|
||||
* Displays status, error, and warning messages, grouped by type.
|
||||
*
|
||||
* An invisible heading identifies the messages for assistive technology.
|
||||
* Sighted users see a colored box. See https://www.w3.org/TR/WCAG-TECHS/H69.html
|
||||
* for info.
|
||||
*
|
||||
* Add an ARIA label to the contentinfo area so that assistive technology
|
||||
* user agents will better describe this landmark.
|
||||
*
|
||||
* Available variables:
|
||||
* - message_list: List of messages to be displayed, grouped by type.
|
||||
* - status_headings: List of all status types.
|
||||
* - attributes: HTML attributes for the element, including:
|
||||
* - class: HTML classes.
|
||||
* - title_ids: A list of unique ids keyed by message type.
|
||||
*
|
||||
* @see claro_preprocess_status_messages().
|
||||
*/
|
||||
#}
|
||||
<div data-drupal-messages class="messages-list">
|
||||
<div class="messages-list__wrapper">
|
||||
{% for type, messages in message_list %}
|
||||
{%
|
||||
set classes = [
|
||||
'messages-list__item',
|
||||
'messages',
|
||||
'messages--' ~ type,
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set is_message_with_title = status_headings[type]
|
||||
%}
|
||||
{%
|
||||
set is_message_with_icon = type in ['error', 'status', 'warning']
|
||||
%}
|
||||
|
||||
<div role="contentinfo" aria-labelledby="{{ title_ids[type] }}"{{ attributes.addClass(classes)|without('role', 'aria-label') }}>
|
||||
{% if type == 'error' %}
|
||||
<div role="alert">
|
||||
{% endif %}
|
||||
{% if is_message_with_title or is_message_with_icon %}
|
||||
<div class="messages__header">
|
||||
{% if is_message_with_title %}
|
||||
<h2 id="{{ title_ids[type] }}" class="messages__title">
|
||||
{{ status_headings[type] }}
|
||||
</h2>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="messages__content">
|
||||
{% if messages|length > 1 %}
|
||||
<ul class="messages__list">
|
||||
{% for message in messages %}
|
||||
<li class="messages__item">{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
{{ messages|first }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if type == 'error' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{# Remove type specific classes. #}
|
||||
{% set attributes = attributes.removeClass(classes) %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
@ -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>
|
||||
25
web/core/themes/claro/templates/node-add-list.html.twig
Normal file
25
web/core/themes/claro/templates/node-add-list.html.twig
Normal file
@ -0,0 +1,25 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Claro's theme implementation to list node types available for adding content.
|
||||
*
|
||||
* Available variables:
|
||||
* - bundles: A list of content types, each with the following properties:
|
||||
* - label: Content type label.
|
||||
* - add_link: \Drupal\Core\Link link instance to create an entity of this
|
||||
* content type. This is a GeneratedLink originally and is switched by
|
||||
* claro_preprocess_node_add_list().
|
||||
* - description: Description of this type of content.
|
||||
*
|
||||
* @todo Revisit after https://www.drupal.org/node/3026221 has been solved.
|
||||
*
|
||||
* @see template_preprocess_node_add_list()
|
||||
* @see claro_preprocess_node_add_list()
|
||||
*/
|
||||
#}
|
||||
{% extends '@claro/entity-add-list.html.twig' %}
|
||||
|
||||
{% set create_content = path('node.type_add') %}
|
||||
{%
|
||||
set add_bundle_message = 'You have not created any content types yet. Go to the <a href="@create-content">content type creation page</a> to add a new content type.'|t({'@create-content': create_content})
|
||||
%}
|
||||
30
web/core/themes/claro/templates/node-edit-form.html.twig
Normal file
30
web/core/themes/claro/templates/node-edit-form.html.twig
Normal file
@ -0,0 +1,30 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a node edit form.
|
||||
*
|
||||
* Two column template for the node add/edit form.
|
||||
*
|
||||
* This template will be used when a node edit form specifies 'node_edit_form'
|
||||
* as its #theme callback. Otherwise, by default, node add/edit forms will be
|
||||
* themed by form.html.twig.
|
||||
*
|
||||
* Available variables:
|
||||
* - form: The node add/edit form.
|
||||
*
|
||||
* @see claro_form_node_form_alter()
|
||||
*/
|
||||
#}
|
||||
{% extends '@claro/form/form-two-columns.html.twig' %}
|
||||
{% block main %}
|
||||
{{ form|without('advanced', 'footer', 'actions') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block secondary %}
|
||||
{{ form.advanced }}
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{{ form.footer }}
|
||||
{{ form.actions }}
|
||||
{% endblock %}
|
||||
@ -0,0 +1,26 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation for a page wrapper.
|
||||
*
|
||||
* For consistent wrapping to {{ page }} render in all themes. The
|
||||
* "data-off-canvas-main-canvas" attribute is required by the off-canvas dialog.
|
||||
* This is used by the core/drupal.dialog.off_canvas library to select the
|
||||
* "main canvas" page element as opposed to the "off canvas" which is the dialog
|
||||
* itself. The "main canvas" element must be resized according to the width of
|
||||
* the "off canvas" dialog so that no portion of the "main canvas" is obstructed
|
||||
* by the off-canvas dialog. The off-canvas dialog can vary in width when opened
|
||||
* and can be resized by the user. The "data-off-canvas-main-canvas" attribute
|
||||
* cannot be removed without breaking the off-canvas dialog functionality.
|
||||
*
|
||||
* Available variables:
|
||||
* - children: Contains the child elements of the page.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{% if children %}
|
||||
<div class="page-wrapper dialog-off-canvas-main-canvas" data-off-canvas-main-canvas>
|
||||
{{ children }}
|
||||
</div>
|
||||
{% endif %}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user