From 52f321913a18f88ddac4ccba2d19c3cd8e7d725b Mon Sep 17 00:00:00 2001 From: azaozz Date: Fri, 9 Mar 2012 01:30:11 +0000 Subject: [PATCH] Add new comment from post edit screen, partial props: garyc40, see #15527 git-svn-id: http://svn.automattic.com/wordpress/trunk@20164 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/css/colors-classic.dev.css | 5 +- wp-admin/css/colors-fresh.dev.css | 16 ++--- wp-admin/css/wp-admin.dev.css | 62 ++++++++++--------- wp-admin/includes/meta-boxes.php | 33 +++++----- wp-admin/includes/template.php | 3 +- wp-admin/js/edit-comments.dev.js | 85 ++++++++++++++++---------- wp-admin/js/post.dev.js | 5 +- wp-includes/css/editor-buttons.dev.css | 2 +- 8 files changed, 120 insertions(+), 91 deletions(-) diff --git a/wp-admin/css/colors-classic.dev.css b/wp-admin/css/colors-classic.dev.css index 3a0b7fb74b..b7d3c2da5e 100644 --- a/wp-admin/css/colors-classic.dev.css +++ b/wp-admin/css/colors-classic.dev.css @@ -287,8 +287,9 @@ div.error a { border-color: #c00 !important; } -.submit { - border-color: #DFDFDF; +.submit, +#commentsdiv #add-new-comment { + border-color: #dfdfdf; } .highlight { diff --git a/wp-admin/css/colors-fresh.dev.css b/wp-admin/css/colors-fresh.dev.css index 95e0b2b37f..2bbaa3da59 100644 --- a/wp-admin/css/colors-fresh.dev.css +++ b/wp-admin/css/colors-fresh.dev.css @@ -295,8 +295,9 @@ div.error a { border-color: #c00 !important; } -.submit { - border-color: #DFDFDF; +.submit, +#commentsdiv #add-new-comment { + border-color: #dfdfdf; } .highlight { @@ -1533,11 +1534,7 @@ body.press-this ul.category-tabs li.tabs a { } div.widgets-sortables, -#widgets-left .inactive { - background-color: #fcfcfc; - border-color: #dfdfdf; -} - +#widgets-left .inactive, #available-widgets .widget-holder { background-color: #fcfcfc; border-color: #dfdfdf; @@ -1664,10 +1661,7 @@ div.widgets-sortables, color: #fff; } -.list-container { - border-color: #DFDFDF; -} - +.list-container, .menu-item-handle { border-color: #dfdfdf; } diff --git a/wp-admin/css/wp-admin.dev.css b/wp-admin/css/wp-admin.dev.css index 94d22b7d6a..d7505cf5ae 100644 --- a/wp-admin/css/wp-admin.dev.css +++ b/wp-admin/css/wp-admin.dev.css @@ -2400,7 +2400,6 @@ table.fixed { width: 80px; } -#commentsdiv .fixed .column-author, #comments-form .fixed .column-author { width: 20%; } @@ -2410,28 +2409,49 @@ table.fixed { padding: 0; } -#commentsdiv.postbox .inside .row-actions { +#commentsdiv .inside .row-actions { line-height:18px; } -#commentsdiv.postbox .inside td { - padding:1em 10px; +#commentsdiv .inside .column-author { + width: 25%; } -#commentsdiv.postbox .inside .column-author { - width:33%; +#commentsdiv .column-comment p { + margin: 0.6em 0; + padding: 0; } -#commentsdiv.postbox .inside p { - margin:6px 10px 8px; +#commentsdiv #replyrow td { + padding: 0; } -#commentsdiv.postbox .column-comment p { - margin:0.6em 0; +#commentsdiv p { + padding: 8px 10px; + margin: 0; } -#commentsdiv.postbox #replyrow td { - padding:0; +#commentsdiv #add-new-comment { + border-width: 0 0 1px; + border-style: none none solid; +} + +#commentsdiv .comments-box { + border: 0 none; +} + +#commentsdiv .comments-box thead th { + background: transparent; + padding: 0 7px 4px; + font-style: italic; +} + +#commentsdiv .comments-box tr:last-child td { + border-bottom: 0 none; +} + +#commentsdiv img.waiting { + padding-left: 5px; } .sorting-indicator { @@ -3112,7 +3132,7 @@ div.tabs-panel-inactive { #normal-sortables .postbox #replyrow .submit { float: none; margin: 0; - padding: 3px 7px; + padding: 0 7px 5px; } #side-sortables .submitbox .submit input, @@ -3126,24 +3146,12 @@ div.tabs-panel-inactive { margin: 11px 0; } -#side-sortables .comments-box, -#normal-sortables .comments-box { - border: 0 none; -} - ul.category-tabs, ul.add-menu-item-tabs, ul.wp-tab-bar { margin-top: 12px; } -#side-sortables .comments-box thead th, -#normal-sortables .comments-box thead th { - background: transparent; - padding: 0 7px 4px; - font-style: italic; -} - ul.category-tabs li.tabs, ul.add-menu-item-tabs li.tabs, .wp-tab-active { @@ -3151,10 +3159,6 @@ ul.add-menu-item-tabs li.tabs, border-width: 1px 1px 0; } -#commentsdiv img.waiting { - padding-left: 5px; -} - #post-body .category-tabs li.tabs, #post-body .add-menu-item-tabs li.tabs { border-style: solid none solid solid; diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index 7074761fad..1fe3f05ca2 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -471,25 +471,30 @@ function post_comment_meta_box_thead($result) { function post_comment_meta_box($post) { global $wpdb, $post_ID; - $total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID)); - - if ( 1 > $total ) { - echo '

' . __('No comments yet.') . '

'; - return; - } - wp_nonce_field( 'get-comments', 'add_comment_nonce', false ); + ?> +

+ get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID)); $wp_list_table = _get_list_table('WP_Post_Comments_List_Table'); $wp_list_table->display( true ); -?> -

- - - $total ) { + echo '

' . __('No comments yet.') . '

'; + } else { + $hidden = get_hidden_meta_boxes('post'); + if ( ! in_array('commentsdiv', $hidden) ) { + ?> + + + +