Commit 6db8cde5 authored by webchick's avatar webchick

Issue #2407565 by epari.siva, davidhernandez, akalata, pakmanlh, lauriii,...

Issue #2407565 by epari.siva, davidhernandez, akalata, pakmanlh, lauriii, vedpareek, Cottser, brianperry: Consensus Banana Phase 1, cleanup
parent e600895a
......@@ -34,7 +34,7 @@ function template_preprocess_menu_local_task(&$variables) {
$link_text = $link['title'];
if (!empty($variables['element']['#active'])) {
$variables['attributes']['class'] = array('is-active');
$variables['is_active'] = TRUE;
// Add text to indicate active tab for non-visual users.
$active = SafeMarkup::format('<span class="visually-hidden">@label</span>', array('@label' => t('(active tab)')));
......
......@@ -1246,11 +1246,8 @@ function template_preprocess_html(&$variables) {
$variables['html_attributes']['lang'] = $language_interface->getId();
$variables['html_attributes']['dir'] = $language_interface->getDirection();
// Compile a list of classes that are going to be applied to the body element.
// This allows advanced theming based on context (home page, node of certain
// type, etc.).
if (isset($variables['db_is_active']) && !$variables['db_is_active']) {
$variables['attributes']['class'][] = 'db-offline';
$variables['db_offline'] = TRUE;
}
// Add a variable for the root path. This can be used to create a class and
......
......@@ -1192,7 +1192,6 @@ function template_preprocess_file_managed_file(&$variables) {
if (!empty($element['#attributes']['class'])) {
$variables['attributes']['class'] = (array) $element['#attributes']['class'];
}
$variables['attributes']['class'][] = 'form-managed-file';
}
/**
......
......@@ -12,6 +12,6 @@
* @ingroup themeable
*/
#}
<div{{ attributes }}>
<div{{ attributes.addClass('form-managed-file') }}>
{{ element }}
</div>
......@@ -23,6 +23,7 @@
* - styles: Style tags necessary to import all necessary CSS files in the head.
* - scripts: Script tags necessary to load the JavaScript files and settings
* in the head.
* - db_offline: A flag indicating if the database is offline.
*
* @see template_preprocess_html()
*
......
......@@ -5,6 +5,7 @@
*
* 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
......
......@@ -10,6 +10,6 @@
* @see template_preprocess_file_managed_file()
*/
#}
<div{{ attributes }}>
<div{{ attributes.addClass('form-managed-file') }}>
{{ element }}
</div>
......@@ -23,6 +23,7 @@
* - styles: Style tags necessary to import all necessary CSS files in the head.
* - scripts: Script tags necessary to load the JavaScript files and settings
* in the head.
* - db_offline: A flag indicating if the database is offline.
*
* @see template_preprocess_html()
*/
......@@ -32,6 +33,7 @@
logged_in ? 'user-logged-in',
not root_path ? 'path-frontpage' : 'path-' ~ root_path|clean_class,
node_type ? 'node--type-' ~ node_type|clean_class,
db_offline ? 'db-offline',
]
%}
<!DOCTYPE html>
......
......@@ -5,6 +5,7 @@
*
* 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
......@@ -13,4 +14,4 @@
* @see template_preprocess_menu_local_task()
*/
#}
<li{{ attributes }}>{{ link }}</li>
<li{{ attributes.addClass(is_active ? 'is-active') }}>{{ link }}</li>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment