first commit

This commit is contained in:
2024-07-15 12:33:27 +02:00
commit ce50ae282b
22084 changed files with 2623791 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
{#
/**
* @file
* Default theme implementation to display a bare minimum block.
*
* Available variables:
* - $block->subject: Block title.
* - $content: Block content.
* - $block->module: Module that generated the block.
* - $block->delta: An ID for the block, unique within each module.
* - $block->region: The block region embedding the current block.
* - $classes: String of classes that can be used to style contextually through
* CSS. It can be manipulated through the variable $classes_array from
* preprocess functions. The default values can be one or more of the
* following:
* - block: The current template type, i.e., "theming hook".
* - block-[module]: The module generating the block. For example, the user
* module is responsible for handling the default user navigation block. In
* that case the class would be 'block-user'.
* - $title_prefix (array): An array containing additional output populated by
* modules, intended to be displayed in front of the main title tag that
* appears in the template.
* - $title_suffix (array): An array containing additional output populated by
* modules, intended to be displayed after the main title tag that appears in
* the template.
*
* Helper variables:
* - $classes_array: Array of html class attribute values. It is flattened
* into a string within the variable $classes.
* - $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
* - $zebra: Same output as $block_zebra but independent of any block region.
* - $block_id: Counter dependent on each block region.
* - $id: Same output as $block_id but independent of any block region.
* - $is_front: Flags true when presented in the front page.
* - $logged_in: Flags true when the current user is a logged-in member.
* - $is_admin: Flags true when the current user is an administrator.
* - $block_html_id: A valid HTML ID and guaranteed unique.
*
* @ingroup templates
*
* @see bootstrap_preprocess_block()
* @see template_preprocess()
* @see template_preprocess_block()
* @see bootstrap_process_block()
* @see template_process()
*/
#}
{% block content %}
{{ content }}
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% extends "block--bare.html.twig" %}
{#
/**
* @file
* Theme override for local actions (primary admin actions.)
*
* @ingroup templates
*/
#}
{% block content %}
{% if content %}
<ul class="list-inline local-actions">{{ content }}</ul>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,16 @@
{% extends "block--bare.html.twig" %}
{#
/**
* @file
* Theme override for tabs.
*
* @ingroup templates
*/
#}
{% block content %}
{% if content %}
<nav class="tabs" role="navigation" aria-label="{{ 'Tabs'|t }}">
{{ content }}
</nav>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,9 @@
{#
/**
* @file
* Theme override for page title block.
*
* @ingroup templates
*/
#}
{% extends "block--bare.html.twig" %}

View File

@@ -0,0 +1,53 @@
{#
/**
* @file
* Default theme implementation to display a search 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.
* - module: The module that provided this block plugin.
* - cache: The cache settings.
* - Block plugin specific settings will also be stored here.
* - block - The full block entity.
* - label_hidden: The hidden block title value if the block was
* configured to hide the title ('label' is empty in this case).
* - module: The module that generated the block.
* - delta: An ID for the block, unique within each module.
* - region: The block region embedding the current block.
* - 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.
*
* @ingroup templates
*
* @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.addClass('visually-hidden') }}>{{ label }}</h2>
{% endif %}
{{ title_suffix }}
{% block content %}
{{ content }}
{% endblock %}
</div>

View File

@@ -0,0 +1,30 @@
{% extends "block--bare.html.twig" %}
{#
/**
* @file
* Default theme implementation 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.
*
* @ingroup templates
*/
#}
{% block content %}
{% if site_logo %}
<a class="logo navbar-btn pull-left" href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">
<img src="{{ site_logo }}" alt="{{ 'Home'|t }}" />
</a>
{% endif %}
{% if site_name %}
<a class="name navbar-brand" href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">{{ site_name }}</a>
{% endif %}
{% if site_slogan %}
<p class="navbar-text">{{ site_slogan }}</p>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,47 @@
{#
/**
* @file
* Default theme implementation 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.
* - 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
* http://www.w3.org/TR/WCAG-TECHS/H42.html for more information.
*
* @ingroup templates
*/
#}
{% set heading_id = attributes.id ~ '-menu'|clean_id %}
<nav role="navigation" aria-labelledby="{{ heading_id }}"{{ attributes.removeClass('clearfix')|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('sr-only') %}
{% endif %}
<h2{{ title_attributes.setAttribute('id', heading_id) }}>{{ configuration.label }}</h2>
{% block content %}
{{ content }}
{% endblock %}
</nav>

View File

@@ -0,0 +1,47 @@
{#
/**
* @file
* Default theme implementation 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.
* - 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
* http://www.w3.org/TR/WCAG-TECHS/H42.html for more information.
*
* @ingroup templates
*/
#}
{% set heading_id = attributes.id ~ '-menu'|clean_id %}
<nav role="navigation" aria-labelledby="{{ heading_id }}"{{ attributes.removeClass('clearfix')|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('sr-only') %}
{% endif %}
<h2{{ title_attributes.setAttribute('id', heading_id) }}>{{ configuration.label }}</h2>
{% block content %}
{{ content }}
{% endblock %}
</nav>

View File

@@ -0,0 +1,9 @@
{#
/**
* @file
* Theme override for system blocks.
*
* @ingroup templates
*/
#}
{% extends "block--bare.html.twig" %}

View File

@@ -0,0 +1,23 @@
{#
/**
* @file
* Two column template for the block add/edit form.
*
* This template will be used when a block edit form specifies 'block_edit_form'
* as its #theme callback. Otherwise, by default, block add/edit forms will be
* themed by form.html.twig.
*
* Available variables:
* - form: The block add/edit form.
*
* @ingroup templates
*/
#}
<div class="row">
<div class="col-xs-9">
{{ form|without('place_blocks') }}
</div>
<div class="col-xs-3">
{{ form.place_blocks }}
</div>
</div>

View File

@@ -0,0 +1,67 @@
{#
/**
* @file
* Default theme implementation to display a block.
*
* Available variables:
* - $block->subject: Block title.
* - $content: Block content.
* - $block->module: Module that generated the block.
* - $block->delta: An ID for the block, unique within each module.
* - $block->region: The block region embedding the current block.
* - $classes: String of classes that can be used to style contextually through
* CSS. It can be manipulated through the variable $classes_array from
* preprocess functions. The default values can be one or more of the
* following:
* - block: The current template type, i.e., "theming hook".
* - block-[module]: The module generating the block. For example, the user
* module is responsible for handling the default user navigation block. In
* that case the class would be 'block-user'.
* - $title_prefix (array): An array containing additional output populated by
* modules, intended to be displayed in front of the main title tag that
* appears in the template.
* - $title_suffix (array): An array containing additional output populated by
* modules, intended to be displayed after the main title tag that appears in
* the template.
*
* Helper variables:
* - $classes_array: Array of html class attribute values. It is flattened
* into a string within the variable $classes.
* - $block_zebra: Outputs 'odd' and 'even' dependent on each block region.
* - $zebra: Same output as $block_zebra but independent of any block region.
* - $block_id: Counter dependent on each block region.
* - $id: Same output as $block_id but independent of any block region.
* - $is_front: Flags true when presented in the front page.
* - $logged_in: Flags true when the current user is a logged-in member.
* - $is_admin: Flags true when the current user is an administrator.
* - $block_html_id: A valid HTML ID and guaranteed unique.
*
* @ingroup templates
*
* @see bootstrap_preprocess_block()
* @see template_preprocess()
* @see template_preprocess_block()
* @see bootstrap_process_block()
* @see template_process()
*/
#}
{%
set classes = [
'block',
'block-' ~ configuration.provider|clean_class,
'block-' ~ plugin_id|clean_class,
'clearfix',
]
%}
<section{{ attributes.addClass(classes) }}>
{{ title_prefix }}
{% if label %}
<h2{{ title_attributes.addClass('block-title') }}>{{ label }}</h2>
{% endif %}
{{ title_suffix }}
{% block content %}
{{ content }}
{% endblock %}
</section>

View File

@@ -0,0 +1,58 @@
{#
/**
* @file
* Default theme implementation to display a Bootstrap Carousel component.
*
* Available variables:
* - attributes: An array of HTML attributes intended to be added to the main
* container tag of this template.
* - id: A valid HTML ID and guaranteed to be unique.
* - controls: Flag indicating whether or not to show the carousel controls.
* - indicators: Flag indicating whether or not to show the carousel indicators.
* - interval: The amount of time to delay between automatically cycling a
* slide item. If false, carousel will not automatically cycle.
* - pause: (optional) Pauses the cycling of the carousel on mouseenter and
* resumes the cycling of the carousel on mouseleave.
* - slides: A list of carousel slide items containing:
* - image: (required) The image to display in the slide item.
* - attributes: (optional) An array of HTML attributes intended to be added
* to the slide item.
* - title: (optional) A title to display for the slide item.
* - description: (optional) Additional helpful text to display for a slide
* item.
* - start_index: (optional) Alters the slide position relative to its current
* position.
* - wrap: (optional) Whether the carousel should cycle continuously or have
* hard stops.
*
* @ingroup templates
*/
#}
{% set classes = ['carousel', 'slide'] %}
<div{{ attributes.addClass(classes) }} data-ride="carousel" data-interval="{{ interval }}" data-pause="{{ pause }}" data-wrap="{{ wrap }}">
{% if indicators %}
{{ indicators }}
{% endif %}
<div class="carousel-inner" role="listbox">
{% for slide in slides %}
{% set slide_classes = ['item', start_index == loop.index0 ? 'active'] %}
<div{{ slide.attributes.addClass(slide_classes) }}>
{{ slide.image }}
{% if slide.title or slide.description %}
<div class="carousel-caption">
{% if slide.title %}
<h3>{{ slide.title }}</h3>
{% endif %}
{% if slide.description %}
<p>{{ slide.description }}</p>
{% endif %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% if controls %}
{{ controls.left }}
{{ controls.right }}
{% endif %}
</div>

View File

@@ -0,0 +1,25 @@
{#
/**
* @file
* Default theme implementation to display a Bootstrap Dropdown component.
*
* Available variables:
* - alignment: (optional) The alignment of the dropdown menu.
* - attributes: An array of HTML attributes intended to be added to the main
* container tag of this template.
* - items: The dropdown menu items.
* - toggle: The toggle element.
*
* @ingroup templates
*/
#}
{%
set classes = [
'btn-group',
alignment ? 'drop' ~ alignment|clean_class : 'dropdown',
]
%}
<div{{ attributes.addClass(classes) }}>
{{ toggle }}
{{ items }}
</div>

View File

@@ -0,0 +1,95 @@
{#
/**
* @file
* Default theme implementation to display a Bootstrap Modal component.
*
* Available variables:
* - attributes: Attributes for the outer modal div.
* - body: The body of the modal.
* - body_attributes: Attributes for the modal body div.
* - close_button: Flag indicating whether or not to show the close button in
* the header.
* - content_attributes: Attributes for the modal content div.
* - description: (optional) A list of description properties containing:
* - content: (optional) A description of the modal, may not be set.
* - attributes: (optional) A list of HTML attributes to apply to the
* modal description div. Will only be set when description is set.
* - position: (optional) A display setting that can have these values:
* - before: The description is displayed before the body. This is the
* default value.
* - after: The description is display after the body.
* - invisible: The description is displayed after the element, hidden
* visually but available to screen readers.
* - dialog_attributes: Attributes for the inner modal div.
* - footer: The footer of the modal.
* - footer_attributes: Attributes for the modal footer div.
* - header_attributes: Attributes for the modal header div.
* - size: The size of the modal. Can be empty, "modal-sm" or "modal-lg".
* - title: The title for the modal.
* - title_attributes: Attributes for the modal title.
*
* @ingroup templates
*/
#}
{% if theme.settings.modal_enabled %}
{{ attach_library('bootstrap/modal') }}
{%
set classes = [
'modal',
theme.settings.modal_animation ? 'fade',
]
%}
<div{{ attributes.addClass(classes) }} tabindex="-1" role="dialog">
{%
set dialog_classes = [
'modal-dialog',
size ? size|clean_class,
]
-%}
<div{{ dialog_attributes.addClass(dialog_classes) }} role="document">
{% set content_classes = ['modal-content'] -%}
<div{{ content_attributes.addClass(content_classes) }}>
{% if title -%}
{% block title -%}
{% set header_classes = ['modal-header'] -%}
{% set title_classes = ['modal-title'] -%}
<div{{ header_attributes.addClass(header_classes) }}>
{% if close_button -%}
<button type="button" class="close" data-dismiss="modal" aria-label="{{ 'Close'|t }}"><span aria-hidden="true">&times;</span></button>
{% endif -%}
<h4{{ title_attributes.addClass(title_classes) }}>{{ title }}</h4>
</div>
{% endblock -%}
{% endif -%}
{% block body -%}
{% set body_classes = ['modal-body'] -%}
{%
set description_classes = [
'help-block',
description and description.position == 'invisible' ? 'sr-only',
]
%}
<div{{ body_attributes.addClass(body_classes) }}>
{% if description and description.position == 'before' %}
<p{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</p>
{% endif %}
{{ body }}
{% if description and description.position == 'after' or description.position == 'invisible' %}
<p{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</p>
{% endif %}
</div>
{% endblock -%}
{% if footer is not empty -%}
{% block footer -%}
{% set footer_classes = ['modal-footer'] -%}
<div{{ footer_attributes.addClass(footer_classes) }}>
{{ footer }}
</div>
{% endblock -%}
{% endif -%}
</div>
</div>
</div>
{% endif %}

View File

@@ -0,0 +1,118 @@
{#
/**
* @file
* Default theme implementation to display a Bootstrap Panel component.
*
* Available variables:
* - attributes: An array of HTML attributes intended to be added to the main
* container tag of this template.
* - id: A valid HTML ID and guaranteed to be unique.
* - body: The primary content of the panel.
* - body_attributes: (optional) Same as attributes, except applied to the body
* container that appears in the template.
* - collapsible: Flag indicating whether the panel is collapsible.
* - collapsed: Flag indicating whether the panel is collapsed.
* - description: (optional) A list of description properties containing:
* - content: (optional) A description of the form element, may not be set.
* - attributes: (optional) A list of HTML attributes to apply to the
* description content wrapper. Will only be set when description is set.
* - position: (optional) A display setting that can have these values:
* - before: The description is output before the element. This is the
* default value.
* - after: The description is output after the element.
* - invisible: The description is output after the element, hidden
* visually but available to screen readers.
* - errors: (optional) Any errors for panel, may not be set.
* - footer: (optional) Additional contents intended to be placed at the bottom.
* - footer_attributes: (optional) Same as attributes, except applied to the
* footer container that appears in the template.
* - heading: (optional) The title of the panel, may not be set.
* - heading_attributes: (optional) Same as attributes, except applied to the
* heading container that appears in the template.
* - panel_type: (optional) A contextual state. Will be one of these values:
* - danger
* - default (default value)
* - info
* - primary
* - success
* - warning
* - target: (optional) The target of the collapsible container.
*
* @ingroup templates
*/
#}
{%
set classes = [
'panel',
errors ? 'panel-danger' : 'panel-' ~ panel_type|clean_class,
]
%}
<div{{ attributes.addClass(classes) }}>
{# Heading #}
{% if heading %}
{% block heading %}
<div class="panel-heading">
{%
set heading_classes = [
'panel-title',
required ? 'form-required' : '',
]
%}
{% if collapsible %}
<a{{ heading_attributes.addClass(heading_classes) }} href="{{ target }}">{{ heading }}</a>
{% else %}
<div{{ heading_attributes.addClass(heading_classes) }}>{{ heading }}</div>
{% endif %}
</div>
{% endblock %}
{% endif %}
{# Body #}
{% block body %}
{%
set body_classes = [
'panel-body',
collapsible ? 'panel-collapse',
collapsible ? 'collapse',
collapsible ? 'fade',
errors or collapsible and not collapsed ? 'in',
]
%}
{%
set description_classes = [
'help-block',
description and description.position == 'invisible' ? 'sr-only',
]
%}
{% if errors %}
<div class="alert alert-danger" role="alert">
<strong>{{ errors }}</strong>
</div>
{% endif %}
<div{{ body_attributes.addClass(body_classes) }}>
{% if description and description.position == 'before' %}
<div{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</div>
{% endif %}
{{ body }}
{% if description and description.position == 'after' or description.position == 'invisible' %}
<div{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</div>
{% endif %}
</div>
{% endblock %}
{# Footer #}
{% if footer %}
{% block footer %}
{%
set footer_classes = [
'panel-footer',
]
%}
<div{{ footer_attributes.addClass(footer_classes) }}>{{ footer }}</div>
{% endblock %}
{% endif %}
</div>

View File

@@ -0,0 +1,28 @@
{#
/**
* @file
* Theme override for an item list.
*
* Available variables:
* - attributes: HTML attributes to be applied to the list.
* - items: A list of items. Each item contains:
* - attributes: HTML attributes to be applied to each list item.
* - list_type: The tag for list element ("ul" or "ol").
* - start_index: (optional) Alters the slide position relative to its current
* position.
* - target: A valid HTML ID for the carousel container.
*
* @ingroup templates
*
* @see template_preprocess_item_list()
*/
#}
{% set classes = ['carousel-indicators'] %}
{% if items %}
<{{ list_type }}{{ attributes.addClass(classes) }} role="menu">
{% for item in items %}
{% set item_classes = [start_index == loop.index0 ? 'active'] %}
<li{{ item.attributes.addClass(item_classes) }} data-target="{{ target }}" data-slide-to="{{ loop.index0 }}"></li>
{% endfor %}
</{{ list_type }}>
{% endif %}

View File

@@ -0,0 +1,42 @@
{#
/**
* @file
* Theme override for an item list.
*
* Available variables:
* - alignment: (optional) The alignment of the dropdown menu.
* - 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.
*
* @ingroup templates
*
* @see template_preprocess_item_list()
*/
#}
{%
set classes = [
'dropdown-menu',
alignment == 'left' ? 'dropdown-menu-left',
alignment == 'right' ? 'dropdown-menu-right',
]
%}
{% if items or empty -%}
{%- if items -%}
<{{ list_type }}{{ attributes.addClass(classes) }} role="menu">
{%- for item in items -%}
<li{{ item.attributes }} role="menuitem">{{ item.value }}</li>
{%- endfor -%}
</{{ list_type }}>
{%- else -%}
{{- empty -}}
{%- endif -%}
{%- endif %}

View File

@@ -0,0 +1,36 @@
{#
/**
* @file
* Default theme implementation for an individual form element.
*
* Available variables for all fields:
* - multiple: Whether there are multiple instances of the field.
*
* 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: Description text for the form element.
* - button: "Add another item" button.
*
* @ingroup templates
*
* @see template_preprocess_field_multiple_value_form()
*/
#}
{% if multiple %}
<div class="form-item">
{{ table }}
{% if description.content %}
<div class="description help-block">{{ description.content }}</div>
{% endif %}
{% if button %}
<div class="clearfix">{{ button }}</div>
{% endif %}
</div>
{% else %}
{% for element in elements %}
{{ element }}
{% endfor %}
{% endif %}

View 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.
*
* @ingroup templates
*
* @see template_preprocess_field()
*/
#}
{%
set classes = [
'field',
'field--name-' ~ field_name|clean_class,
'field--type-' ~ field_type|clean_class,
'field--label-' ~ label_display,
]
%}
{%
set title_classes = [
'field--label',
label_display == 'visually_hidden' ? 'sr-only',
]
%}
{% 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 %}

View File

@@ -0,0 +1,40 @@
{#
/**
* @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: An icon.
* - icon_only: Flag to display only the icon and not the label.
* - icon_position: Where an icon should be displayed.
*
* @ingroup templates
*
* @see \Drupal\bootstrap\Plugin\Preprocess\FileLink::preprocessVariables
*/
#}
{% apply spaceless %}
{%
set classes = [
icon_only ? 'icon-only',
not icon_only ? 'icon-' ~ icon_position|clean_class
]
%}
<span{{ attributes.addClass(classes) }}>
{% if icon_only %}
<span class="file-icon">{{ icon }}</span>
<span class="sr-only">
<span class="file-link">{{ link }}</span>
<span class="file-size">{{ file_size }}</span>
</span>
{% else %}
{% if icon_position == 'after' %}
<span class="file-link">{{ link }}</span><span class="file-size">{{ file_size }}</span><span class="file-icon">{{ icon }}</span>
{% else %}
<span class="file-icon">{{ icon }}</span><span class="file-link">{{ link }}</span><span class="file-size">{{ file_size }}</span>
{% endif %}
{% endif %}
</span>
{% endapply %}

View File

@@ -0,0 +1,23 @@
{#
/**
* @file
* Theme override to display help text for file fields.
*
* Available variables:
* - description: The normal description for this field, specified by the user.
* - descriptions: Lines of help text for uploading a file.
* - popover: Markup to display the descriptions as a popover instead.
*
* @ingroup templates
*
* @see template_preprocess_file_upload_help()
*/
#}
{% if description %}
{{ description }}<br>
{% endif %}
{% if popover %}
{{ popover }}
{% else %}
{{ descriptions|safe_join('<br>') }}
{% endif %}

View File

@@ -0,0 +1,29 @@
{#
/**
* @file
* Theme override for an image field widget.
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - data: Render elements of the image widget.
*
* @ingroup templates
*
* @see template_preprocess_image_widget()
*/
#}
{% if data.preview %}
<div{{ attributes.addClass('row') }}>
<div class="preview col-sm-2">
{{ data.preview }}
</div>
<div class="data col-sm-10">
{# Render widget data without the image preview that was output already. #}
{{ data|without('preview') }}
</div>
</div>
{% else %}
<div{{ attributes.addClass(classes) }}>
{{ data }}
</div>
{% endif %}

View File

@@ -0,0 +1,14 @@
{#
/**
* @file
* Theme override for a set of filter tips.
*
* Available variables:
* - tips: A pre-constructed list of tips.
*
* @ingroup templates
*
* @see \Drupal\bootstrap\Plugin\Preprocess\FilterTips::preprocessVariables()
*/
#}
{{ tips }}

View File

@@ -0,0 +1,27 @@
{#
/**
* @file
* Theme override for a text format-enabled form element.
*
* Available variables:
* - children: Text format element children.
* - description: Text format element description.
* - attributes: HTML attributes for the containing element.
* - aria_description: Flag for whether or not an ARIA description has been
* added to the description container.
*
* @see template_preprocess_text_format_wrapper()
*/
#}
<div class="js-text-format-wrapper text-format-wrapper js-form-item form-item">
{{ children }}
{% if description %}
{%
set classes = [
'help-block',
aria_description ? 'description',
]
%}
<div{{ attributes.addClass(classes) }}>{{ description }}</div>
{% endif %}
</div>

View File

@@ -0,0 +1,100 @@
{#
/**
* @file
* Default theme implementation to display a list of forums and containers.
*
* Available variables:
* - forums: A collection of forums and containers to display. It is keyed to
* the numeric IDs of all child forums and containers. Each forum in forums
* contains:
* - is_container: A flag indicating if the forum can contain other
* forums. Otherwise, the forum can only contain topics.
* - depth: How deep the forum is in the current hierarchy.
* - zebra: 'even' or 'odd', used for row class.
* - icon_class: 'default' or 'new', used for forum icon class.
* - icon_title: Text alternative for the forum icon.
* - name: The name of the forum.
* - link: The URL to link to this forum.
* - description: The description field for the forum, containing:
* - value: The descriptive text for the forum.
* - new_topics: A flag indicating if the forum contains unread posts.
* - new_url: A URL to the forum's unread posts.
* - new_text: Text for the above URL, which tells how many new posts.
* - old_topics: A count of posts that have already been read.
* - num_posts: The total number of posts in the forum.
* - last_reply: Text representing the last time a forum was posted or
* commented in.
* - forum_id: Forum ID for the current forum. Parent to all items within the
* forums array.
* - bordered: Flag indicating whether or not the table should be bordered.
* - condensed: Flag indicating whether or not the table should be condensed.
* - hover: Flag indicating whether or not table rows should be hoverable.
* - striped: Flag indicating whether or not table rows should be striped.
* - responsive: Flag indicating whether or not the table should be wrapped to
* be responsive (using the Bootstrap Framework .table-responsive wrapper).
*
* @see template_preprocess_forum_list()
*
* @ingroup themeable
*/
#}
{% if responsive %}
<div class="table-responsive">
{% endif %}
{% set table_attributes = create_attribute() %}
{%
set table_classes = [
'table',
bordered ? 'table-bordered',
condensed ? 'table-condensed',
hover ? 'table-hover',
striped ? 'table-striped',
sticky ? 'sticky-enabled',
]
%}
<table{{ table_attributes.addClass(table_classes) }}>
<thead>
<tr>
<th>{{ 'Forum'|t }}</th>
<th>{{ 'Topics'|t }}</th>
<th>{{ 'Posts'|t }}</th>
<th>{{ 'Last post'|t }}</th>
</tr>
</thead>
<tbody>
{% for child_id, forum in forums %}
<tr>
<td{% if forum.is_container == true %} colspan="4"{% endif %}>
{#
Enclose the contents of this cell with X divs, where X is the
depth this forum resides at. This will allow us to use CSS
left-margin for indenting.
#}
{% if forum.depth > 0 %}{% for i in 1..forum.depth %}<div class="indent">{% endfor %}{% endif %}
<div title="{{ forum.icon_title }}">
<span class="visually-hidden">{{ forum.icon_title }}</span>
</div>
<div><a href="{{ forum.link }}">{{ forum.label }}</a></div>
{% if forum.description.value %}
<div>{{ forum.description.value }}</div>
{% endif %}
{% if forum.depth > 0 %}{% for i in 1..forum.depth %}</div>{% endfor %}{% endif %}
</td>
{% if forum.is_container == false %}
<td>
{{ forum.num_topics }}
{% if forum.new_topics == true %}
<br />
<a href="{{ forum.new_url }}">{{ forum.new_text }}</a>
{% endif %}
</td>
<td>{{ forum.num_posts }}</td>
<td>{{ forum.last_reply }}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% if responsive %}
</div>
{% endif %}

View File

@@ -0,0 +1,17 @@
{#
/**
* @file
* Default theme implementation of a datetime form element.
*
* Available variables:
* - attributes: HTML attributes for the datetime form element.
* - content: The datelist form element to be output.
*
* @see template_preprocess_datetime_form()
*
* @ingroup templates
*/
#}
<div{{ attributes.addClass('container-inline', 'form-inline') }}>
{{ content }}
</div>

View File

@@ -0,0 +1,35 @@
{#
/**
* @file
* Default theme implementation of a datetime form wrapper.
*
* Available variables:
* - content: The form element to be output, usually a datelist, or datetime.
* - title: The title of the form element.
* - title_attributes: HTML attributes for the title wrapper.
* - description: Description text for the form element.
* - required: An indicator for whether the associated form element is required.
*
* @ingroup templates
*
* @see template_preprocess_datetime_wrapper()
*/
#}
{%
set title_classes = [
'control-label',
required ? 'form-required',
]
%}
{% if title %}
<label{{ title_attributes.addClass(title_classes) }}>{{ title }}</label>
{% endif %}
{{ content }}
{% if errors %}
<div class="form-item--error-message alert alert-danger alert-sm">
{{ errors }}
</div>
{% endif %}
{% if description %}
<p class="help-block">{{ description }}</p>
{% endif %}

View File

@@ -0,0 +1,48 @@
{#
/**
* @file
* Default theme implementation for a form element label.
*
* Available variables:
* - element: an input element.
* - title: The label's text.
* - title_display: Elements title_display setting.
* - description: element description.
* - required: An indicator for whether the associated form element is required.
* - is_checkbox: Whether the label is outputted in checkbox context.
* - is_radio: Whether the label is outputted in radio button context.
* - attributes: A list of HTML attributes for the label.
*
* @ingroup templates
*
* @see template_preprocess_form_element_label()
*/
#}
{%-
set classes = [
'control-label',
title_display == 'after' ? 'option',
title_display == 'invisible' and not (is_checkbox or is_radio) ? 'sr-only',
required ? 'js-form-required',
required ? 'form-required',
]
-%}
{% if title is not empty and title_display == 'invisible' and (is_checkbox or is_radio) -%}
{#
Clear but preserve label text as attribute (e.g. for screen readers) for
checkboxes/radio buttons when it actually should be invisible.
#}
{%- set attributes = attributes.setAttribute('title', title) -%}
{%- set title = null -%}
{%- endif -%}
{#
Labels for single checkboxes/radios contain the element itself and thus have
always to be rendered regardless of whether they have a title or not.
#}
{%- if title is not empty or is_checkbox or is_radio -%}
<label{{ attributes.addClass(classes) }}>{{ element }}{{ title }}
{%- if description -%}
<p class="help-block">{{ description }}</p>
{%- endif -%}
</label>
{%- endif -%}

View File

@@ -0,0 +1,101 @@
{#
/**
* @file
* Default theme implementation for a form element.
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - errors: (optional) Any inline error messages to display for this form
* element; may not be set.
* - has_error: (optional) Flag indicating whether to add the "has_error"
* Bootstrap class for this form element.
* - required: The required marker, or empty if the associated form element is
* not required.
* - type: The type of the element.
* - name: The name of the element.
* - label: A rendered label element.
* - label_display: Label display setting. It can have these values:
* - before: The label is output before the element. This is the default.
* The label includes the #title and the required marker, if #required.
* - after: The label is output after the element. For example, this is used
* for radio and checkbox #type elements. If the #title is empty but the
* field is #required, the label will contain only the required marker.
* - invisible: Labels are critical for screen readers to enable them to
* properly navigate through forms but can be visually distracting. This
* property hides the label for everyone except screen readers.
* - attribute: Set the title attribute on the element to create a tooltip but
* output no label element. This is supported only for checkboxes and radios
* in \Drupal\Core\Render\Element\CompositeFormElementTrait::preRenderCompositeFormElement().
* It is used where a visual label is not needed, such as a table of
* checkboxes where the row and column provide the context. The tooltip will
* include the title and required marker.
* - description: (optional) A list of description properties containing:
* - content: A description of the form element, may not be set.
* - attributes: (optional) A list of HTML attributes to apply to the
* description content wrapper. Will only be set when description is set.
* - 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. This is the default
* value.
* - invisible: The description is output after the element, hidden visually
* but available to screen readers.
* - disabled: True if the element is disabled.
* - title_display: Title display setting.
*
* @ingroup templates
*
* @see template_preprocess_form_element()
*/
#}
{%
set classes = [
'form-item',
'js-form-item',
'form-type-' ~ type|clean_class,
'js-form-type-' ~ type|clean_class,
'form-item-' ~ name|clean_class,
'js-form-item-' ~ name|clean_class,
title_display not in ['after', 'before'] ? 'form-no-label',
disabled == 'disabled' ? 'form-disabled',
is_form_group ? 'form-group',
is_radio ? 'radio',
is_checkbox ? 'checkbox',
is_autocomplete ? 'form-autocomplete',
has_error ? 'error has-error'
]
%}{%
set description_classes = [
'description',
'help-block',
description_display == 'invisible' ? 'visually-hidden',
]
%}
<div{{ attributes.addClass(classes) }}>
{% if label_display in ['before', 'invisible'] %}
{{ label }}
{% endif %}
{% if description_display == 'before' and description.content %}
<div{{ description.attributes.addClass(description_classes) }}>
{{ description.content }}
</div>
{% endif %}
{{ children }}
{% if label_display == 'after' %}
{{ label }}
{% endif %}
{% if errors %}
<div class="form-item--error-message alert alert-danger alert-sm">
{{ errors }}
</div>
{% endif %}
{% if description_display in ['after', 'invisible'] and description.content %}
<div{{ description.attributes.addClass(description_classes) }}>
{{ description.content }}
</div>
{% endif %}
</div>

View File

@@ -0,0 +1,58 @@
{% extends "input--button.html.twig" %}
{#
/**
* @file
* Theme suggestion for "button__split" input form element.
*
* Available variables:
* - attributes: A list of HTML attributes for the input element.
* - children: Optional additional rendered elements.
* - icon: An icon.
* - icon_only: Flag to display only the icon and not the label.
* - icon_position: Where an icon should be displayed.
* - label: button label.
* - prefix: Markup to display before the input element.
* - suffix: Markup to display after the input element.
* - type: The type of input.
*
* @ingroup templates
*
* @see \Drupal\bootstrap\Plugin\Preprocess\InputButton
* @see \Drupal\bootstrap\Plugin\Preprocess\Input
* @see template_preprocess_input()
*/
#}
{% block input %}{% apply spaceless %}
{%
set classes = [
'btn',
type == 'submit' ? 'js-form-submit',
icon and icon_position and not icon_only ? 'icon-' ~ icon_position,
]
%}
{% if icon_only %}
<button{{ attributes.addClass(classes, 'icon-only') }}>
<span class="sr-only">{{ label }}</span>
{{ icon }}
</button>
{% else %}
{% if icon_position == 'after' %}
<button{{ attributes.addClass(classes) }}>{{ label }}{{ icon }}</button>{{ children }}
{% else %}
<button{{ attributes.addClass(classes) }}>{{ icon }}{{ label }}</button>{{ children }}
{% endif %}
{% endif %}
{%
set classes = [
'btn',
'dropdown-toggle',
]
%}
<button{{ split_button_attributes.addClass(classes) }} type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">{{ 'Toggle Dropdown'|t }}</span>
</button>
{{ children }}
{% endapply %}{% endblock %}

View File

@@ -0,0 +1,47 @@
{% extends "input.html.twig" %}
{#
/**
* @file
* Theme suggestion for "button" input form element.
*
* Available variables:
* - attributes: A list of HTML attributes for the input element.
* - children: Optional additional rendered elements.
* - icon: An icon.
* - icon_only: Flag to display only the icon and not the label.
* - icon_position: Where an icon should be displayed.
* - label: button label.
* - prefix: Markup to display before the input element.
* - suffix: Markup to display after the input element.
* - type: The type of input.
*
* @ingroup templates
*
* @see \Drupal\bootstrap\Plugin\Preprocess\InputButton
* @see \Drupal\bootstrap\Plugin\Preprocess\Input
* @see template_preprocess_input()
*/
#}
{% block input %}{% apply spaceless %}
{%
set classes = [
'btn',
type == 'submit' ? 'js-form-submit',
icon and icon_position and not icon_only ? 'icon-' ~ icon_position,
]
%}
{% if icon and icon_only %}
<button{{ attributes.addClass(classes, 'icon-only') }}>
<span class="sr-only">{{ label }}</span>
{{ icon }}
</button>
{% else %}
{% if icon_position == 'after' %}
<button{{ attributes.addClass(classes) }}>{{ label }}{{ icon }}</button>{{ children }}
{% else %}
<button{{ attributes.addClass(classes) }}>{{ icon }}{{ label }}</button>{{ children }}
{% endif %}
{% endif %}
{{ children }}
{% endapply %}{% endblock %}

View File

@@ -0,0 +1,32 @@
{% extends "input.html.twig" %}
{#
/**
* @file
* Default theme implementation for an 'input__textfield' #type form element.
*
* Available variables:
* - attributes: A list of HTML attributes for the input element.
* - children: Optional additional rendered elements.
* - icon: An icon.
* - input_group: Flag to display as an input group.
* - icon_position: Where an icon should be displayed.
* - prefix: Markup to display before the input element.
* - suffix: Markup to display after the input element.
* - type: The type of input.
*
* @ingroup templates
*
* @see \Drupal\bootstrap\Plugin\Preprocess\Input
* @see template_preprocess_input()
*/
#}
{% block input %}{% apply spaceless %}
{%
set classes = [
'form-control',
]
%}
<input{{ attributes.addClass(classes) }} />
{% endapply %}{% endblock %}

View File

@@ -0,0 +1,44 @@
{#
/**
* @file
* Default theme implementation for an 'input' #type form element.
*
* Available variables:
* - attributes: A list of HTML attributes for the input element.
* - children: Optional additional rendered elements.
* - icon: An icon.
* - input_group: Flag to display as an input group.
* - icon_position: Where an icon should be displayed.
* - prefix: Markup to display before the input element.
* - suffix: Markup to display after the input element.
* - type: The type of input.
*
* @ingroup templates
*
* @see \Drupal\bootstrap\Plugin\Preprocess\Input
* @see template_preprocess_input()
*/
#}
{% apply spaceless %}
{% if input_group %}
<div class="input-group">
{% endif %}
{% if prefix %}
{{ prefix }}
{% endif %}
{% block input %}
<input{{ attributes }} />
{% endblock %}
{% if suffix %}
{{ suffix }}
{% endif %}
{% if input_group %}
</div>
{% endif %}
{{ children }}
{% endapply %}

View File

@@ -0,0 +1,61 @@
{#
/**
* @file
* Theme override for a select element.
*
* Available variables:
* - attributes: HTML attributes for the select tag.
* - input_group: Flag to display as an input group.
* - options: The option element children.
* - prefix: Markup to display before the input element.
* - suffix: Markup to display after the input element.
*
* @ingroup templates
*
* @see template_preprocess_select()
*/
#}
{% apply spaceless %}
{% if input_group %}
<div class="input-group">
{% endif %}
{% if prefix %}
{{ prefix }}
{% endif %}
{# Browsers do not recognize pseudo :after selectors, we must create a wrapper
# around the select element to style it properly.
# @see http://stackoverflow.com/q/21103542
#}
{% if not attributes.offsetExists('multiple') %}
<div class="select-wrapper">
{% endif %}
{% set classes = ['form-control'] %}
<select{{ attributes.addClass(classes) }}>
{% for option in options %}
{% if option.type == 'optgroup' %}
<optgroup label="{{ option.label }}">
{% for sub_option in option.options %}
<option
value="{{ sub_option.value }}"{{ sub_option.selected ? ' selected="selected"' }}>{{ sub_option.label }}</option>
{% endfor %}
</optgroup>
{% elseif option.type == 'option' %}
<option
value="{{ option.value }}"{{ option.selected ? ' selected="selected"' }}>{{ option.label }}</option>
{% endif %}
{% endfor %}
</select>
{% if not attributes.offsetExists('multiple') %}
</div>
{% endif %}
{% if suffix %}
{{ suffix }}
{% endif %}
{% if input_group %}
</div>
{% endif %}
{% endapply %}

View File

@@ -0,0 +1,28 @@
{#
/**
* @file
* Bootstrap theme implementation 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.
*
* @ingroup templates
*
* @see template_preprocess_textarea()
*/
#}
{%
set classes = [
'form-textarea',
'form-control',
resizable ? 'resize-' ~ resizable,
required ? 'required',
]
%}
<div{{ wrapper_attributes.addClass('form-textarea-wrapper') }}>
<textarea{{ attributes.addClass(classes) }}>{{ value }}</textarea>
</div>

View File

@@ -0,0 +1,35 @@
{#
/**
* @file
* Default theme implementation to display a menu.
*
* Available variables:
* - classes: A list of classes to apply to the top level <ul> element.
* - dropdown_classes: A list of classes to apply to the dropdown <ul> element.
* - 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.
*
* @ingroup templates
*/
#}
{% extends "menu.html.twig" %}
{%
set classes = [
'menu',
'menu--' ~ menu_name|clean_class,
'nav',
'navbar-nav',
'navbar-right',
]
%}
{%
set dropdown_classes = [
'dropdown-menu',
'dropdown-menu-right',
]
%}

View File

@@ -0,0 +1,28 @@
{#
/**
* @file
* Default theme implementation to display a menu.
*
* Available variables:
* - classes: A list of classes to apply to the top level <ul> element.
* - dropdown_classes: A list of classes to apply to the dropdown <ul> element.
* - 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.
*
* @ingroup templates
*/
#}
{% extends "menu.html.twig" %}
{%
set classes = [
'menu',
'menu--' ~ menu_name|clean_class,
'nav',
'navbar-nav',
]
%}

View File

@@ -0,0 +1,22 @@
{#
/**
* @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.
*
* @ingroup templates
*
* @see template_preprocess_menu_local_task()
*/
#}
{% set classes = [
is_active ? 'active',
] %}
<li{{ attributes.addClass(classes) }}>{{ link }}</li>

View File

@@ -0,0 +1,25 @@
{#
/**
* @file
* Default theme implementation to display primary and secondary local tasks.
*
* Available variables:
* - primary: HTML list items representing primary tasks.
* - secondary: HTML list items representing primary tasks.
*
* Each item in these variables (primary and secondary) can be individually
* themed in menu-local-task.html.twig.
*
* @ingroup templates
*
* @see template_preprocess_menu_local_tasks()
*/
#}
{% if primary %}
<h2 class="visually-hidden">{{ 'Primary tabs'|t }}</h2>
<ul class="tabs--primary nav nav-tabs">{{ primary }}</ul>
{% endif %}
{% if secondary %}
<h2 class="visually-hidden">{{ 'Secondary tabs'|t }}</h2>
<ul class="tabs--secondary pagination pagination-sm">{{ secondary }}</ul>
{% endif %}

View File

@@ -0,0 +1,60 @@
{#
/**
* @file
* Default theme implementation to display a menu.
*
* Available variables:
* - classes: A list of classes to apply to the top level <ul> element.
* - dropdown_classes: A list of classes to apply to the dropdown <ul> element.
* - 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.
*
* @ingroup templates
*
* Define a custom macro that will render all menu trees.
*/
#}
{% macro menu_links(items, attributes, menu_level, classes, dropdown_classes) %}
{% if items %}
<ul{{ attributes.addClass(menu_level == 0 ? classes : dropdown_classes) }}>
{% for item in items %}
{%
set item_classes = item.url.getOption('container_attributes').class
%}
{%
set item_classes = [
item.is_expanded and item.below ? 'expanded dropdown',
item.in_active_trail ? 'active active-trail',
loop.first ? 'first',
loop.last ? 'last',
]
%}
<li{{ item.attributes.addClass(item_classes) }}>
{% set link_title = item.title %}
{% set link_attributes = item.link_attributes %}
{% if menu_level == 0 and item.is_expanded and item.below %}
{% set link_title %}{{ link_title }} <span class="caret"></span>{% endset %}
{% set link_attributes = link_attributes.addClass('dropdown-toggle').setAttribute('data-toggle', 'dropdown') %}
{% endif %}
{# Must use link() here so it triggers hook_link_alter(). #}
{{ link(link_title, item.url, link_attributes.addClass(item.in_active_trail ? 'active-trail')) }}
{% if item.below %}
{{ _self.menu_links(item.below, attributes.removeClass(classes), menu_level + 1, classes, dropdown_classes) }}
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
{#
Invoke the custom macro defined above. If classes were provided, use them.
This allows the template to be extended without having to also duplicate the
code above. @see http://twig.sensiolabs.org/doc/tags/macro.html
#}
{{ _self.menu_links(items, attributes, 0, classes ?: ['menu', 'menu--' ~ menu_name|clean_class, 'nav'], dropdown_classes ?: ['dropdown-menu']) }}

View File

@@ -0,0 +1,103 @@
{#
/**
* @file
* Theme override to display a node.
*
* Available variables:
* - node: The node entity with limited access to object properties and methods.
Only "getter" methods (method names starting with "get", "has", or "is")
and a few common methods such as "id" and "label" are available. Calling
other methods (such as node.delete) will result in an exception.
* - 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.
* - metadata: Metadata for this node.
* - 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'.
* - readmore: Flag for more state. Will be true if the teaser content of the
* node cannot hold the main body content.
* - logged_in: Flag for authenticated user status. Will be true when the
* current user is a logged-in member.
* - is_admin: Flag for admin user status. Will be true when the current user
* is an administrator.
*
* @ingroup templates
*
* @see template_preprocess_node()
*
* @todo Remove the id attribute (or make it a class), because if that gets
* rendered twice on a page this is invalid CSS for example: two lists
* in different view modes.
*/
#}
{{ attach_library('core/drupal.dialog.ajax') }}
{%
set classes = [
node.bundle|clean_class,
node.isPromoted() ? 'is-promoted',
node.isSticky() ? 'is-sticky',
not node.isPublished() ? 'is-unpublished',
view_mode ? view_mode|clean_class,
'clearfix',
]
%}
<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>
{{ author_picture }}
<div{{ author_attributes.addClass('author') }}>
{% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
{{ metadata }}
</div>
</footer>
{% endif %}
<div{{ content_attributes.addClass('content') }}>
{{ content }}
</div>
</article>

View File

@@ -0,0 +1,24 @@
{#
/**
* @file
* Default theme implementation for a breadcrumb trail.
*
* Available variables:
* - breadcrumb: Breadcrumb trail items.
*
* @ingroup templates
*/
#}
{% if breadcrumb %}
<ol class="breadcrumb">
{% for item in breadcrumb %}
<li {{ item.attributes }}>
{% if item.url %}
<a href="{{ item.url }}">{{ item.text }}</a>
{% else %}
{{ item.text }}
{% endif %}
</li>
{% endfor %}
</ol>
{% endif %}

View File

@@ -0,0 +1,29 @@
{#
/**
* @file
* Theme override of a container used to wrap child elements.
*
* Used for grouped form items. Can also be used as a theme wrapper for any
* renderable element, to surround it with a <div> and HTML attributes.
* See the @link forms_api_reference.html Form API reference @endlink for more
* information on the #theme_wrappers render array property.
*
* 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.
*
* @ingroup templates
*
* @see template_preprocess_container()
*/
#}
{%
set classes = [
not attributes.hasClass('toolbar-menu-administration') ? 'form-group',
has_parent ? 'js-form-wrapper',
has_parent ? 'form-wrapper',
]
%}
<div{{ attributes.addClass(classes) }}>{{ children }}</div>

View File

@@ -0,0 +1,74 @@
{#
/**
* @file
* Default theme implementation to display the basic html structure of a single
* Drupal page.
*
* Variables:
* - $css: An array of CSS files for the current page.
* - $language: (object) The language the site is being displayed in.
* $language->language contains its textual representation.
* $language->dir contains the language direction. It will either be 'ltr' or
* 'rtl'.
* - $rdf_namespaces: All the RDF namespace prefixes used in the HTML document.
* - $grddl_profile: A GRDDL profile allowing agents to extract the RDF data.
* - $head_title: A modified version of the page title, for use in the TITLE
* tag.
* - $head_title_array: (array) An associative array containing the string parts
* that were used to generate the $head_title variable, already prepared to be
* output as TITLE tag. The key/value pairs may contain one or more of the
* following, depending on conditions:
* - title: The title of the current page, if any.
* - name: The name of the site.
* - slogan: The slogan of the site, if any, and if there is no title.
* - $head: Markup for the HEAD section (including meta tags, keyword tags, and
* so on).
* - $styles: Style tags necessary to import all CSS files for the page.
* - $scripts: Script tags necessary to load the JavaScript files and settings
* for the page.
* - $page_top: Initial markup from any modules that have altered the
* page. This variable should always be output first, before all other dynamic
* content.
* - $page: The rendered page content.
* - $page_bottom: Final closing markup from any modules that have altered the
* page. This variable should always be output last, after all other dynamic
* content.
* - $classes String of classes that can be used to style contextually through
* CSS.
*
* @ingroup templates
*
* @see bootstrap_preprocess_html()
* @see template_preprocess()
* @see template_preprocess_html()
* @see template_process()
*/
#}
{%
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',
theme.settings.navbar_position ? 'navbar-is-' ~ theme.settings.navbar_position,
theme.has_glyphicons ? 'has-glyphicons',
]
%}
<!DOCTYPE html>
<html {{ html_attributes }}>
<head>
<head-placeholder token="{{ placeholder_token|raw }}">
<title>{{ head_title|safe_join(' | ') }}</title>
<css-placeholder token="{{ placeholder_token|raw }}">
<js-placeholder token="{{ placeholder_token|raw }}">
</head>
<body{{ attributes.addClass(body_classes) }}>
<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|raw }}">
</body>
</html>

View File

@@ -0,0 +1,19 @@
{#
/**
* @file
* Default theme implementation of an image.
*
* Available variables:
* - attributes: HTML attributes for the img tag.
* - style_name: (optional) The name of the image style applied.
*
* @ingroup templates
*
* @see template_preprocess_image()
*/
#}
{% set classes = [
theme.settings.image_shape ? theme.settings.image_shape,
theme.settings.image_responsive ? 'img-responsive',
] %}
<img{{ attributes.addClass(classes) }} />

View File

@@ -0,0 +1,62 @@
{#
/**
* @file
* Theme override for a set of 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:
* - title: The link text.
* - href: The link URL. If omitted, the 'title' is shown as a plain text
* item in the links list. If 'href' is supplied, the entire link is passed
* to l() as its $options parameter.
* - attributes: (optional) HTML attributes for the anchor, or for the <span>
* tag if no 'href' is supplied.
* - link_key: The link CSS class.
* - 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
* http://www.w3.org/TR/WCAG-TECHS/H42.html for more information.
*
* @ingroup templates
*
* @see template_preprocess_links()
*/
#}
{% if links -%}
{%- if heading -%}
{%- if heading.level -%}
<{{ heading.level }}{{ heading.attributes }}>{{ heading.text }}</{{ heading.level }}>
{%- else -%}
<h2{{ heading.attributes }}>{{ heading.text }}</h2>
{%- endif -%}
{%- endif -%}
{%- if attributes.hasClass('inline') -%}
<ul{{ attributes.addClass('list-inline') }}>
{%- else -%}
<ul{{ attributes }}>
{%- endif -%}
{%- for key, item in links -%}
<li{{ item.attributes.addClass(key|clean_class) }}>
{%- if item.link -%}
{{ item.link }}
{%- elseif item.text_attributes -%}
<span{{ item.text_attributes }}>{{ item.text }}</span>
{%- else -%}
{{ item.text }}
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{%- endif %}

View File

@@ -0,0 +1,64 @@
{#
/**
* @file
* Theme override to display a single Drupal page while offline.
*
* All available variables are mirrored in page.html.twig.
* Some may be blank but they are provided for consistency.
*
* @see template_preprocess_maintenance_page()
*/
#}
{% set container = theme.settings.fluid_container ? 'container-fluid' : 'container' %}
{% set navbar_attributes = create_attribute() %}
{# Navbar #}
{% block navbar %}
{%
set navbar_classes = [
'navbar',
theme.settings.navbar_inverse ? 'navbar-inverse' : 'navbar-default',
theme.settings.navbar_position ? 'navbar-' ~ theme.settings.navbar_position|clean_class : container,
]
%}
<header {{ navbar_attributes.addClass(navbar_classes) }} id="navbar" role="banner">
<div class="{{ container }}">
<div class="row">
<section class="col-sm-12">
<div class="navbar-header">
{% if logo %}
<a class="logo navbar-btn pull-left" href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">
<img src="{{ logo }}" alt="{{ 'Home'|t }}" />
</a>
{% endif %}
{% if site_name or site_slogan %}
{% if site_name %}
<a class="name navbar-brand" href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">{{ site_name }}</a>
{% endif %}
{% if site_slogan %}
<p class="navbar-text">{{ site_slogan }}</p>
{% endif %}
{% endif %}
</div>
</section>
</div>
</div>
</header>
{% endblock %}
{# Main #}
<main role="main" class="main-container {{ container }}">
<div class="row">
<section class="col-sm-12">
{% if title %}
<h1>{{ title }}</h1>
{% endif %}
{# Content #}
{% block content %}
<a id="main-content"></a>
{{ page.content }}
{% endblock %}
</section>
</div>
</main>

View File

@@ -0,0 +1,21 @@
{#
/**
* @file
* Default theme implementation 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.
*
* @ingroup templates
*
* @see template_preprocess_page_title()
*/
#}
{% if title %}
<h1{{ title_attributes.addClass('page-header') }}>{{ title }}</h1>
{% endif %}

View File

@@ -0,0 +1,168 @@
{#
/**
* @file
* Default theme implementation to display a single page.
*
* The doctype, html, head and body tags are not in this template. Instead they
* can be found in the html.html.twig template in this directory.
*
* Available variables:
*
* General utility variables:
* - base_path: The base URL path of the Drupal installation. Will usually be
* "/" unless you have installed Drupal in a sub-directory.
* - is_front: A flag indicating if the current page is the front page.
* - logged_in: A flag indicating if the user is registered and signed in.
* - is_admin: A flag indicating if the user has permission to access
* administration pages.
*
* Site identity:
* - front_page: The URL of the front page. Use this instead of base_path when
* linking to the front page. This includes the language domain or prefix.
*
* Page content (in order of occurrence in the default page.html.twig):
* - 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.
* - messages: Status and error messages. Should be displayed prominently.
* - tabs: Tabs linking to any sub-pages beneath the current page (e.g., the
* view and edit tabs when displaying a node).
* - node: Fully loaded node, if there is an automatically-loaded node
* associated with the page and the node ID is the second argument in the
* page's path (e.g. node/12345 and node/12345/revisions, but not
* comment/reply/12345).
*
* Regions:
* - page.header: Items for the header region.
* - page.navigation: Items for the navigation region.
* - page.navigation_collapsible: Items for the navigation (collapsible) region.
* - page.highlighted: Items for the highlighted content region.
* - page.help: Dynamic help text, mostly for admin pages.
* - page.content: The main content of the current page.
* - page.sidebar_first: Items for the first sidebar.
* - page.sidebar_second: Items for the second sidebar.
* - page.footer: Items for the footer region.
*
* @ingroup templates
*
* @see template_preprocess_page()
* @see html.html.twig
*/
#}
{% set container = theme.settings.fluid_container ? 'container-fluid' : 'container' %}
{# Navbar #}
{% if page.navigation or page.navigation_collapsible %}
{% block navbar %}
{%
set navbar_classes = [
'navbar',
theme.settings.navbar_inverse ? 'navbar-inverse' : 'navbar-default',
theme.settings.navbar_position ? 'navbar-' ~ theme.settings.navbar_position|clean_class : container,
]
%}
<header{{ navbar_attributes.addClass(navbar_classes) }} id="navbar" role="banner">
{% if not navbar_attributes.hasClass(container) %}
<div class="{{ container }}">
{% endif %}
<div class="navbar-header">
{{ page.navigation }}
{# .btn-navbar is used as the toggle for collapsed navbar content #}
{% if page.navigation_collapsible %}
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
<span class="sr-only">{{ 'Toggle navigation'|t }}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
{% endif %}
</div>
{# Navigation (collapsible) #}
{% if page.navigation_collapsible %}
<div id="navbar-collapse" class="navbar-collapse collapse">
{{ page.navigation_collapsible }}
</div>
{% endif %}
{% if not navbar_attributes.hasClass(container) %}
</div>
{% endif %}
</header>
{% endblock %}
{% endif %}
{# Main #}
{% block main %}
<div role="main" class="main-container {{ container }} js-quickedit-main-content">
<div class="row">
{# Header #}
{% if page.header %}
{% block header %}
<div class="col-sm-12" role="heading">
{{ page.header }}
</div>
{% endblock %}
{% endif %}
{# Sidebar First #}
{% if page.sidebar_first %}
{% block sidebar_first %}
<aside class="col-sm-3" role="complementary">
{{ page.sidebar_first }}
</aside>
{% endblock %}
{% endif %}
{# Content #}
{%
set content_classes = [
page.sidebar_first and page.sidebar_second ? 'col-sm-6',
page.sidebar_first and page.sidebar_second is empty ? 'col-sm-9',
page.sidebar_second and page.sidebar_first is empty ? 'col-sm-9',
page.sidebar_first is empty and page.sidebar_second is empty ? 'col-sm-12'
]
%}
<section{{ content_attributes.addClass(content_classes) }}>
{# Highlighted #}
{% if page.highlighted %}
{% block highlighted %}
<div class="highlighted">{{ page.highlighted }}</div>
{% endblock %}
{% endif %}
{# Help #}
{% if page.help %}
{% block help %}
{{ page.help }}
{% endblock %}
{% endif %}
{# Content #}
{% block content %}
<a id="main-content"></a>
{{ page.content }}
{% endblock %}
</section>
{# Sidebar Second #}
{% if page.sidebar_second %}
{% block sidebar_second %}
<aside class="col-sm-3" role="complementary">
{{ page.sidebar_second }}
</aside>
{% endblock %}
{% endif %}
</div>
</div>
{% endblock %}
{% if page.footer %}
{% block footer %}
<footer class="footer {{ container }}" role="contentinfo">
{{ page.footer }}
</footer>
{% endblock %}
{% endif %}

View File

@@ -0,0 +1,108 @@
{#
/**
* @file
* Default theme implementation to display a pager.
*
* Available variables:
* - items: List of pager items.
* The list is keyed by the following elements:
* - first: Item for the first page; not present on the first page of results.
* - previous: Item for the previous page; not present on the first page
* of results.
* - next: Item for the next page; not present on the last page of results.
* - last: Item for the last page; not present on the last page of results.
* - pages: List of pages, keyed by page number.
* Sub-sub elements:
* items.first, items.previous, items.next, items.last, and each item inside
* items.pages contain the following elements:
* - href: URL with appropriate query parameters for the item.
* - attributes: A keyed list of HTML attributes for the item.
* - text: The visible text used for the item link, such as " previous"
* or "next ".
* - current: The page number of the current page.
* - ellipses: If there are more pages than the quantity allows, then an
* ellipsis before or after the listed pages may be present.
* - previous: Present if the currently visible list of pages does not start
* at the first page.
* - next: Present if the visible list of pages ends before the last page.
*
* @ingroup templates
*
* @see template_preprocess_pager()
*/
#}
{% if items %}
<nav class="pager-nav text-center" role="navigation" aria-labelledby="pagination-heading">
<h4 id="pagination-heading" class="visually-hidden">{{ 'Pagination'|t }}</h4>
<ul class="pagination js-pager__items">
{# Print first item if we are not on the first page. #}
{% if items.first %}
<li class="pager__item pager__item--first">
<a href="{{ items.first.href }}" title="{{ 'Go to first page'|t }}" rel="first"{{ items.first.attributes }}>
<span class="visually-hidden">{{ 'First page'|t }}</span>
<span aria-hidden="true">{{ items.first.text|default('first'|t) }}</span>
</a>
</li>
{% endif %}
{# Print previous item if we are not on the first page. #}
{% if items.previous %}
<li class="pager__item pager__item--previous">
<a href="{{ items.previous.href }}" title="{{ 'Go to previous page'|t }}" rel="prev"{{ items.previous.attributes }}>
<span class="visually-hidden">{{ 'Previous page'|t }}</span>
<span aria-hidden="true">{{ items.previous.text|default('previous'|t) }}</span>
</a>
</li>
{% endif %}
{# Add an ellipsis if there are further previous pages. #}
{% if ellipses.previous %}
<li class="page-item" role="presentation"><span class="page-link">&hellip;</span></li>
{% endif %}
{# Now generate the actual pager piece. #}
{% for key, item in items.pages %}
<li class="pager__item{{ current == key ? ' is-active active' : '' }}">
{% if current == key %}
{% set title = 'Current page'|t %}
{% else %}
{% set title = 'Go to page @key'|t({'@key': key}) %}
{% endif %}
<a href="{{ item.href }}" title="{{ title }}"{{ item.attributes }}>
<span class="visually-hidden">
{{ current == key ? 'Current page'|t : 'Page'|t }}
</span>
{{- key -}}
</a>
</li>
{% endfor %}
{# Add an ellipsis if there are further next pages. #}
{% if ellipses.next %}
<li class="page-item" role="presentation"><span class="page-link">&hellip;</span></li>
{% endif %}
{# Print next item if we are not on the last page. #}
{% if items.next %}
<li class="pager__item pager__item--next">
<a href="{{ items.next.href }}" title="{{ 'Go to next page'|t }}" rel="next"{{ items.next.attributes }}>
<span class="visually-hidden">{{ 'Next page'|t }}</span>
<span aria-hidden="true">{{ items.next.text|default('next'|t) }}</span>
</a>
</li>
{% endif %}
{# Print last item if we are not on the last page. #}
{% if items.last %}
<li class="pager__item pager__item--last">
<a href="{{ items.last.href }}" title="{{ 'Go to last page'|t }}" rel="last"{{ items.last.attributes }}>
<span class="visually-hidden">{{ 'Last page'|t }}</span>
<span aria-hidden="true">{{ items.last.text|default('last'|t) }}</span>
</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}

View File

@@ -0,0 +1,38 @@
{#
/**
* @file
* Default theme implementation for a progress bar.
*
* Note that the core Batch API uses this only for non-JavaScript batch jobs.
*
* Available variables:
* - attributes: An array of HTML attributes intended to be added to the
progress bar container of this template.
* - id: A valid HTML ID and guaranteed to be unique.
* - label: The label of the working task.
* - percent: The percentage of the progress.
* - message: A string containing information to be displayed.
*
* @ingroup templates
*/
#}
<div class="progress-wrapper" aria-live="polite" data-drupal-progress>
{% if message %}
<div class="message">{{ message }}</div>
{% endif %}
{%
set classes = [
'progress',
'progress-striped',
'active',
]
%}
<div{{ attributes.addClass(classes) }}>
<div class="progress-bar" role="progressbar" style="width: {{ percent }}%" aria-valuemin="0" aria-valuemax="100" aria-valuenow="{{ percent }}">
<span class="percentage">{{ percent }}%</span>
</div>
</div>
{% if label %}
<div class="progress-label">{{ label }}</div>
{% endif %}
</div>

View File

@@ -0,0 +1,19 @@
{#
/**
* @file
* Default theme implementation 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.
*
* @ingroup templates
*
* @see template_preprocess_region()
*/
#}
{% if content %}
{{ content }}
{% endif %}

View File

@@ -0,0 +1,27 @@
{#
/**
* @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.
*
* @ingroup templates
*
* @see template_preprocess_region()
*/
#}
{%
set classes = [
'region',
'region-' ~ region|clean_class,
]
%}
{% if content %}
<div{{ attributes.addClass(classes) }}>
{{ content }}
</div>
{% endif %}

View File

@@ -0,0 +1,83 @@
{#
/**
* @file
* Default theme implementation 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 http://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.
* - display: (optional) May have a value of 'status' or 'error' when only
* displaying messages of that specific type.
* - attributes: HTML attributes for the element, including:
* - class: HTML classes.
*
* @ingroup templates
*
* @see template_preprocess_status_messages()
*/
#}
{# Save original attribute classes. This is needed to override in loop below. #}
{# @see https://www.drupal.org/project/bootstrap/issues/2892936 #}
{% set classes = attributes.offsetGet('class')|default({}) %}
{%
set status_heading = {
'status': 'Status message'|t,
'error': 'Error message'|t,
'warning': 'Warning message'|t,
'info': 'Informative message'|t,
}
%}
{%
set status_classes = {
'status': 'success',
'error': 'danger',
'warning': 'warning',
'info': 'info',
}
%}
{%
set status_roles = {
'status': 'status',
'error': 'alert',
'warning': 'alert',
'info': 'status',
}
%}
<div data-drupal-messages>
<div class="messages__wrapper">
{% for type, messages in message_list %}
{%
set message_classes = [
'alert',
'alert-' ~ status_classes[type],
'alert-dismissible',
]
%}
{# Reset the attribute classes and then add the message specific classes. #}
<div{{ attributes.setAttribute('class', classes).addClass(message_classes).setAttribute('role', status_roles[type]).setAttribute('aria-label', status_headings[type]) }}>
<button type="button" role="button" class="close" data-dismiss="alert" aria-label="{{ 'Close'|t }}"><span aria-hidden="true">&times;</span></button>
{% if status_headings[type] %}
<h2 class="sr-only">{{ status_headings[type] }}</h2>
{% endif %}
{% if messages|length > 1 %}
<ul class="item-list item-list--messages">
{% for message in messages %}
<li class="item item--message">{{ message }}</li>
{% endfor %}
</ul>
{% else %}
<p>{{ messages|first }}</p>
{% endif %}
</div>
{% endfor %}
</div>
</div>

View File

@@ -0,0 +1,95 @@
{#
/**
* @file
* Theme override for the Appearance page.
*
* Available variables:
* - attributes: HTML attributes for the main container.
* - theme_groups: A list of theme groups. Each theme group contains:
* - attributes: HTML attributes specific to this theme group.
* - title: Title for the theme group.
* - state: State of the theme group, e.g. installed or uninstalled.
* - themes: A list of themes within the theme group. Each theme contains:
* - attributes: HTML attributes specific to this theme.
* - screenshot: A screenshot representing the theme.
* - description: Description of the theme.
* - name: Theme name.
* - version: The theme's version number.
* - is_default: Boolean indicating whether the theme is the default theme
* or not.
* - is_admin: Boolean indicating whether the theme is the admin theme or
* not.
* - notes: Identifies what context this theme is being used in, e.g.,
* default theme, admin theme.
* - incompatible: Text describing any compatibility issues.
* - operations: A list of operation links, e.g., Settings, Enable, Disable,
* etc. these links should only be displayed if the theme is compatible.
*
* @ingroup templates
*
* @see template_preprocess_system_themes_page()
*/
#}
<div{{ attributes.addClass('form-group') }}>
{% for theme_group in theme_groups %}
{%
set theme_group_classes = [
'system-themes-list',
'system-themes-list-' ~ theme_group.state,
'clearfix',
'panel',
'panel-default',
]
%}
<div{{ theme_group.attributes.addClass(theme_group_classes) }}>
<div class="panel-heading">
<a class="panel-title" href="#system-themes-list--{{ theme_group.state }}" aria-controls="#system-themes-list--{{ theme_group.state }}" aria-expanded="false" aria-pressed="false" data-toggle="collapse" role="button">
{{ theme_group.title }} ({{ theme_group.themes|length }})
</a>
</div>
{%
set table_classes = [
'table',
'panel-collapse',
theme_group.state == 'uninstalled' ? 'collapse',
'fade',
theme_group.state != 'uninstalled' ? 'in',
]
%}
<table id="system-themes-list--{{ theme_group.state }}" class="{{ table_classes|join(' ')}}">
{% for theme in theme_group.themes %}
{%
set theme_classes = [
theme.is_default ? 'theme-default',
theme.is_admin ? 'theme-admin',
'theme-selector',
'clearfix',
]
%}
<tr{{ theme.attributes.addClass(theme_classes) }}>
<td class="col-sm-3">
{% if theme.screenshot %}
{{ theme.screenshot }}
{% endif %}
</td>
<td class="theme-info col-sm-9">
<h4 class="theme-info__header">
{{- theme.name }} {{ theme.version -}}
{% if theme.notes %}
({{ theme.notes|safe_join(', ') }})
{%- endif -%}
</h4>
<div class="theme-info__description help-block">{{ theme.description }}</div>
{# Display operation links if the theme is compatible. #}
{% if theme.incompatible %}
<div class="incompatible">{{ theme.incompatible }}</div>
{% else %}
{{ theme.operations }}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
{% endfor %}
</div>

View File

@@ -0,0 +1,132 @@
{#
/**
* @file
* Default theme implementation 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.
* - 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.
* - header_columns: The number of columns in the header.
* - bordered: Flag indicating whether or not the table should be bordered.
* - condensed: Flag indicating whether or not the table should be condensed.
* - hover: Flag indicating whether or not table rows should be hoverable.
* - striped: Flag indicating whether or not table rows should be striped.
* - responsive: Flag indicating whether or not the table should be wrapped to
* be responsive (using the Bootstrap Framework .table-responsive wrapper).
*
* @ingroup templates
*
* @see template_preprocess_table()
*/
#}
{% if responsive %}
<div class="table-responsive">
{% endif %}
{%
set classes = [
'table',
bordered ? 'table-bordered',
condensed ? 'table-condensed',
hover ? 'table-hover',
striped ? 'table-striped',
sticky ? 'sticky-enabled',
]
%}
<table{{ attributes.addClass(classes) }}>
{% 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 ? '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 = [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>
{% if responsive %}
</div>
{% endif %}

View File

@@ -0,0 +1,13 @@
{#
/**
* @file
* Theme override for displaying a tablesort indicator.
*
* Available variables:
* - style: Either 'asc' or 'desc', indicating the sorting direction.
* - icon: The Drupal Bootstrap glypicon.
*
* @see \Drupal\bootstrap\Plugin\Preprocess\TableSortIndicator::preprocessVariables()
*/
#}
{{- icon -}}

View File

@@ -0,0 +1,23 @@
{#
/**
* @file
* Default theme implementation of a views exposed form.
*
* Available variables:
* - form: A render element representing the form.
*
* @ingroup templates
*
* @see template_preprocess_views_exposed_form()
*/
#}
{% if q is not empty %}
{#
This ensures that, if clean URLs are off, the 'q' is added first,
as a hidden form element, so that it shows up first in the POST URL.
#}
{{ q }}
{% endif %}
<div class="form--inline form-inline clearfix">
{{ form }}
</div>

View File

@@ -0,0 +1,36 @@
{#
/**
* @file
* Theme override for a views mini-pager.
*
* Available variables:
* - items: List of pager items.
*
* @ingroup templates
*
* @see template_preprocess_views_mini_pager()
*/
#}
{% if items.previous or items.next %}
<nav role="navigation" aria-labelledby="pagination-heading">
<h4 class="sr-only">{{ 'Pagination'|t }}</h4>
<ul class="pager js-pager__items">
{% if items.previous %}
<li class="previous">
<a href="{{ items.previous.href }}" title="{{ 'Go to previous page'|t }}" rel="prev"{{ items.previous.attributes|without('href', 'title', 'rel') }}>
<span class="sr-only">{{ 'Previous page'|t }}</span>
<span aria-hidden="true">{{ items.previous.text|default(''|t) }}</span>
</a>
</li>
{% endif %}
{% if items.next %}
<li class="next">
<a href="{{ items.next.href }}" title="{{ 'Go to next page'|t }}" rel="next"{{ items.next.attributes|without('href', 'title', 'rel') }}>
<span class="sr-only">{{ 'Next page'|t }}</span>
<span aria-hidden="true">{{ items.next.text|default(''|t) }}</span>
</a>
</li>
{% endif %}
</ul>
</nav>
{% endif %}

View File

@@ -0,0 +1,132 @@
{#
/**
* @file
* Default theme implementation for displaying a view as a table.
*
* Available variables:
* - attributes: Remaining HTML attributes for the element.
* - class: HTML classes that can be used to style contextually through CSS.
* - title : The title of this group of rows.
* - header: The table header columns.
* - attributes: Remaining HTML attributes for the element.
* - content: HTML classes to apply to each header cell, indexed by
* the header's key.
* - caption_needed: Is the caption tag needed.
* - caption: The caption for this table.
* - accessibility_description: Extended description for the table details.
* - accessibility_summary: Summary for the table details.
* - responsive: Whether or not to use the .table-responsive wrapper.
* - rows: Table row items. Rows are keyed by row number.
* - attributes: HTML classes to apply to each row.
* - columns: Row column items. Columns are keyed by column number.
* - attributes: HTML classes to apply to each column.
* - content: The column content.
* - bordered: Flag indicating whether or not the table should be bordered.
* - condensed: Flag indicating whether or not the table should be condensed.
* - hover: Flag indicating whether or not table rows should be hoverable.
* - striped: Flag indicating whether or not table rows should be striped.
* - responsive: Flag indicating whether or not the table should be wrapped to
* be responsive (using the Bootstrap Framework .table-responsive wrapper).
*
* @ingroup templates
*
* @see template_preprocess_views_view_table()
*/
#}
{% if responsive %}
<div class="table-responsive">
{% endif %}
{%
set classes = [
'table',
bordered ? 'table-bordered',
condensed ? 'table-condensed',
hover ? 'table-hover',
striped ? 'table-striped',
sticky ? 'sticky-enabled',
]
%}
<table{{ attributes.addClass(classes) }}>
{% if caption_needed %}
<caption>
{% if caption %}
{{ caption }}
{% else %}
{{ title }}
{% endif %}
{% if (summary is not empty) or (description is not empty) %}
<details>
{% if summary is not empty %}
<summary>{{ summary }}</summary>
{% endif %}
{% if description is not empty %}
{{ description }}
{% endif %}
</details>
{% endif %}
</caption>
{% endif %}
{% if header %}
<thead>
<tr>
{% for key, column in header %}
{% if column.default_classes %}
{%
set column_classes = [
'views-field',
'views-field-' ~ fields[key],
]
%}
{% endif %}
<th{{ column.attributes.addClass(column_classes).setAttribute('scope', 'col') }}>
{%- if column.wrapper_element -%}
<{{ column.wrapper_element }}>
{%- if column.url -%}
<a href="{{ column.url }}" title="{{ column.title }}">{{ column.content }}{{ column.sort_indicator }}</a>
{%- else -%}
{{ column.content }}{{ column.sort_indicator }}
{%- endif -%}
</{{ column.wrapper_element }}>
{%- else -%}
{%- if column.url -%}
<a href="{{ column.url }}" title="{{ column.title }}">{{ column.content }}{{ column.sort_indicator }}</a>
{%- else -%}
{{- column.content }}{{ column.sort_indicator }}
{%- endif -%}
{%- endif -%}
</th>
{% endfor %}
</tr>
</thead>
{% endif %}
<tbody>
{% for row in rows %}
<tr{{ row.attributes }}>
{% for key, column in row.columns %}
{% if column.default_classes %}
{% set column_classes = [ 'views-field' ] %}
{% for field in column.fields %}
{% set column_classes = column_classes|merge(['views-field-' ~ field]) %}
{% endfor %}
{% endif %}
<td{{ column.attributes.addClass(column_classes) }}>
{%- if column.wrapper_element -%}
<{{ column.wrapper_element }}>
{% for content in column.content %}
{{ content.separator }}{{ content.field_output }}
{% endfor %}
</{{ column.wrapper_element }}>
{%- else -%}
{% for content in column.content %}
{{- content.separator }}{{ content.field_output -}}
{% endfor %}
{%- endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% if responsive %}
</div>
{% endif %}

View File

@@ -0,0 +1,97 @@
{#
/**
* @file
* Default theme implementation for 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.
*
* @ingroup templates
*
* @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 form-group">
{{ 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>