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.

Built from https://develop.svn.wordpress.org/trunk@31641


git-svn-id: http://core.svn.wordpress.org/trunk@31622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2015-03-06 14:06:24 +00:00
parent 305cf8b95e
commit 7ce4256d4d
9 changed files with 107 additions and 58 deletions

View File

@ -114,19 +114,17 @@ case 'spam' :
?> ?>
<div class="wrap"> <div class="wrap">
<div class="narrow">
<h2><?php echo esc_html( $title ); ?></h2> <h2><?php echo esc_html( $title ); ?></h2>
<?php <?php
switch ( $action ) { switch ( $action ) {
case 'spam' : case 'spam' :
$caution_msg = __('You are about to mark the following comment as spam:'); $caution_msg = __('You are about to mark the following comment as spam:');
$button = __('Spam Comment'); $button = __('Mark as Spam');
break; break;
case 'trash' : case 'trash' :
$caution_msg = __('You are about to move the following comment to the Trash:'); $caution_msg = __('You are about to move the following comment to the Trash:');
$button = __('Trash Comment'); $button = __('Move to Trash');
break; break;
case 'delete' : case 'delete' :
$caution_msg = __('You are about to delete the following comment:'); $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> <p><strong><?php _e('Caution:'); ?></strong> <?php echo $caution_msg; ?></p>
<table class="form-table comment-ays"> <table class="form-table comment-ays">
<tr class="alt"> <tr>
<th scope="row"><?php _e('Author'); ?></th> <th scope="row"><?php _e('Author'); ?></th>
<td><?php echo $comment->comment_author; ?></td> <td><?php echo $comment->comment_author; ?></td>
</tr> </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> <td><a href="<?php echo $comment->comment_author_url; ?>"><?php echo $comment->comment_author_url; ?></a></td>
</tr> </tr>
<?php } ?> <?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> <tr>
<th scope="row"><?php /* translators: field name in comment form */ _ex('Comment', 'noun'); ?></th> <th scope="row"><?php /* translators: field name in comment form */ _ex('Comment', 'noun'); ?></th>
<td><?php echo $comment->comment_content; ?></td> <td><?php echo $comment->comment_content; ?></td>
</tr> </tr>
</table> </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"> <p>
<?php submit_button( $button, 'primary', 'submit', false ); ?>
<table width="100%"> <a href="<?php echo admin_url('edit-comments.php'); ?>" class="button-cancel"><?php esc_attr_e( 'Cancel' ); ?></a></td>
<tr> </p>
<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>
<?php wp_nonce_field( $nonce_action ); ?> <?php wp_nonce_field( $nonce_action ); ?>
<input type="hidden" name="action" value="<?php echo esc_attr($formaction); ?>" /> <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" /> <input type="hidden" name="noredir" value="1" />
</form> </form>
</div>
</div> </div>
<?php <?php
break; break;

View File

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

View File

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

View File

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

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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> <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 id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0); ?></div>
</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> <!-- misc actions -->
<div class="clear"></div> <div class="clear"></div>
</div> </div>

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.2-alpha-31640'; $wp_version = '4.2-alpha-31641';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.