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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31641 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2015-03-06 14:05:05 +00:00
parent b9e222fd6a
commit c9913583e3
4 changed files with 86 additions and 34 deletions

View File

@ -114,19 +114,17 @@ case 'spam' :
?>
<div class="wrap">
<div class="narrow">
<h2><?php echo esc_html( $title ); ?></h2>
<?php
switch ( $action ) {
case 'spam' :
$caution_msg = __('You are about to mark the following comment as spam:');
$button = __('Spam Comment');
$button = __('Mark as Spam');
break;
case 'trash' :
$caution_msg = __('You are about to move the following comment to the Trash:');
$button = __('Trash Comment');
$button = __('Move to Trash');
break;
case 'delete' :
$caution_msg = __('You are about to delete the following comment:');
@ -158,7 +156,7 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
<p><strong><?php _e('Caution:'); ?></strong> <?php echo $caution_msg; ?></p>
<table class="form-table comment-ays">
<tr class="alt">
<tr>
<th scope="row"><?php _e('Author'); ?></th>
<td><?php echo $comment->comment_author; ?></td>
</tr>
@ -174,22 +172,54 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
<td><a href="<?php echo $comment->comment_author_url; ?>"><?php echo $comment->comment_author_url; ?></a></td>
</tr>
<?php } ?>
<tr>
<th scope="row"><?php _e( 'In Response To' ); ?></th>
<td>
<?php
$post_id = $comment->comment_post_ID;
if ( current_user_can( 'edit_post', $post_id ) ) {
$post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
$post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
} else {
$post_link = esc_html( get_the_title( $post_id ) );
}
echo $post_link;
if ( $comment->comment_parent ) {
$comment_url = esc_url( get_comment_link( $comment->comment_ID ) );
$parent = get_comment( $comment->comment_parent );
$parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
$name = get_comment_author( $parent->comment_ID );
printf( ' | ' . __( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
}
?>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Submitted on' ); ?></th>
<td>
<?php
/* translators: 2: comment date, 3: comment time */
printf( __( '<a href="%1$s">%2$s at %3$s</a>' ), $comment_url,
/* translators: comment date format. See http://php.net/date */
get_comment_date( __( 'Y/m/d' ) ),
get_comment_date( get_option( 'time_format' ) )
);
?>
</td>
</tr>
<tr>
<th scope="row"><?php /* translators: field name in comment form */ _ex('Comment', 'noun'); ?></th>
<td><?php echo $comment->comment_content; ?></td>
</tr>
</table>
<p><?php _e('Are you sure you want to do this?'); ?></p>
<form action="comment.php" method="get" class="comment-ays-submit">
<form action="comment.php" method="get">
<table width="100%">
<tr>
<td><a class="button" href="<?php echo admin_url('edit-comments.php'); ?>"><?php esc_attr_e('No'); ?></a></td>
<td class="textright"><?php submit_button( $button, 'button' ); ?></td>
</tr>
</table>
<p>
<?php submit_button( $button, 'primary', 'submit', false ); ?>
<a href="<?php echo admin_url('edit-comments.php'); ?>" class="button-cancel"><?php esc_attr_e( 'Cancel' ); ?></a></td>
</p>
<?php wp_nonce_field( $nonce_action ); ?>
<input type="hidden" name="action" value="<?php echo esc_attr($formaction); ?>" />
@ -197,7 +227,6 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
<input type="hidden" name="noredir" value="1" />
</form>
</div>
</div>
<?php
break;

View File

@ -177,7 +177,8 @@ p.popular-tags,
.wp-editor-container,
.popular-tags,
.feature-filter,
.imgedit-group {
.imgedit-group,
.comment-ays {
border: 1px solid #e5e5e5;
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04);
box-shadow: 0 1px 1px rgba(0,0,0,0.04);
@ -190,7 +191,8 @@ p.popular-tags,
.widgets-holder-wrap,
.popular-tags,
.feature-filter,
.imgedit-group {
.imgedit-group,
.comment-ays {
background: #fff;
}
@ -1619,15 +1621,6 @@ html.wp-toolbar {
box-sizing: border-box;
}
.narrow {
width: 70%;
margin-bottom: 40px;
}
.narrow p {
line-height: 150%;
}
.widefat th,
.widefat td {
color: #555;

View File

@ -1145,14 +1145,13 @@ p.popular-tags a {
height: 200px;
}
.comment-ays {
margin-bottom: 0;
border-bottom-style: solid;
border-bottom-width: 1px;
.comment-ays th,
.comment-ays td {
padding: 10px 15px;
}
.comment-ays .alt {
background-color: transparent;
.comment-ays-submit .button-cancel {
margin-left: 1em;
}
.trash-undo-inside,
@ -1561,8 +1560,13 @@ table.links-table {
}
/* Moderate Comment */
.comment-ays {
border-bottom: none;
.comment-ays th,
.comment-ays td {
padding-bottom: 0;
}
.comment-ays td {
padding-top: 6px;
}
/* Links */

View File

@ -108,6 +108,32 @@ $date = date_i18n( $datef, strtotime( $comment->comment_date ) );
<span id="timestamp"><?php printf($stamp, $date); ?></span>&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a>
<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0); ?></div>
</div>
<?php
$post_id = $comment->comment_post_ID;
if ( current_user_can( 'edit_post', $post_id ) ) {
$post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
$post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
} else {
$post_link = esc_html( get_the_title( $post_id ) );
}
?>
<div class="misc-pub-section misc-pub-response-to">
<?php printf( __( 'In response to: <b>%s</b>' ), $post_link ); ?>
</div>
<?php
if ( $comment->comment_parent ) :
$parent = get_comment( $comment->comment_parent );
$parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
$name = get_comment_author( $parent->comment_ID );
?>
<div class="misc-pub-section misc-pub-reply-to">
<?php printf( __( 'In reply to: <b><a href="%1$s">%2$s</a></b>' ), $parent_link, $name ); ?>
</div>
<?php endif; ?>
</div> <!-- misc actions -->
<div class="clear"></div>
</div>