Make WordPress Core

Changeset 31641


Ignore:
Timestamp:
03/06/2015 02:05:05 PM (10 years ago)
Author:
helen
Message:

Comments: Show more identifying information for moderation and editing.

Attempting to moderate comments without context about the post is more difficult than necessary. The comment moderation screen you are sent to via email link was also in need of some better visual treatment.

props thaicloud, seanchayes, adamsilverstein.
see #23988.

Location:
trunk/src/wp-admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/comment.php

    r31128 r31641  
    115115<div class="wrap">
    116116
    117 <div class="narrow">
    118 
    119117<h2><?php echo esc_html( $title ); ?></h2>
    120118
     
    123121    case 'spam' :
    124122        $caution_msg = __('You are about to mark the following comment as spam:');
    125         $button      = __('Spam Comment');
     123        $button      = __('Mark as Spam');
    126124        break;
    127125    case 'trash' :
    128126        $caution_msg = __('You are about to move the following comment to the Trash:');
    129         $button      = __('Trash Comment');
     127        $button      = __('Move to Trash');
    130128        break;
    131129    case 'delete' :
     
    159157
    160158<table class="form-table comment-ays">
    161 <tr class="alt">
     159<tr>
    162160<th scope="row"><?php _e('Author'); ?></th>
    163161<td><?php echo $comment->comment_author; ?></td>
     
    176174<?php } ?>
    177175<tr>
     176    <th scope="row"><?php _e( 'In Response To' ); ?></th>
     177    <td>
     178    <?php
     179        $post_id = $comment->comment_post_ID;
     180        if ( current_user_can( 'edit_post', $post_id ) ) {
     181            $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
     182            $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
     183        } else {
     184            $post_link = esc_html( get_the_title( $post_id ) );
     185        }
     186        echo $post_link;
     187
     188        if ( $comment->comment_parent ) {
     189            $comment_url = esc_url( get_comment_link( $comment->comment_ID ) );
     190            $parent      = get_comment( $comment->comment_parent );
     191            $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
     192            $name        = get_comment_author( $parent->comment_ID );
     193            printf( ' | ' . __( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
     194        }
     195    ?>
     196    </td>
     197</tr>
     198<tr>
     199    <th scope="row"><?php _e( 'Submitted on' ); ?></th>
     200    <td>
     201    <?php
     202        /* translators: 2: comment date, 3: comment time */
     203        printf( __( '<a href="%1$s">%2$s at %3$s</a>' ), $comment_url,
     204            /* translators: comment date format. See http://php.net/date */
     205            get_comment_date( __( 'Y/m/d' ) ),
     206            get_comment_date( get_option( 'time_format' ) )
     207        );
     208    ?>
     209    </td>
     210</tr>
     211<tr>
    178212<th scope="row"><?php /* translators: field name in comment form */ _ex('Comment', 'noun'); ?></th>
    179213<td><?php echo $comment->comment_content; ?></td>
     
    181215</table>
    182216
    183 <p><?php _e('Are you sure you want to do this?'); ?></p>
    184 
    185 <form action="comment.php" method="get">
    186 
    187 <table width="100%">
    188 <tr>
    189 <td><a class="button" href="<?php echo admin_url('edit-comments.php'); ?>"><?php esc_attr_e('No'); ?></a></td>
    190 <td class="textright"><?php submit_button( $button, 'button' ); ?></td>
    191 </tr>
    192 </table>
     217<form action="comment.php" method="get" class="comment-ays-submit">
     218
     219<p>
     220    <?php submit_button( $button, 'primary', 'submit', false ); ?>
     221    <a href="<?php echo admin_url('edit-comments.php'); ?>" class="button-cancel"><?php esc_attr_e( 'Cancel' ); ?></a></td>
     222</p>
    193223
    194224<?php wp_nonce_field( $nonce_action ); ?>
     
    198228</form>
    199229
    200 </div>
    201230</div>
    202231<?php
  • trunk/src/wp-admin/css/common.css

    r31603 r31641  
    178178.popular-tags,
    179179.feature-filter,
    180 .imgedit-group {
     180.imgedit-group,
     181.comment-ays {
    181182    border: 1px solid #e5e5e5;
    182183    -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
     
    191192.popular-tags,
    192193.feature-filter,
    193 .imgedit-group {
     194.imgedit-group,
     195.comment-ays {
    194196    background: #fff;
    195197}
     
    16181620    -moz-box-sizing: border-box;
    16191621    box-sizing: border-box;
    1620 }
    1621 
    1622 .narrow {
    1623     width: 70%;
    1624     margin-bottom: 40px;
    1625 }
    1626 
    1627 .narrow p {
    1628     line-height: 150%;
    16291622}
    16301623
  • trunk/src/wp-admin/css/edit.css

    r31607 r31641  
    11461146}
    11471147
    1148 .comment-ays {
    1149     margin-bottom: 0;
    1150     border-bottom-style: solid;
    1151     border-bottom-width: 1px;
    1152 }
    1153 
    1154 .comment-ays .alt {
    1155     background-color: transparent;
     1148.comment-ays th,
     1149.comment-ays td {
     1150    padding: 10px 15px;
     1151}
     1152
     1153.comment-ays-submit .button-cancel {
     1154    margin-left: 1em;
    11561155}
    11571156
     
    15621561
    15631562    /* Moderate Comment */
    1564     .comment-ays {
    1565         border-bottom: none;
     1563    .comment-ays th,
     1564    .comment-ays td {
     1565        padding-bottom: 0;
     1566    }
     1567
     1568    .comment-ays td {
     1569        padding-top: 6px;
    15661570    }
    15671571
  • trunk/src/wp-admin/edit-form-comment.php

    r31053 r31641  
    109109<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0); ?></div>
    110110</div>
     111
     112<?php
     113$post_id = $comment->comment_post_ID;
     114if ( current_user_can( 'edit_post', $post_id ) ) {
     115    $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
     116    $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
     117} else {
     118    $post_link = esc_html( get_the_title( $post_id ) );
     119}
     120?>
     121
     122<div class="misc-pub-section misc-pub-response-to">
     123    <?php printf( __( 'In response to: <b>%s</b>' ), $post_link ); ?>
     124</div>
     125
     126<?php
     127if ( $comment->comment_parent ) :
     128    $parent      = get_comment( $comment->comment_parent );
     129    $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
     130    $name        = get_comment_author( $parent->comment_ID );
     131?>
     132<div class="misc-pub-section misc-pub-reply-to">
     133    <?php printf( __( 'In reply to: <b><a href="%1$s">%2$s</a></b>' ), $parent_link, $name ); ?>
     134</div>
     135<?php endif; ?>
     136
    111137</div> <!-- misc actions -->
    112138<div class="clear"></div>
Note: See TracChangeset for help on using the changeset viewer.