Issue #2407565 by epari.siva, davidhernandez, akalata, pakmanlh, lauriii, vedpareek, Cottser, brianperry: Consensus Banana Phase 1, cleanup

8.0.x
webchick 2015-04-18 08:48:42 -07:00
parent e600895aa0
commit 6db8cde589
9 changed files with 10 additions and 9 deletions

View File

@ -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)')));

View File

@ -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

View File

@ -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';
}
/**

View File

@ -12,6 +12,6 @@
* @ingroup themeable
*/
#}
<div{{ attributes }}>
<div{{ attributes.addClass('form-managed-file') }}>
{{ element }}
</div>

View File

@ -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()
*

View File

@ -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

View File

@ -10,6 +10,6 @@
* @see template_preprocess_file_managed_file()
*/
#}
<div{{ attributes }}>
<div{{ attributes.addClass('form-managed-file') }}>
{{ element }}
</div>

View File

@ -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>

View File

@ -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>