diff --git a/assets/css/src/amp-validation-error-taxonomy.css b/assets/css/src/amp-validation-error-taxonomy.css index 3fbd639e887..3ff23a90a60 100644 --- a/assets/css/src/amp-validation-error-taxonomy.css +++ b/assets/css/src/amp-validation-error-taxonomy.css @@ -23,7 +23,7 @@ th.column-error_type { width: 15%; } -td.column-error .error-code { +td.column-error_code .error-code { font-family: Consolas, Monaco, monospace; } @@ -31,10 +31,6 @@ th.column-status { width: 15%; } -.fixed th.column-posts { - width: 10%; -} - /* Details column */ .column-details .details-attributes__summary { display: flex; @@ -47,6 +43,14 @@ details[open] .details-attributes__summary { margin-bottom: 15px; } +.details-attributes__summary { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; +} + .column-details .details-attributes__summary::-webkit-details-marker, .column-details .notice details > summary::-webkit-details-marker { display: none; @@ -64,7 +68,8 @@ details[open] .details-attributes__summary { } tr.expanded .details-attributes__summary::after, -details.single-error-detail[open] .single-error-detail-summary::after { +details[open] > .details-attributes__summary::after, +details[open] > .single-error-detail-summary::after { transform: rotate(180deg); } @@ -112,7 +117,15 @@ dl.detailed { padding-bottom: 16px; } -.details-attributes__title code, +dl.detailed details > summary { + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.details-attributes__title, .notice .detailed summary code { display: inline-block; min-width: 240px; @@ -120,8 +133,9 @@ dl.detailed { font-weight: 600; } -.details-attributes__title code { +.details-attributes__title { margin-left: 0; + font-weight: bold; } .details-attributes__list { @@ -158,26 +172,27 @@ dl.detailed { flex-direction: column; height: 14px; padding: 0; - margin-top: 4px; + margin: 0; background: none; border: none; cursor: pointer; } -.error-details-toggle.is-open { - transform: rotate(180deg); -} - .column-details .error-details-toggle::before, .column-details .error-details-toggle::after { width: 12px; - height: 12px; + height: 10px; background-image: url("../images/down-triangle.svg"); background-size: cover; background-position: center; content: ""; } +.error-details-toggle.is-open::before, +.error-details-toggle.is-open::after { + transform: rotate(180deg); +} + /* Status text icons */ .status-text { display: flex; @@ -245,58 +260,48 @@ dl.detailed { margin-left: 10px; } -body.taxonomy-amp_validation_error .wp-list-table .new th, -body.taxonomy-amp_validation_error .wp-list-table .new td, tr.expanded.new + tr > td:first-of-type, -body.post-type-amp_validated_url .wp-list-table .new th, -body.post-type-amp_validated_url .wp-list-table .new td { +.wp-list-table > tbody > .new > td, +.wp-list-table > tbody > .new > th { background-color: #fef7f1; } -body.taxonomy-amp_validation_error .wp-list-table .new.odd th, -body.taxonomy-amp_validation_error .wp-list-table .new.odd td, -tr.expanded.new.odd + tr > td:first-of-type, -body.post-type-amp_validated_url .wp-list-table .new.odd th, -body.post-type-amp_validated_url .wp-list-table .new.odd td { - background-color: #f9eee5; +tr.expanded + tr > td:first-of-type { + border-left: solid 4px transparent; } -body.taxonomy-amp_validation_error .wp-list-table .new th.check-column, tr.expanded.new + tr > td:first-of-type, -body.post-type-amp_validated_url .wp-list-table .new th.check-column { +.wp-list-table .new th.check-column { border-left: 4px solid #d54e21; } -body.taxonomy-amp_validation_error .wp-list-table .new th.check-column input { - margin-left: 4px; +.wp-list-table > tbody > tr > th, +.wp-list-table > tbody > tr > td { + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1); } -.row-actions .amp_validation_error_accept > a { - color: #006505; +.wp-list-table > tbody > tr:last-child > th, +.wp-list-table > tbody > tr.expanded > th, +.wp-list-table > tbody > tr:last-child > td, +.wp-list-table > tbody > tr.expanded > td { + box-shadow: none; } -.row-actions .amp_validation_error_reject > a { - color: #a00; +.wp-list-table > tbody > tr.unapproved + tr.approved th, +.wp-list-table > tbody > tr.unapproved + tr.approved td { + border-top: 1px solid rgba(0, 0, 0, 0.03); } -.notice.accept-reject-error { - display: flex; - margin-bottom: 0; +body.taxonomy-amp_validation_error .wp-list-table .new th.check-column input { + margin-left: 4px; } -.notice.accept-reject-error > p { - display: inline-block; - font-size: 14px; - flex-grow: 10; - margin-right: 20px; +.row-actions .amp_validation_error_accept > a { + color: #006505; } -.notice.accept-reject-error > .button { - display: inline-block; - margin: 5px 5px 0 5px; - padding: 0 26px 2px; - flex-grow: 1; - text-align: center; +.row-actions .amp_validation_error_reject > a { + color: #a00; } .notice.accept-reject-error > .button.accept { @@ -324,35 +329,32 @@ body.taxonomy-amp_validation_error .wp-list-table .new th.check-column input { font-size: 1rem; } -/** Details post action. */ -.details button { - display: inline-block; - background: none; - border: none; - padding: 0; - text-align: left; - color: #0073aa; - cursor: pointer; - text-decoration: underline; +.validation-error-sources { + border-collapse: collapse; } -.validation-error-sources th { - font-weight: bold; - text-align: right; +.validation-error-sources tbody:not(:first-child) { + border-top: solid 1px #ddd; + margin: 0; } .validation-error-sources td, .validation-error-sources th { vertical-align: top; - padding: 0 4px; + padding: 2px 4px; } -.validation-error-sources > li { - border-top: solid 1px #ddd; - margin: 0; - padding: 6px 0; +.validation-error-sources tbody > tr:first-child > th, +.validation-error-sources tbody > tr:first-child > td { + padding-top: 0.75em; +} + +.validation-error-sources tbody > tr:last-child > th, +.validation-error-sources tbody > tr:last-child > td { + padding-bottom: 0.75em; } -.validation-error-sources > li:first-child { - border-top: 0; +.validation-error-sources th { + font-weight: bold; + text-align: right; } diff --git a/assets/css/src/amp-validation-single-error-url.css b/assets/css/src/amp-validation-single-error-url.css index f97f4472b41..527f3270c29 100644 --- a/assets/css/src/amp-validation-single-error-url.css +++ b/assets/css/src/amp-validation-single-error-url.css @@ -1,5 +1,5 @@ /** Arrow icon on title in error column. */ -.column-error > .single-url-detail-toggle { +.column-error_code > .single-url-detail-toggle { position: relative; width: 100%; padding: 5px 36px 5px 0; @@ -11,7 +11,7 @@ cursor: pointer; } -.column-error > .single-url-detail-toggle::after { +.column-error_code > .single-url-detail-toggle::after { position: absolute; top: 0; right: 0; @@ -46,18 +46,6 @@ table.striped > tbody > tr.even { display: none; } -/** Details post action. */ -.details button { - display: inline-block; - background: none; - border: none; - padding: 0; - text-align: left; - color: #0073aa; - cursor: pointer; - text-decoration: underline; -} - /** Details row styles. */ .details details.details-attributes:hover { cursor: pointer; @@ -87,7 +75,7 @@ table.striped > tbody > tr.even { #number-errors { text-align: center; background-color: #d3d3d3b8; - color: #1e8cbecc; + color: #000; } #url-post-filter { @@ -108,21 +96,25 @@ table.striped > tbody > tr.even { margin-top: 0.5rem; } -/* Give enough width to prevent the widest column status, 'New Accepted,' from forcing the
'; } @@ -1939,11 +1940,11 @@ public static function filter_manage_custom_columns( $content, $column_name, $te $attributes = []; $attributes_heading = ''; if ( ! empty( $validation_error['node_attributes'] ) ) { - $attributes_heading = sprintf( '%s
%s
-
+
%2$s | ', esc_attr( $attr_name_class ), esc_html( $attr_name ) );
echo '';
if ( ! empty( $attr_value ) ) {
- printf( '%s ', esc_html( $attr_value ) );
+ echo '';
+ $is_url = in_array( $attr_name, [ 'href', 'src' ], true );
+ if ( $is_url ) {
+ // @todo There should be a link to the file editor as well, if available.
+ printf( '', esc_url( $attr_value ) );
+ }
+ echo esc_html( $attr_value );
+ if ( $is_url ) {
+ echo '';
+ }
+ echo ' ';
}
+
echo ' | ';
?>
@@ -2395,8 +2407,8 @@ private static function render_sources( $sources ) {
sprintf(
/* translators: %s: number of sources. */
_n(
- '%s possible source',
- '%s possible sources',
+ 'Source stack (%s)',
+ 'Source stack (%s)',
$source_count,
'amp'
),
@@ -2405,178 +2417,184 @@ private static function render_sources( $sources ) {
);
?>
-
---|
+ | |||
---|---|---|---|
+ # + | + ++ + | ++ + + '; + esc_html_e( 'Theme', 'amp' ); break; - case 'function': - esc_html_e( 'Function', 'amp' ); + case 'plugin': + echo ' '; + esc_html_e( 'Plugin', 'amp' ); break; - case 'sources': - esc_html_e( 'Sources', 'amp' ); + case 'mu-plugin': + echo ' '; + esc_html_e( 'Must-Use Plugin', 'amp' ); break; - case 'hook': - if ( $is_filter ) { - esc_html_e( 'Filter', 'amp' ); - } else { - esc_html_e( 'Action', 'amp' ); - } + case 'core': + echo ' '; + esc_html_e( 'Core', 'amp' ); break; default: - echo esc_html( $key ); + echo esc_html( (string) $value ); } - echo ':'; ?> - - |
-
-
-
- ';
- esc_html_e( 'Theme', 'amp' );
- break;
- case 'plugin':
- echo ' ';
- esc_html_e( 'Plugin', 'amp' );
- break;
- case 'mu-plugin':
- echo ' ';
- esc_html_e( 'Must-Use Plugin', 'amp' );
- break;
- case 'core':
- echo ' ';
- esc_html_e( 'Core', 'amp' );
- break;
- default:
- echo esc_html( (string) $value );
- }
- ?>
-
-
-
-
-
-
-
-
-
-
- labels->singular_name ) ) {
- echo esc_html( $post_type->labels->singular_name );
- printf( ' (%s )', esc_html( $value ) );
- } else {
- printf( '%s ', esc_html( $value ) );
- }
- ?>
-
-
-
-
-
- |
-
- : - | -
+
+
+
+
+
+ ',
// Note that esc_attr() used instead of esc_url() to allow IDE protocols.
- esc_attr( $edit_url ),
+ esc_attr( $value['link_url'] ),
// Open link in new window unless the user has filtered the URL to open their system IDE.
- in_array( wp_parse_url( $edit_url, PHP_URL_SCHEME ), [ 'http', 'https' ], true ) ? 'target="_blank"' : ''
+ in_array( wp_parse_url( $value['link_url'], PHP_URL_SCHEME ), [ 'http', 'https' ], true ) ? 'target="_blank"' : ''
);
}
?>
-
-
+
+
- |
-
+
+
+
+ labels->singular_name ) ) {
+ echo esc_html( $post_type->labels->singular_name );
+ printf( ' (%s
)', esc_html( $value ) );
+ } else {
+ printf( '%s
', esc_html( $value ) );
+ }
+ ?>
+
+
+
+
+
+
+
+
+
-
+
+ An accepted validation error is one that will not block a URL from being served as AMP; the validation error will be sanitized, normally resulting in the offending markup being stripped from the response to ensure AMP validity.
An accepted validation error is one that will not block a URL from being served as AMP; the validation error will be sanitized, normally resulting in the offending markup being stripped from the response to ensure AMP validity.