From 60c3a75e8f5dc5d95539e4f7bfbb442c2333a40b Mon Sep 17 00:00:00 2001 From: Dries Date: Sun, 19 May 2013 08:31:33 -0700 Subject: [PATCH] Issue #1986408 by LewisNyman, oresh: Message style update. --- core/includes/authorize.inc | 2 +- core/includes/theme.inc | 2 +- core/misc/progress.js | 2 +- core/misc/tabledrag.js | 2 +- .../block/Plugin/views/display/Block.php | 2 +- .../Drupal/field_ui/Form/FieldEditForm.php | 2 +- core/modules/file/file.js | 2 +- core/modules/system/system.theme-rtl.css | 24 ++-- core/modules/system/system.theme.css | 107 +++++++++--------- .../Drupal/views/Plugin/views/query/Sql.php | 2 +- .../Drupal/views/Plugin/views/style/Table.php | 2 +- .../views_ui/ViewEditFormController.php | 4 +- core/update.php | 2 +- 13 files changed, 85 insertions(+), 70 deletions(-) diff --git a/core/includes/authorize.inc b/core/includes/authorize.inc index 9b1c85df399f..45e55c96e772 100644 --- a/core/includes/authorize.inc +++ b/core/includes/authorize.inc @@ -30,7 +30,7 @@ function authorize_filetransfer_form($form, &$form_state) { if (!Drupal::request()->isSecure()) { $form['information']['https_warning'] = array( - '#prefix' => '
', + '#prefix' => '
', '#markup' => t('WARNING: You are not using an encrypted connection, so your password will be sent in plain text. Learn more.', array('@https-link' => 'http://drupal.org/https-information')), '#suffix' => '
', ); diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 85ca1fad006f..c1792e861cc6 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1711,7 +1711,7 @@ function theme_status_messages($variables) { 'warning' => t('Warning message'), ); foreach (drupal_get_messages($display) as $type => $messages) { - $output .= "
\n"; + $output .= "
\n"; if (!empty($status_heading[$type])) { $output .= '

' . $status_heading[$type] . "

\n"; } diff --git a/core/misc/progress.js b/core/misc/progress.js index e4c5110565e2..5fc2110c710f 100644 --- a/core/misc/progress.js +++ b/core/misc/progress.js @@ -98,7 +98,7 @@ $.extend(Drupal.ProgressBar.prototype, { * Display errors on the page. */ displayError: function (string) { - var error = $('
').html(string); + var error = $('
').html(string); $(this.element).before(error).hide(); if (this.errorCallback) { diff --git a/core/misc/tabledrag.js b/core/misc/tabledrag.js index 99805ba61bfa..63989db3ddcb 100644 --- a/core/misc/tabledrag.js +++ b/core/misc/tabledrag.js @@ -1254,7 +1254,7 @@ $.extend(Drupal.theme, { return '
 
