Commit 60c3a75e authored by Dries's avatar Dries

Issue #1986408 by LewisNyman, oresh: Message style update.

parent 6c1c3b9b
......@@ -30,7 +30,7 @@ function authorize_filetransfer_form($form, &$form_state) {
if (!Drupal::request()->isSecure()) {
$form['information']['https_warning'] = array(
'#prefix' => '<div class="messages error">',
'#prefix' => '<div class="messages messages--error">',
'#markup' => t('WARNING: You are not using an encrypted connection, so your password will be sent in plain text. <a href="@https-link">Learn more</a>.', array('@https-link' => 'http://drupal.org/https-information')),
'#suffix' => '</div>',
);
......
......@@ -1711,7 +1711,7 @@ function theme_status_messages($variables) {
'warning' => t('Warning message'),
);
foreach (drupal_get_messages($display) as $type => $messages) {
$output .= "<div class=\"messages $type\">\n";
$output .= "<div class=\"messages messages--$type\">\n";
if (!empty($status_heading[$type])) {
$output .= '<h2 class="element-invisible">' . $status_heading[$type] . "</h2>\n";
}
......
......@@ -98,7 +98,7 @@ $.extend(Drupal.ProgressBar.prototype, {
* Display errors on the page.
*/
displayError: function (string) {
var error = $('<div class="messages error"></div>').html(string);
var error = $('<div class="messages messages--error"></div>').html(string);
$(this.element).before(error).hide();
if (this.errorCallback) {
......
......@@ -1254,7 +1254,7 @@ $.extend(Drupal.theme, {
return '<div class="indentation">&nbsp;</div>';
},
tableDragChangedWarning: function () {
return '<div class="tabledrag-changed-warning messages warning" role="alert">' + Drupal.theme('tableDragChangedMarker') + ' ' + Drupal.t('You have unsaved changes.') + '</div>';
return '<div class="tabledrag-changed-warning messages messages--warning" role="alert">' + Drupal.theme('tableDragChangedMarker') + ' ' + Drupal.t('You have unsaved changes.') + '</div>';
}
});
......
......@@ -150,7 +150,7 @@ public function buildOptionsForm(&$form, &$form_state) {
if (!$this->usesExposed() && parent::usesExposed()) {
$form['exposed_form_options']['warning'] = array(
'#weight' => -10,
'#markup' => '<div class="messages warning">' . t('Exposed filters in block displays require "Use AJAX" to be set to work correctly.') . '</div>',
'#markup' => '<div class="messages messages--warning">' . t('Exposed filters in block displays require "Use AJAX" to be set to work correctly.') . '</div>',
);
}
}
......
......@@ -52,7 +52,7 @@ public function buildForm(array $form, array &$form_state, FieldInstance $field_
// If so, prevent changes to the field settings.
$has_data = field_has_data($field);
if ($has_data) {
$form['field']['#prefix'] = '<div class="messages error">' . t('There is data for this field in the database. The field settings can no longer be changed.') . '</div>' . $form['field']['#prefix'];
$form['field']['#prefix'] = '<div class="messages messages--error">' . t('There is data for this field in the database. The field settings can no longer be changed.') . '</div>' . $form['field']['#prefix'];
}
// Build the configurable field values.
......
......@@ -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('<div class="messages error file-upload-js-error" aria-live="polite">' + error + '</div>');
$(this).closest('div.form-managed-file').prepend('<div class="messages messages--error file-upload-js-error" aria-live="polite">' + error + '</div>');
this.value = '';
}
}
......
......@@ -95,11 +95,21 @@ ul.menu {
/**
* RTL Styles for system messages.
*/
div.messages {
background-position: 99% 8px;
padding: 10px 50px 10px 10px;
.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;
}
div.messages ul {
margin: 0 1em 0 0;
.messages--warning {
border-color: #f4daa6 #e09600 #f4daa6 #f4daa6;
}
.messages--error {
border-color: #f9c9bf #e62600 #f9c9bf #f9c9bf;
}
......@@ -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 + .messages {
margin-top: 1.538em;
}
.messages ul {
list-style: none;
padding: 0;
margin: 0;
}
.messages li + li {
margin-top: .769em;
}
.messages.status {
background-image: url(../../misc/message-24-ok.png);
border-color: #be7;
/* @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,
.messages--status,
.ok {
color: #234600;
color: #325e1c;
}
.messages.status,
.messages--status,
table tr.ok {
background-color: #f8fff0;
background-color: #f3faef;
}
.messages.warning {
background-image: url(../../misc/message-24-warning.png);
border-color: #ed5;
.messages--warning {
background-image: url(../../misc/message-16-warning.png);
border-color: #f4daa6 #f4daa6 #f4daa6 #e09600; /* LTR */
}
.messages.warning,
.messages--warning,
.warning {
color: #840;
color: #734c00;
}
.messages.warning,
.messages--warning,
table tr.warning {
background-color: #fffce5;
background-color: #fdf8ed;
}
.messages.error {
background-image: url(../../misc/message-24-error.png);
border-color: #ed541d;
.messages--error {
background-image: url(../../misc/message-16-error.png);
border-color: #f9c9bf #f9c9bf #f9c9bf #e62600; /* LTR */
}
.messages.error,
.messages--error,
.error {
color: #8c2e0b;
color: #a51b00;
}
.messages.error,
.messages--error,
table tr.error {
background-color: #fef5f1;
}
.messages.error p.error {
color: #333;
}
div.messages ul {
margin: 0 0 0 1em; /* LTR */
padding: 0;
background-color: #fcf4f2;
}
div.messages ul li {
list-style-image: none;
.messages--error p.error {
color: #a51b00;
}
......@@ -223,7 +223,7 @@ public function buildOptionsForm(&$form, &$form_state) {
'#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' => '<div class="messages warning sql-rewrite-warning js-hide">' . 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.') . '</div>',
'#suffix' => '<div class="messages messages--warning sql-rewrite-warning js-hide">' . 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.') . '</div>',
);
$form['distinct'] = array(
'#type' => 'checkbox',
......
......@@ -224,7 +224,7 @@ public function buildOptionsForm(&$form, &$form_state) {
$handlers = $this->displayHandler->getHandlers('field');
if (empty($handlers)) {
$form['error_markup'] = array(
'#markup' => '<div class="error messages">' . t('You need at least one field before you can configure your table settings') . '</div>',
'#markup' => '<div class="messages messages--error">' . t('You need at least one field before you can configure your table settings') . '</div>',
);
return;
}
......
......@@ -76,7 +76,7 @@ public function form(array $form, array &$form_state) {
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 <a href="!break">break this lock</a>.', 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 @@ public function form(array $form, array &$form_state) {
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,
);
......
......@@ -82,7 +82,7 @@ function update_script_selection_form($form, &$form_state) {
'#type' => 'item',
'#title' => $module . ' module',
'#markup' => $update['warning'],
'#prefix' => '<div class="messages warning">',
'#prefix' => '<div class="messages messages--warning">',
'#suffix' => '</div>',
);
$incompatible_updates_exist = TRUE;
......
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