Making WordPress.org

Ticket #2780: readme-validator-markup-2780.diff

File readme-validator-markup-2780.diff, 2.1 KB (added by tellyworth, 6 years ago)

First attempt at fixing the markup and css issues

  • wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-readme-validator.php

    diff --git wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-readme-validator.php wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-readme-validator.php
    index aae0417cb..c9e78d8c0 100644
    class Readme_Validator { 
    1111        public static function display() {
    1212                ?>
    1313                <div class="wrap">
    14                         <h2><?php _e( 'WordPress Plugin readme.txt Validator', 'wporg-plugins' ); ?></h2>
    15 
    1614                        <?php
    1715                        if ( $_POST ) {
    1816                                self::validate_readme();
    class Readme_Validator { 
    7674                );
    7775                foreach ( $error_types as $field => $warning_label ) {
    7876                        if ( ! empty( $errors[ $field ] ) ) {
    79                                 $output .= "{$warning_label}\n<ul class='{$field} error'>\n";
     77                                if ( 'errors' === $field ) {
     78                                        $class = 'error';
     79                                } elseif ( 'warnings' === $field ) {
     80                                        $class = 'warning';
     81                                } else {
     82                                        $class = 'info';
     83                                }
     84
     85                                $output .= "<h3>{$warning_label}</h3>\n";
     86                                $output .= "<div class='notice notice-{$class} notice-alt'>\n";
     87                                $output .= "<ul class='{$field}'>\n";
    8088                                foreach ( $errors[ $field ] as $notice ) {
    8189                                        $output .= "<li>{$notice}</li>\n";
    8290                                }
    8391                                $output .= "</ul>\n";
     92                                $output .= "</div>\n";
    8493                        }
    8594                }
    8695
  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/styles/objects/_notices.scss

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/styles/objects/_notices.scss wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/styles/objects/_notices.scss
    index d7b40f316..28291c832 100644
     
    1111                padding: 2px;
    1212        }
    1313
     14        ul {
     15                list-style: none;
     16                margin: 0.5em;
     17        }
     18
    1419        &.notice-alt {
    1520                box-shadow: none;
    1621        }
     
    5055        &.notice-info.notice-alt {
    5156                background-color: #e5f5fa;
    5257        }
    53 }
    54  No newline at end of file
     58}