From de7962c9470f34e87d9fb278f1984eafb10c53a9 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Sat, 2 Aug 2014 14:13:06 +0000 Subject: [PATCH] Media Upload: Improve styling of error messages. props afercia, michalzuber. fixes #29047. git-svn-id: https://develop.svn.wordpress.org/trunk@29355 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/async-upload.php | 2 +- src/wp-admin/css/media.css | 48 ++++++++++++++++++++------------- src/wp-admin/includes/media.php | 2 +- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/wp-admin/async-upload.php b/src/wp-admin/async-upload.php index 90b6ced035..add6164954 100644 --- a/src/wp-admin/async-upload.php +++ b/src/wp-admin/async-upload.php @@ -86,7 +86,7 @@ if ( isset( $_REQUEST['post_id'] ) ) { $id = media_handle_upload( 'async-upload', $post_id ); if ( is_wp_error($id) ) { - echo '
+ echo '
' . __('Dismiss') . ' ' . sprintf(__('“%s” has failed to upload due to an error'), esc_html($_FILES['async-upload']['name']) ) . '
' . esc_html($id->get_error_message()) . '
'; diff --git a/src/wp-admin/css/media.css b/src/wp-admin/css/media.css index 93b4bbbcf2..372a72cea3 100644 --- a/src/wp-admin/css/media.css +++ b/src/wp-admin/css/media.css @@ -102,7 +102,7 @@ display: block; line-height: 36px; float: right; - margin-right: 6px; + margin-right: 10px; } .media-item .describe-toggle-off, @@ -114,16 +114,18 @@ display: block; } -#media-items .media-item { - border-bottom: 1px solid #dfdfdf; +.media-upload-form .media-item { min-height: 36px; + margin-bottom: 1px; position: relative; width: 100%; background: #fff; } -.media-new-php #media-items { - margin: 1em 0; +.media-upload-form .media-item, +.media-upload-form .media-item .error { + -webkit-box-shadow: 0 1px 0 #dfdfdf; + box-shadow: 0 1px 0 #dfdfdf; } #media-items:empty { @@ -136,10 +138,6 @@ margin-left: 6px; } -.media-item .error-div { - padding-left: 10px; -} - .media-item .pinkynail { float: left; margin: 2px 10px 0 3px; @@ -208,22 +206,20 @@ display: block; } -.media-upload-form .media-item.error { - margin: 0; - padding: 0; +.media-upload-form .media-item.error, +.media-upload-form .media-item .error { + width: auto; + margin: 0 0 1px 0; } -.media-upload-form .media-item.error p, -.media-item .error-div { - line-height: 16px; - margin: 5px 10px; - padding: 0; +.media-upload-form .media-item .error { + padding: 10px 0 10px 14px; } .media-item .error-div a.dismiss { display: block; float: right; - margin: 5px 4px 0 15px; + margin: 0 10px 0 15px; } /*------------------------------------------------------------------------------ @@ -510,7 +506,7 @@ border color while dragging a file over the uploader drop area */ } .media-disabled, -.imgedit-settings .disabled { +.imgedit-settings .disabled { color: grey; } @@ -725,4 +721,18 @@ audio, video { font-size: 14px; line-height: 1.5em; } + + .media-upload-form .media-item.error, + .media-upload-form .media-item .error { + font-size: 13px; + line-height: 1.5; + } + + .media-upload-form .media-item.error { + padding: 1px 10px; + } + + .media-upload-form .media-item .error { + padding: 10px 0 10px 12px; + } } diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php index 440a787307..3c30cd686e 100644 --- a/src/wp-admin/includes/media.php +++ b/src/wp-admin/includes/media.php @@ -1856,7 +1856,7 @@ do_action( 'post-html-upload-ui' ); ?>
- +