Make WordPress Core

Ticket #32152: 32152.3.diff

File 32152.3.diff, 8.8 KB (added by afercia, 11 years ago)
  • src/wp-admin/css/list-tables.css

     
    1 /* List table styles */
    2 .post-com-count-wrapper {
    3         min-width: 22px;
    4 }
    5 
    61.post-com-count {
    7         background: none;
    8         height: 1.3em;
    9         line-height: 1.1em;
    102        display: block;
    11         text-decoration: none;
    12         padding: 0 0 6px;
    13         cursor: pointer;
    14         background-position: center -80px;
    15         background-repeat: no-repeat;
    16         color: #fff;
    173}
    184
    19 .post-com-count:after {         /* draw bubble connector using CSS! */
    20         content: "";
    21         display: block;
    22         width: 0;
    23         height: 0;
    24         margin-left: 8px;
    25         border-top: 5px solid #b4b9be;
    26         border-right: 5px solid transparent;
     5.fixed .column-comments {
     6        width: 14em;
    277}
    288
    29 .post-com-count span {
    30         font-size: 11px;
    31         font-weight: 600;
    32         height: 1.4em;
    33         line-height: 1.4em;
    34         min-width: 0.7em;
    35         padding: 0 6px;
     9.comments-view-item-link {
    3610        display: inline-block;
    37         -webkit-border-radius: 5px;
    38         border-radius: 5px;
    39         background-color: #b4b9be;
    40         color: #fff;
     11        clear: both;
    4112}
    4213
    43 .post-com-count:hover {
    44         background-position: center -3px;
     14.ie8 .post-com-count .screen-reader-text {
     15        position: static;
     16        width: auto;
     17        height: auto;
     18        margin: 0;
    4519}
    4620
    47 .post-com-count:hover span {
    48         background-color: #00a0d2;
     21.ie8 .post-com-count [aria-hidden="true"] {
     22        display: none;
    4923}
    5024
    51 .post-com-count:hover:after {
    52         border-top: 5px solid #00a0d2;
     25.ie8 .post-com-count-wrapper strong {
     26        font-weight: 400;
    5327}
    5428
    55 strong .post-com-count {
    56         background-position: center -55px;
     29.ie8 .post-com-count.post-com-count-pending {
     30        color: #bf461d;
    5731}
    5832
    59 strong .post-com-count span {
    60         background-color: #0073aa;
    61 }
     33@media screen and ( min-width: 1121px ) {
     34        .post-com-count .screen-reader-text {
     35                position: static;
     36                width: auto;
     37                height: auto;
     38                margin: 0;
     39        }
    6240
    63 strong .post-com-count:after {
    64         border-top: 5px solid #0073aa;
    65 }
     41        .post-com-count [aria-hidden="true"] {
     42                display: none;
     43        }
    6644
    67 .column-response .post-com-count {
    68         float: left;
    69         margin-right: 5px;
    70         text-align: center;
     45        .post-com-count-wrapper strong {
     46                font-weight: 400;
     47        }
     48
     49        .post-com-count.post-com-count-pending {
     50                color: #bf461d;
     51        }
    7152}
    7253
    73 .response-links {
    74         float: left;
     54@media screen and ( max-width: 1120px ) {
     55        .fixed .column-comments {
     56                width: 4em;
     57        }
     58
     59        /* List table styles */
     60        .post-com-count-wrapper,
     61        .post-com-count-wrapper .has-pending    {
     62                float: left;
     63        }
     64
     65        .post-com-count {
     66                float: right;
     67                background: none;
     68                text-decoration: none;
     69                color: #fff;
     70                margin-top: 5px;
     71        }
     72
     73        .post-com-count-no-comments:after,
     74        .post-com-count-approved:after {
     75                content: "";
     76                display: block;
     77                width: 0;
     78                height: 0;
     79                margin-left: 8px;
     80                border-top: 5px solid #72777c;
     81                border-right: 5px solid transparent;
     82        }
     83
     84        .comment-count-pending {
     85                display: none;
     86        }
     87
     88        .comment-count-no-comments,
     89        .comment-count-approved,
     90        .has-pending .comment-count-pending {
     91                display: block;
     92                font-weight: 400;
     93                vertical-align: top;
     94                overflow: hidden;
     95                -webkit-box-sizing: border-box;
     96                -moz-box-sizing: border-box;
     97                box-sizing: border-box;
     98        }
     99
     100        .comment-count-no-comments,
     101        .comment-count-approved {
     102                min-width: 24px;
     103                height: 2em;
     104                padding: 0 8px;
     105                line-height: 1.90909090; /*  1.92857142 */
     106                font-size: 11px;
     107                text-align: center;
     108                background-color: #72777c;
     109                color: #fff;
     110                -webkit-border-radius: 5px;
     111                border-radius: 5px;
     112        }
     113
     114        .has-pending .comment-count-pending {
     115                position: relative;
     116                top: -4px;
     117                left: -3px;
     118                min-width: 21px;
     119                height: 21px;
     120                border: 2px solid #fff;
     121                padding: 0 5px;
     122                line-height: 17px;
     123                font-size: 9px;
     124                font-weight: 400;
     125                text-align: center;
     126                background: #ca4a1f;
     127                color: #fff;
     128                -webkit-border-radius: 50%;
     129                border-radius: 50%;
     130                -webkit-box-shadow: 0 1px 2px 1px rgba(0,0,0,0.3);
     131                box-shadow: 0 1px 2px 1px rgba(0,0,0,0.3);
     132        }
     133
     134        .post-com-count-pending:focus {
     135                outline: none;
     136                -webkit-box-shadow: none;
     137                box-shadow: none;
     138        }
     139
     140        .post-com-count-approved:hover .comment-count-approved,
     141        .post-com-count-approved:focus .comment-count-approved {
     142                background: #0073aa;
     143        }
     144
     145        .post-com-count-approved:hover:after,
     146        .post-com-count-approved:focus:after {
     147                border-top-color: #0073aa;
     148        }
     149
     150        .post-com-count-pending:hover .comment-count-pending,
     151        .post-com-count-pending:focus .comment-count-pending {
     152                -webkit-box-shadow:
     153                        0 0 0 1px #5b9dd9,
     154                        0 1px 2px 1px rgba(30, 140, 190, .8);
     155                box-shadow:
     156                        0 0 0 1px #5b9dd9,
     157                        0 1px 2px 1px rgba(30, 140, 190, .8);
     158        }
    75159}
    76160
    77161/* comments */
     
    283367}
    284368
    285369.fixed .column-comments {
    286         width: 4em;
    287370        padding: 8px 0;
    288371        text-align: left;
    289372}
     
    292375        padding-left: 3px;
    293376}
    294377
    295 .fixed .column-comments a {
    296         float: left;
    297 }
    298 
    299378/* Media file column */
    300379table.media .column-title {
    301380        position: relative;
     
    17271806                display: none;
    17281807        }
    17291808
    1730         .comment-count {
     1809        .comment-count-no-comments,
     1810        .comment-count-approved {
     1811                min-width: 32px;
    17311812                font-size: 14px;
     1813                line-height: 1.92857142;
    17321814        }
    17331815
     1816        .has-pending .comment-count-pending {
     1817                min-width: 24px;
     1818                height: 24px;
     1819                font-size: 11px;
     1820                line-height: 20px;
     1821        }
     1822
    17341823        .wp-list-table th:not(.column-primary),
    17351824        .wp-list-table th:not(.column-primary),
    17361825        .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary):not(.check-column) {
  • src/wp-admin/includes/class-wp-comments-list-table.php

     
    689689                $this->comments_bubble( $post->ID, $pending_comments );
    690690                echo '</span> ';
    691691                $post_type_object = get_post_type_object( $post->post_type );
    692                 echo "<a href='" . get_permalink( $post->ID ) . "'>" . $post_type_object->labels->view_item . '</a>';
     692                echo "<a href='" . get_permalink( $post->ID ) . "' class='comments-view-item-link'>" . $post_type_object->labels->view_item . '</a>';
    693693                echo '</div>';
    694694                if ( 'attachment' == $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) )
    695695                        echo $thumb;
  • src/wp-admin/includes/class-wp-list-table.php

     
    614614         * @param int $pending_comments Number of pending comments.
    615615         */
    616616        protected function comments_bubble( $post_id, $pending_comments ) {
    617                 $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) );
     617                $approved_comments = get_comments_number();
     618                $approved_comments_number = number_format_i18n( $approved_comments );
     619                $pending_comments_number = number_format_i18n( $pending_comments );
     620                $approved_phrase = sprintf( _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
     621                $pending_phrase = sprintf( _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );
    618622
    619                 if ( $pending_comments )
    620                         echo '<strong>';
     623                if ( $pending_comments ) {
     624                        echo '<strong class="has-pending">';
     625                }
    621626
    622                 echo "<a href='" . esc_url( add_query_arg( 'p', $post_id, admin_url( 'edit-comments.php' ) ) ) . "' title='" . esc_attr( $pending_phrase ) . "' class='post-com-count'><span class='comment-count'>" . number_format_i18n( get_comments_number() ) . "</span></a>";
     627                $no_comments_output = sprintf( '<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
     628                        $approved_comments_number,
     629                        $pending_comments ? __( 'No approved comments' ) : __( 'No comments' )
     630                );
    623631
    624                 if ( $pending_comments )
     632                $approved_comments_output = sprintf( '<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
     633                        esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'approved' ), admin_url( 'edit-comments.php' ) ) ),
     634                        $approved_comments_number,
     635                        $approved_phrase
     636                );
     637
     638                $pending_comments_output = sprintf( '<a href="%s" class="post-com-count post-com-count-pending"><span class="comment-count-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
     639                        esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'moderated' ), admin_url( 'edit-comments.php' ) ) ),
     640                        $pending_comments_number,
     641                        $pending_phrase
     642                );
     643
     644                if ( $pending_comments_number ) {
     645                        echo $pending_comments_output;
     646                }
     647
     648                if ( $approved_comments_number ) {
     649                        echo $approved_comments_output;
     650                } else {
     651                        echo $no_comments_output;
     652                }
     653
     654                if ( $pending_comments ) {
    625655                        echo '</strong>';
     656                }
    626657        }
    627658
    628659        /**