'; }, tableDragChangedWarning: function () { - return ''; + return ''; } }); diff --git a/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php b/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php index c1317d0fba12..4a3bf10ac773 100644 --- a/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php +++ b/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php @@ -150,7 +150,7 @@ class Block extends DisplayPluginBase { if (!$this->usesExposed() && parent::usesExposed()) { $form['exposed_form_options']['warning'] = array( '#weight' => -10, - '#markup' => '
' . t('Exposed filters in block displays require "Use AJAX" to be set to work correctly.') . '
', + '#markup' => '
' . t('Exposed filters in block displays require "Use AJAX" to be set to work correctly.') . '
', ); } } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldEditForm.php b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldEditForm.php index 8e8d89025886..eecb45572f59 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldEditForm.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldEditForm.php @@ -52,7 +52,7 @@ class FieldEditForm implements FormInterface { // If so, prevent changes to the field settings. $has_data = field_has_data($field); if ($has_data) { - $form['field']['#prefix'] = '
' . t('There is data for this field in the database. The field settings can no longer be changed.') . '
' . $form['field']['#prefix']; + $form['field']['#prefix'] = '
' . t('There is data for this field in the database. The field settings can no longer be changed.') . '
' . $form['field']['#prefix']; } // Build the configurable field values. diff --git a/core/modules/file/file.js b/core/modules/file/file.js index 7b9169cc136b..e1ee3230a92c 100644 --- a/core/modules/file/file.js +++ b/core/modules/file/file.js @@ -99,7 +99,7 @@ Drupal.file = Drupal.file || { '%filename': this.value.replace('C:\\fakepath\\', ''), '%extensions': extensionPattern.replace(/\|/g, ', ') }); - $(this).closest('div.form-managed-file').prepend('
' + error + '
'); + $(this).closest('div.form-managed-file').prepend('
' + error + '
'); this.value = ''; } } diff --git a/core/modules/system/system.theme-rtl.css b/core/modules/system/system.theme-rtl.css index b2ee45389ad7..eb50ab36e877 100644 --- a/core/modules/system/system.theme-rtl.css +++ b/core/modules/system/system.theme-rtl.css @@ -95,11 +95,21 @@ ul.menu { /** * RTL Styles for system messages. */ +.messages { + border-width: 1px 8px 1px 1px; + background-position-x: 99%; + padding-left: 20px; + padding-right: 35px; + text-align: right; +} +.messages--status { + background-position: 99.3% 19px; + border-color: #c9e1bd #77b259 #c9e1bd #c9e1bd; +} +.messages--warning { + border-color: #f4daa6 #e09600 #f4daa6 #f4daa6; +} +.messages--error { + border-color: #f9c9bf #e62600 #f9c9bf #f9c9bf; +} -div.messages { - background-position: 99% 8px; - padding: 10px 50px 10px 10px; -} -div.messages ul { - margin: 0 1em 0 0; -} diff --git a/core/modules/system/system.theme.css b/core/modules/system/system.theme.css index 3219a8f054b4..a3c770a8aa8c 100644 --- a/core/modules/system/system.theme.css +++ b/core/modules/system/system.theme.css @@ -428,62 +428,67 @@ ul.tabs { /** * Styles for system messages. */ -div.messages { - background-position: 8px 8px; /* LTR */ - background-repeat: no-repeat; +.messages { + background: no-repeat 10px 18px; /* LTR */ border: 1px solid; - margin: 6px 0; - padding: 10px 10px 10px 50px; /* LTR */ + border-width: 1px 1px 1px 8px; /* LTR */ + border-radius: 2px; + padding: 15px 20px 15px 35px; /* LTR */ word-wrap: break-word; overflow-wrap: break-word; } - -.messages.status { - background-image: url(../../misc/message-24-ok.png); - border-color: #be7; +.messages + .messages { + margin-top: 1.538em; } -.messages.status, -.ok { - color: #234600; -} -.messages.status, -table tr.ok { - background-color: #f8fff0; -} - -.messages.warning { - background-image: url(../../misc/message-24-warning.png); - border-color: #ed5; -} -.messages.warning, -.warning { - color: #840; -} -.messages.warning, -table tr.warning { - background-color: #fffce5; -} - -.messages.error { - background-image: url(../../misc/message-24-error.png); - border-color: #ed541d; -} -.messages.error, -.error { - color: #8c2e0b; -} -.messages.error, -table tr.error { - background-color: #fef5f1; -} -.messages.error p.error { - color: #333; -} - -div.messages ul { - margin: 0 0 0 1em; /* LTR */ +.messages ul { + list-style: none; padding: 0; + margin: 0; } -div.messages ul li { - list-style-image: none; +.messages li + li { + margin-top: .769em; +} + +/* @TODO Separate tables and messages styling */ +.messages--status { + border-color: #c9e1bd #c9e1bd #c9e1bd #77b259; /* LTR */ + background-image: url(../../misc/message-16-ok.png); + background-position: 12px 19px; /* LTR */ +} +.messages--status, +.ok { + color: #325e1c; +} +.messages--status, +table tr.ok { + background-color: #f3faef; +} + +.messages--warning { + background-image: url(../../misc/message-16-warning.png); + border-color: #f4daa6 #f4daa6 #f4daa6 #e09600; /* LTR */ +} +.messages--warning, +.warning { + color: #734c00; +} +.messages--warning, +table tr.warning { + background-color: #fdf8ed; +} + +.messages--error { + background-image: url(../../misc/message-16-error.png); + border-color: #f9c9bf #f9c9bf #f9c9bf #e62600; /* LTR */ +} +.messages--error, +.error { + color: #a51b00; +} +.messages--error, +table tr.error { + background-color: #fcf4f2; +} +.messages--error p.error { + color: #a51b00; } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php index 2262f26a7506..3f7c8bdb3df0 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php @@ -223,7 +223,7 @@ class Sql extends QueryPluginBase { '#description' => t('Disabling SQL rewriting will disable node_access checks as well as other modules that implement hook_query_alter().'), '#type' => 'checkbox', '#default_value' => !empty($this->options['disable_sql_rewrite']), - '#suffix' => '
' . t('WARNING: Disabling SQL rewriting means that node access security is disabled. This may allow users to see data they should not be able to see if your view is misconfigured. Use this option only if you understand and accept this security risk.') . '
', + '#suffix' => '
' . t('WARNING: Disabling SQL rewriting means that node access security is disabled. This may allow users to see data they should not be able to see if your view is misconfigured. Use this option only if you understand and accept this security risk.') . '
', ); $form['distinct'] = array( '#type' => 'checkbox', diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php b/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php index 28327c1c9d06..fa868c7ca456 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/style/Table.php @@ -224,7 +224,7 @@ class Table extends StylePluginBase { $handlers = $this->displayHandler->getHandlers('field'); if (empty($handlers)) { $form['error_markup'] = array( - '#markup' => '
' . t('You need at least one field before you can configure your table settings') . '
', + '#markup' => '
' . t('You need at least one field before you can configure your table settings') . '
', ); return; } diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index ff34a3dd1996..9f3e0b631305 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -76,7 +76,7 @@ class ViewEditFormController extends ViewFormControllerBase { if ($view->isLocked()) { $form['locked'] = array( '#type' => 'container', - '#attributes' => array('class' => array('view-locked', 'messages', 'warning')), + '#attributes' => array('class' => array('view-locked', 'messages', 'messages--warning')), '#children' => t('This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to break this lock.', array('!user' => theme('username', array('account' => user_load($view->lock->owner))), '!age' => format_interval(REQUEST_TIME - $view->lock->updated), '!break' => url('admin/structure/views/view/' . $view->id() . '/break-lock'))), '#weight' => -10, ); @@ -84,7 +84,7 @@ class ViewEditFormController extends ViewFormControllerBase { else { $form['changed'] = array( '#type' => 'container', - '#attributes' => array('class' => array('view-changed', 'messages', 'warning')), + '#attributes' => array('class' => array('view-changed', 'messages', 'messages--warning')), '#children' => t('You have unsaved changes.'), '#weight' => -10, ); diff --git a/core/update.php b/core/update.php index 3176ab1de19d..cee23c409261 100644 --- a/core/update.php +++ b/core/update.php @@ -82,7 +82,7 @@ function update_script_selection_form($form, &$form_state) { '#type' => 'item', '#title' => $module . ' module', '#markup' => $update['warning'], - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', ); $incompatible_updates_exist = TRUE;