Update to Drupal 8.0-dev-2015-11-17. Commits through da81cd220, Tue Nov 17 15:53:49 2015 +0000, Issue #2617224 by Wim Leers: Move around/fix some documentation.
This commit is contained in:
parent
4afb23bbd3
commit
7784f4c23d
929 changed files with 19798 additions and 5304 deletions
|
@ -0,0 +1,22 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for rendering book outlines within a block.
|
||||
*
|
||||
* This template is used only when the block is configured to "show block on all
|
||||
* pages", which presents multiple independent books on all pages.
|
||||
*
|
||||
* Available variables:
|
||||
* - book_menus: Book outlines.
|
||||
* - id: The parent book ID.
|
||||
* - title: The parent book title.
|
||||
* - menu: The top-level book links.
|
||||
*
|
||||
* @see template_preprocess_book_all_books_block()
|
||||
*/
|
||||
#}
|
||||
{% for book in book_menus %}
|
||||
<nav role="navigation" aria-label="{% trans %}Book outline for {{ book.title }}{% endtrans %}">
|
||||
{{ book.menu }}
|
||||
</nav>
|
||||
{% endfor %}
|
|
@ -0,0 +1,55 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to navigate books.
|
||||
*
|
||||
* Presented under nodes that are a part of book outlines.
|
||||
*
|
||||
* Available variables:
|
||||
* - tree: The immediate children of the current node rendered as an unordered
|
||||
* list.
|
||||
* - current_depth: Depth of the current node within the book outline. Provided
|
||||
* for context.
|
||||
* - prev_url: URL to the previous node.
|
||||
* - prev_title: Title of the previous node.
|
||||
* - parent_url: URL to the parent node.
|
||||
* - parent_title: Title of the parent node. Not printed by default. Provided
|
||||
* as an option.
|
||||
* - next_url: URL to the next node.
|
||||
* - next_title: Title of the next node.
|
||||
* - has_links: Flags TRUE whenever the previous, parent or next data has a
|
||||
* value.
|
||||
* - book_id: The book ID of the current outline being viewed. Same as the node
|
||||
* ID containing the entire outline. Provided for context.
|
||||
* - book_url: The book/node URL of the current outline being viewed. Provided
|
||||
* as an option. Not used by default.
|
||||
* - book_title: The book/node title of the current outline being viewed.
|
||||
*
|
||||
* @see template_preprocess_book_navigation()
|
||||
*/
|
||||
#}
|
||||
{% if tree or has_links %}
|
||||
<nav role="navigation" aria-labelledby="book-label-{{ book_id }}">
|
||||
{{ tree }}
|
||||
{% if has_links %}
|
||||
<h2>{{ 'Book traversal links for'|t }} {{ book_title }}</h2>
|
||||
<ul>
|
||||
{% if prev_url %}
|
||||
<li>
|
||||
<a href="{{ prev_url }}" rel="prev" title="{{ 'Go to previous page'|t }}"><b>{{ '‹'|t }}</b> {{ prev_title }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if parent_url %}
|
||||
<li>
|
||||
<a href="{{ parent_url }}" title="{{ 'Go to parent page'|t }}">{{ 'Up'|t }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if next_url %}
|
||||
<li>
|
||||
<a href="{{ next_url }}" rel="next" title="{{ 'Go to next page'|t }}">{{ next_title }} <b>{{ '›'|t }}</b></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endif %}
|
47
core/themes/stable/templates/navigation/book-tree.html.twig
Normal file
47
core/themes/stable/templates/navigation/book-tree.html.twig
Normal file
|
@ -0,0 +1,47 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a book tree.
|
||||
*
|
||||
* Returns HTML for a wrapper for a book sub-tree.
|
||||
*
|
||||
* Available variables:
|
||||
* - items: A nested list of book items. Each book item contains:
|
||||
* - attributes: HTML attributes for the book item.
|
||||
* - below: The book item child items.
|
||||
* - title: The book link title.
|
||||
* - url: The book link URL, instance of \Drupal\Core\Url.
|
||||
* - is_expanded: TRUE if the link has visible children within the current
|
||||
* book tree.
|
||||
* - is_collapsed: TRUE if the link has children within the current book tree
|
||||
* that are not currently visible.
|
||||
* - in_active_trail: TRUE if the link is in the active trail.
|
||||
*/
|
||||
#}
|
||||
{% import _self as book_tree %}
|
||||
|
||||
{#
|
||||
We call a macro which calls itself to render the full tree.
|
||||
@see http://twig.sensiolabs.org/doc/tags/macro.html
|
||||
#}
|
||||
{{ book_tree.book_links(items, attributes, 0) }}
|
||||
|
||||
{% macro book_links(items, attributes, menu_level) %}
|
||||
{% import _self as book_tree %}
|
||||
{% if items %}
|
||||
{% if menu_level == 0 %}
|
||||
<ul{{ attributes }}>
|
||||
{% else %}
|
||||
<ul>
|
||||
{% endif %}
|
||||
{% for item in items %}
|
||||
<li{{ item.attributes }}>
|
||||
{{ link(item.title, item.url) }}
|
||||
{% if item.below %}
|
||||
{{ book_tree.book_links(item.below, attributes, menu_level + 1) }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
25
core/themes/stable/templates/navigation/breadcrumb.html.twig
Normal file
25
core/themes/stable/templates/navigation/breadcrumb.html.twig
Normal file
|
@ -0,0 +1,25 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a breadcrumb trail.
|
||||
*
|
||||
* Available variables:
|
||||
* - breadcrumb: Breadcrumb trail items.
|
||||
*/
|
||||
#}
|
||||
{% if breadcrumb %}
|
||||
<nav role="navigation" aria-labelledby="system-breadcrumb">
|
||||
<h2 class="visually-hidden">{{ 'Breadcrumb'|t }}</h2>
|
||||
<ol>
|
||||
{% for item in breadcrumb %}
|
||||
<li>
|
||||
{% if item.url %}
|
||||
<a href="{{ item.url }}">{{ item.text }}</a>
|
||||
{% else %}
|
||||
{{ item.text }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</nav>
|
||||
{% endif %}
|
56
core/themes/stable/templates/navigation/links.html.twig
Normal file
56
core/themes/stable/templates/navigation/links.html.twig
Normal file
|
@ -0,0 +1,56 @@
|
|||
{#
|
||||
/**
|
||||
* @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.
|
||||
*
|
||||
* @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 -%}
|
||||
<ul{{ attributes }}>
|
||||
{%- 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 %}
|
|
@ -0,0 +1,55 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a toolbar menu.
|
||||
*
|
||||
* Available variables:
|
||||
* - menu_name: The machine name of the menu.
|
||||
* - items: A nested list of menu items. Each menu item contains:
|
||||
* - attributes: HTML attributes for the menu item.
|
||||
* - below: The menu item child items.
|
||||
* - title: The menu link title.
|
||||
* - url: The menu link url, instance of \Drupal\Core\Url
|
||||
* - localized_options: Menu link localized options.
|
||||
* - is_expanded: TRUE if the link has visible children within the current
|
||||
* menu tree.
|
||||
* - is_collapsed: TRUE if the link has children within the current menu tree
|
||||
* that are not currently visible.
|
||||
* - in_active_trail: TRUE if the link is in the active trail.
|
||||
*/
|
||||
#}
|
||||
{% import _self as menus %}
|
||||
|
||||
{#
|
||||
We call a macro which calls itself to render the full tree.
|
||||
@see http://twig.sensiolabs.org/doc/tags/macro.html
|
||||
#}
|
||||
{{ menus.menu_links(items, attributes, 0) }}
|
||||
|
||||
{% macro menu_links(items, attributes, menu_level) %}
|
||||
{% import _self as menus %}
|
||||
{% if items %}
|
||||
{% if menu_level == 0 %}
|
||||
<ul{{ attributes.addClass('toolbar-menu') }}>
|
||||
{% else %}
|
||||
<ul class="toolbar-menu">
|
||||
{% endif %}
|
||||
{% for item in items %}
|
||||
{%
|
||||
set classes = [
|
||||
'menu-item',
|
||||
item.is_expanded ? 'menu-item--expanded',
|
||||
item.is_collapsed ? 'menu-item--collapsed',
|
||||
item.in_active_trail ? 'menu-item--active-trail',
|
||||
]
|
||||
%}
|
||||
<li{{ item.attributes.addClass(classes) }}>
|
||||
{{ link(item.title, item.url) }}
|
||||
{% if item.below %}
|
||||
{{ menus.menu_links(item.below, attributes, menu_level + 1) }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
|
@ -0,0 +1,13 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a single local action link.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the wrapper element.
|
||||
* - link: A rendered link element.
|
||||
*
|
||||
* @see template_preprocess_menu_local_action()
|
||||
*/
|
||||
#}
|
||||
<li{{ attributes }}>{{ link }}</li>
|
|
@ -0,0 +1,17 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a local task link.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the wrapper element.
|
||||
* - is_active: Whether the task item is an active tab.
|
||||
* - link: A rendered link element.
|
||||
*
|
||||
* Note: This template renders the content for each task item in
|
||||
* menu-local-tasks.html.twig.
|
||||
*
|
||||
* @see template_preprocess_menu_local_task()
|
||||
*/
|
||||
#}
|
||||
<li{{ attributes }}>{{ link }}</li>
|
|
@ -0,0 +1,23 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override 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.
|
||||
*
|
||||
* @see template_preprocess_menu_local_tasks()
|
||||
*/
|
||||
#}
|
||||
{% if primary %}
|
||||
<h2 class="visually-hidden">{{ 'Primary tabs'|t }}</h2>
|
||||
<ul>{{ primary }}</ul>
|
||||
{% endif %}
|
||||
{% if secondary %}
|
||||
<h2 class="visually-hidden">{{ 'Secondary tabs'|t }}</h2>
|
||||
<ul>{{ secondary }}</ul>
|
||||
{% endif %}
|
47
core/themes/stable/templates/navigation/menu.html.twig
Normal file
47
core/themes/stable/templates/navigation/menu.html.twig
Normal file
|
@ -0,0 +1,47 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a menu.
|
||||
*
|
||||
* Available variables:
|
||||
* - menu_name: The machine name of the menu.
|
||||
* - items: A nested list of menu items. Each menu item contains:
|
||||
* - attributes: HTML attributes for the menu item.
|
||||
* - below: The menu item child items.
|
||||
* - title: The menu link title.
|
||||
* - url: The menu link url, instance of \Drupal\Core\Url
|
||||
* - localized_options: Menu link localized options.
|
||||
* - is_expanded: TRUE if the link has visible children within the current
|
||||
* menu tree.
|
||||
* - is_collapsed: TRUE if the link has children within the current menu tree
|
||||
* that are not currently visible.
|
||||
* - in_active_trail: TRUE if the link is in the active trail.
|
||||
*/
|
||||
#}
|
||||
{% import _self as menus %}
|
||||
|
||||
{#
|
||||
We call a macro which calls itself to render the full tree.
|
||||
@see http://twig.sensiolabs.org/doc/tags/macro.html
|
||||
#}
|
||||
{{ menus.menu_links(items, attributes, 0) }}
|
||||
|
||||
{% macro menu_links(items, attributes, menu_level) %}
|
||||
{% import _self as menus %}
|
||||
{% if items %}
|
||||
{% if menu_level == 0 %}
|
||||
<ul{{ attributes }}>
|
||||
{% else %}
|
||||
<ul>
|
||||
{% endif %}
|
||||
{% for item in items %}
|
||||
<li{{ item.attributes }}>
|
||||
{{ link(item.title, item.url) }}
|
||||
{% if item.below %}
|
||||
{{ menus.menu_links(item.below, attributes, menu_level + 1) }}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
98
core/themes/stable/templates/navigation/pager.html.twig
Normal file
98
core/themes/stable/templates/navigation/pager.html.twig
Normal file
|
@ -0,0 +1,98 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override 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.
|
||||
*
|
||||
* @see template_preprocess_pager()
|
||||
*/
|
||||
#}
|
||||
{% if items %}
|
||||
<nav class="pager" role="navigation" aria-labelledby="pagination-heading">
|
||||
<h4 id="pagination-heading" class="visually-hidden">{{ 'Pagination'|t }}</h4>
|
||||
<ul class="pager__items 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 }}"{{ items.first.attributes|without('href', 'title') }}>
|
||||
<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|without('href', 'title', 'rel') }}>
|
||||
<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="pager__item pager__item--ellipsis" role="presentation">…</li>
|
||||
{% endif %}
|
||||
{# Now generate the actual pager piece. #}
|
||||
{% for key, item in items.pages %}
|
||||
<li class="pager__item{{ current == key ? ' is-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|without('href', 'title') }}>
|
||||
<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="pager__item pager__item--ellipsis" role="presentation">…</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|without('href', 'title', 'rel') }}>
|
||||
<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 }}"{{ items.last.attributes|without('href', 'title') }}>
|
||||
<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 %}
|
46
core/themes/stable/templates/navigation/toolbar.html.twig
Normal file
46
core/themes/stable/templates/navigation/toolbar.html.twig
Normal file
|
@ -0,0 +1,46 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for the administrative toolbar.
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the wrapper.
|
||||
* - toolbar_attributes: HTML attributes to apply to the toolbar.
|
||||
* - toolbar_heading: The heading or label for the toolbar.
|
||||
* - tabs: List of tabs for the toolbar.
|
||||
* - attributes: HTML attributes for the tab container.
|
||||
* - link: Link or button for the menu tab.
|
||||
* - trays: Toolbar tray list, each associated with a tab. Each tray in trays
|
||||
* contains:
|
||||
* - attributes: HTML attributes to apply to the tray.
|
||||
* - label: The tray's label.
|
||||
* - links: The tray menu links.
|
||||
* - remainder: Any non-tray, non-tab elements left to be rendered.
|
||||
*
|
||||
* @see template_preprocess_toolbar()
|
||||
*/
|
||||
#}
|
||||
<div{{ attributes.addClass('toolbar') }}>
|
||||
<nav{{ toolbar_attributes.addClass('toolbar-bar') }}>
|
||||
<h2 class="visually-hidden">{{ toolbar_heading }}</h2>
|
||||
{% for key, tab in tabs %}
|
||||
{% set tray = trays[key] %}
|
||||
<div{{ tab.attributes.addClass('toolbar-tab') }}>
|
||||
{{ tab.link }}
|
||||
{% spaceless %}
|
||||
<div{{ tray.attributes }}>
|
||||
{% if tray.label %}
|
||||
<nav class="toolbar-lining clearfix" role="navigation" aria-label="{{ tray.label }}">
|
||||
<h3 class="toolbar-tray-name visually-hidden">{{ tray.label }}</h3>
|
||||
{% else %}
|
||||
<nav class="toolbar-lining clearfix" role="navigation">
|
||||
{% endif %}
|
||||
{{ tray.links }}
|
||||
</nav>
|
||||
</div>
|
||||
{% endspaceless %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
{{ remainder }}
|
||||
</div>
|
|
@ -0,0 +1,13 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for vertical tabs.
|
||||
*
|
||||
* Available variables
|
||||
* - attributes: A list of HTML attributes for the wrapper element.
|
||||
* - children: The rendered checkboxes.
|
||||
*
|
||||
* @see template_preprocess_vertical_tabs()
|
||||
*/
|
||||
#}
|
||||
<div{{ attributes.setAttribute('data-vertical-tabs-panes', TRUE) }}>{{ children }}</div>
|
Reference in a new issue