Make WordPress Core

Changeset 9413


Ignore:
Timestamp:
10/30/2008 12:24:11 PM (17 years ago)
Author:
azaozz
Message:

Better comments listing, props Matt

Location:
trunk/wp-admin
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/colors-fresh.css

    r9411 r9413  
    3030}
    3131
    32 .widefat {
     32.widefat,
     33#replyrow {
    3334    border-color: #dfdfdf;
    3435}
  • trunk/wp-admin/edit-comments.php

    r9363 r9413  
    243243
    244244<?php if ( $comments ) { ?>
    245 <table class="widefat">
    246 <thead>
    247     <tr>
    248 <?php print_column_headers('comment'); ?>
    249     </tr>
    250 </thead>
    251 
    252 <tfoot>
    253     <tr>
    254 <?php print_column_headers('comment', false); ?>
    255     </tr>
    256 </tfoot>
    257 
    258 <tbody id="the-comment-list" class="list:comment">
     245
     246<ol id="the-comment-list" class="list:comment">
    259247<?php
    260248    foreach ($comments as $comment)
    261249        _wp_comment_row( $comment->comment_ID, $mode, $comment_status );
    262250?>
    263 </tbody>
    264 <tbody id="the-extra-comment-list" class="list:comment" style="display: none;">
     251</ol>
     252<ol id="the-extra-comment-list" class="list:comment" style="display: none;">
    265253<?php
    266254    foreach ($extra_comments as $comment)
    267255        _wp_comment_row( $comment->comment_ID, $mode, $comment_status );
    268256?>
    269 </tbody>
    270 </table>
     257</ol>
    271258
    272259<div class="tablenav">
     
    331318
    332319<?php
    333 wp_comment_reply('-1', true, 'detail');
     320wp_comment_reply('-1', true, 'detail', false);
    334321include('admin-footer.php'); ?>
  • trunk/wp-admin/edit-form-advanced.php

    r9409 r9413  
    369369?>
    370370
    371 <table class="widefat comments-box" style="display:none;">
    372 <thead>
    373     <tr>
    374         <th scope="col"><?php _e('Comments') ?></th>
    375         <th scope="col"><?php _e('Author') ?></th>
    376         <th scope="col"><?php _e('Submitted') ?></th>
    377     </tr>
    378 </thead>
    379 <tbody id="the-comment-list" class="list:comment">
    380 </tbody>
    381 </table>
     371<div class="comments-box" style="display:none;">
     372<ol id="the-comment-list" class="list:comment">
     373</ol>
     374</div>
    382375<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/loading.gif" alt="" /></p>
    383376<?php
  • trunk/wp-admin/edit-pages.php

    r9363 r9413  
    278278<br class="clear" />
    279279
    280 <table class="widefat" style="margin-top: .5em">
    281 <thead>
    282   <tr>
    283     <th scope="col"><?php _e('Comment') ?></th>
    284     <th scope="col"><?php _e('Date') ?></th>
    285     <th scope="col"><?php _e('Actions') ?></th>
    286   </tr>
    287 </thead>
    288 <tbody id="the-comment-list" class="list:comment">
     280<ol id="the-comment-list" class="list:comment">
    289281<?php
    290282    foreach ($comments as $comment)
    291283        _wp_comment_row( $comment->comment_ID, 'detail', false, false );
    292284?>
    293 </tbody>
    294 </table>
     285</ol>
    295286
    296287<?php
  • trunk/wp-admin/edit.php

    r9363 r9413  
    280280<br class="clear" />
    281281
    282 <table class="widefat" style="margin-top: .5em">
    283 <thead>
    284   <tr>
    285     <th scope="col"><?php _e('Comment') ?></th>
    286     <th scope="col"><?php _e('Author') ?></th>
    287     <th scope="col"><?php _e('Submitted') ?></th>
    288   </tr>
    289 </thead>
    290 
    291 <tfoot>
    292   <tr>
    293     <th scope="col"><?php _e('Comment') ?></th>
    294     <th scope="col"><?php _e('Author') ?></th>
    295     <th scope="col"><?php _e('Submitted') ?></th>
    296   </tr>
    297 </tfoot>
    298 
    299 <tbody id="the-comment-list" class="list:comment">
     282<ol id="the-comment-list" class="list:comment">
    300283<?php
    301284    foreach ($comments as $comment)
    302285        _wp_comment_row( $comment->comment_ID, 'single', false, false );
    303286?>
    304 </tbody>
    305 </table>
     287</ol>
    306288
    307289<?php
  • trunk/wp-admin/includes/template.php

    r9402 r9413  
    18591859    $unapprove_url = clean_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) );
    18601860    $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
    1861 
    1862     echo "<tr id='comment-$comment->comment_ID' class='$the_comment_status'>";
    1863     $columns = get_column_headers('comment');
    1864     $hidden = (array) get_user_option( 'manage-comment-columns-hidden' );
    1865     foreach ( $columns as $column_name => $column_display_name ) {
    1866         $class = "class=\"$column_name column-$column_name\"";
    1867 
    1868         $style = '';
    1869         if ( in_array($column_name, $hidden) )
    1870             $style = ' style="display:none;"';
    1871 
    1872         $attributes = "$class$style";
    1873 
    1874         switch ($column_name) {
    1875             case 'cb':
    1876                 if ( !$checkbox ) break;
    1877                 echo '<th scope="row" class="check-column">';
    1878                 if ( current_user_can('edit_post', $comment->comment_post_ID) ) echo "<input type='checkbox' name='delete_comments[]' value='$comment->comment_ID' />";
    1879                 echo '</th>';
    1880                 break;
    1881             case 'comment':
    1882                 echo "<td $attributes>";
    1883                 if ( 'detail' == $mode || 'single' == $mode ) comment_text(); ?>
    1884                 <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
    1885                 <textarea class="comment" rows="3" cols="10"><?php echo $comment->comment_content; ?></textarea>
    1886                 <div class="author-email"><?php echo attribute_escape( $comment->comment_author_email ); ?></div>
    1887                 <div class="author"><?php echo attribute_escape( $comment->comment_author ); ?></div>
    1888                 <div class="author-url"><?php echo attribute_escape( $comment->comment_author_url ); ?></div>
    1889                 <div class="comment_status"><?php echo $comment->comment_approved; ?></div>
    1890                 </div>
    1891                 <?php
    1892                 $actions = array();
    1893 
    1894                 if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    1895                     $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
    1896                     $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
    1897                     if ( $comment_status ) { // not looking at all comments
    1898                         if ( 'approved' == $the_comment_status ) {
    1899                             $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment vim-u vim-destructive' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
    1900                             unset($actions['approve']);
    1901                         } else {
    1902                             $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment vim-a vim-destructive' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
    1903                             unset($actions['unapprove']);
    1904                         }
    1905                     }
    1906                     if ( 'spam' != $the_comment_status )
    1907                         $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a>';
    1908                     $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
    1909                     $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
    1910                     $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick&nbsp;Edit') . '</a>';
    1911                     if ( 'spam' != $the_comment_status )
    1912                         $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
    1913 
    1914                     $actions = apply_filters( 'comment_row_actions', $actions, $comment );
    1915 
    1916                     $i = 0;
    1917                     foreach ( $actions as $action => $link ) {
    1918                         ++$i;
    1919                         ( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
    1920 
    1921                         // Reply and quickedit need a hide-if-no-js span
    1922                         if ( 'reply' == $action || 'quickedit' == $action )
    1923                             $action .= ' hide-if-no-js';
    1924 
    1925                         echo "<span class='$action'>$sep$link</span>";
    1926                     }
    1927                 }
    1928 
    1929                 echo '</td>';
    1930                 break;
    1931             case 'author':
    1932                 echo "<td $attributes><strong>"; comment_author(); echo '</strong><br />';
    1933                 if ( !empty($author_url) )
    1934                     echo "<a href='$author_url'>$author_url_display</a><br />";
    1935                 if ( current_user_can( 'edit_post', $post->ID ) ) {
    1936                     if ( !empty($comment->comment_author_email) ) {
    1937                         comment_author_email_link();
    1938                         echo '<br />';
    1939                     }
    1940                     echo '<a href="edit-comments.php?s=';
    1941                     comment_author_IP();
    1942                     echo '&amp;mode=detail">';
    1943                     comment_author_IP();
    1944                     echo '</a>';
    1945                 } //current_user_can
    1946                 echo '</td>';
    1947                 break;
    1948             case 'date':
    1949                 echo "<td $attributes>" . get_comment_date(__('Y/m/d \a\t g:ia')) . '</td>';
    1950                 break;
    1951             case 'response':
    1952                 if ( 'single' !== $mode ) {
    1953                     echo "<td $attributes>\n";
    1954                     echo "&quot;$post_link&quot; ";
    1955                     echo '<a href="edit-comments.php?p=' . $post->ID;
    1956                     if ( !empty($_GET['comment_type']) ) echo '&amp;comment_type=' . htmlspecialchars( $_GET['comment_type'] );
    1957                     echo '">' . sprintf ( __ngettext('(%s comment)', '(%s comments)', $post->comment_count), $post->comment_count ) . '</a><br />';
    1958                     echo get_the_time(__('Y/m/d \a\t g:ia'));
    1959                     echo '</td>';
    1960                 }
     1861?>
     1862<li id='comment-<?php echo $comment->comment_ID; ?>' class='<?php echo $the_comment_status; ?> comment-list-item'>
     1863<p class="comment-author"><strong><?php comment_author(); ?></strong>
     1864<?php if ( current_user_can( 'edit_post', $post->ID ) && !empty( $comment->comment_author_email ) ) { echo ' | '; comment_author_email_link(); } ?>
     1865<span class="sepa">|</span> <a href="edit-comments.php?s=<?php comment_author_IP(); ?>"><?php comment_author_IP(); ?></a> <span class="sepa">|</span> <a href="<?php echo get_permalink( $post->ID ) . '#comment-' . $comment->comment_ID; ?>" style="text-decoration: none;">#</a><br />
     1866<?php if ( !empty($author_url) ) echo "<a href='$author_url'>$author_url_display</a>"; ?>
     1867</p>
     1868
     1869<?php if ( 'detail' == $mode || 'single' == $mode ) comment_text(); ?>
     1870<div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
     1871<textarea class="comment" rows="3" cols="10"><?php echo $comment->comment_content; ?></textarea>
     1872<div class="author-email"><?php echo attribute_escape( $comment->comment_author_email ); ?></div>
     1873<div class="author"><?php echo attribute_escape( $comment->comment_author ); ?></div>
     1874<div class="author-url"><?php echo attribute_escape( $comment->comment_author_url ); ?></div>
     1875<div class="comment_status"><?php echo $comment->comment_approved; ?></div>
     1876</div>
     1877
     1878<?php
     1879// TODO: I don't think checkboxes really matter anymore
     1880// if ( $checkbox && current_user_can( 'edit_post', $comment->comment_post_ID ) )
     1881//  echo "<input type='checkbox' name='delete_comments[]' value='$comment->comment_ID' />";
     1882?>
     1883
     1884<?php
     1885$actions = array();
     1886
     1887if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
     1888    $actions['approve'] = "<span class='comment-action-link'><a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a></span>';
     1889    $actions['unapprove'] = "<span class='comment-action-link'><a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a></span>';
     1890    if ( $comment_status ) { // not looking at all comments
     1891        if ( 'approved' == $the_comment_status ) {
     1892            $actions['unapprove'] = "<span class='comment-action-link'><a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment vim-u vim-destructive' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a></span>';
     1893            unset($actions['approve']);
     1894        } else {
     1895            $actions['approve'] = "<span class='comment-action-link'><a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment vim-a vim-destructive' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a></span>';
     1896            unset($actions['unapprove']);
    19611897        }
    19621898    }
    1963     echo "</tr>\n";
     1899    if ( 'spam' != $the_comment_status )
     1900        $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a>';
     1901    $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
     1902    $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
     1903    $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
     1904    if ( 'spam' != $the_comment_status )
     1905        $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
     1906
     1907    $actions = apply_filters( 'comment_row_actions', $actions, $comment );
     1908
     1909    $i = 0;
     1910    foreach ( $actions as $action => $link ) {
     1911        ++$i;
     1912        ( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' <span class="sepa">|</span> ';
     1913
     1914        // Reply and quickedit need a hide-if-no-js span
     1915        if ( 'reply' == $action || 'quickedit' == $action )
     1916            $action .= ' hide-if-no-js';
     1917
     1918        echo "<span class='$action'>$sep$link</span>";
     1919    }
     1920}
     1921?>
     1922 &nbsp;<span class="sepa">&#8212;</span>&nbsp; <?php echo get_comment_date( __('Y/m/d \a\t g:ia') ); ?> <span class="sepa">|</span> <a href="<?php echo get_permalink( $post->ID ); ?>" style="text-decoration: none;">&para;</a> <?php echo $post_link; ?>
     1923</li>
     1924<?php
    19641925}
    19651926
     
    19731934 * @param unknown_type $mode
    19741935 */
    1975 function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', $table_row = true) {
     1936function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', $table_row = false) {
    19761937    global $current_user;
    19771938
     
    19881949<table style="display:none;"><tbody id="com-reply"><tr id="replyrow"><td colspan="6">
    19891950<?php else : ?>
    1990 <div id="com-reply" style="display:none;"><div id="replyrow">
     1951<ul id="com-reply" style="display:none;"><li id="replyrow">
    19911952<?php endif; ?>
    19921953    <div id="replyhead" style="display:none;"><?php _e('Reply to Comment'); ?></div>
     
    20361997</td></tr></tbody></table>
    20371998<?php else : ?>
    2038 </div></div>
     1999</li></ul>
    20392000<?php endif; ?>
    20402001</form>
     
    28292790                <label class="hidden" for="find-posts-input"><?php _e( 'Search' ); ?></label>
    28302791                <input type="text" id="find-posts-input" class="search-input" name="ps" value="" />
    2831                 <input type="button" onclick="findPosts.send();" value="<?php _e( 'Search' ); ?>" class="button" /><br />
     2792                <input type="button" onClick="findPosts.send();" value="<?php _e( 'Search' ); ?>" class="button" /><br />
    28322793
    28332794                <input type="radio" name="find-posts-what" id="find-posts-posts" checked="checked" value="posts" />
     
    28392800        </div>
    28402801        <div class="find-box-buttons">
    2841             <input type="button" class="button" onclick="findPosts.close();" value="<?php _e('Close'); ?>" />
     2802            <input type="button" class="button" onClick="findPosts.close();" value="<?php _e('Close'); ?>" />
    28422803            <input id="find-posts-submit" type="submit" class="button" value="<?php _e('Select'); ?>" />
    28432804        </div>
  • trunk/wp-admin/js/edit-comments.js

    r9297 r9413  
    8989
    9090    init : function() {
    91         this.rows = $('#the-comment-list tr');
    92         if ( !this.rows.size() )
    93             this.rows = $('#the-comment-list > div.comment-item');
     91        this.rows = $('#the-comment-list li');
    9492        var row = $('#replyrow');
    9593
     
    150148        t.o = '#comment-'+id;
    151149
    152         $('#replyrow td').attr('colspan', $('.widefat thead th:visible').length);
     150//      $('#replyrow td').attr('colspan', $('.widefat thead th:visible').length);
    153151        var editRow = $('#replyrow'), rowData = $('#inline-'+id);
    154152        var act = t.act = (a == 'edit') ? 'edit-comment' : 'replyto-comment';
  • trunk/wp-admin/js/post.js

    r9402 r9413  
    288288                function(r) {
    289289                    var r = wpAjax.parseAjaxResponse(r);
    290                     $('#commentstatusdiv .widefat').show();
     290                    $('#commentstatusdiv .comments-box').show();
    291291                    $('.waiting').hide();
    292292
     
    309309                    }
    310310
    311                     $('#the-comment-list').append('<tr><td colspan="5">'+wpAjax.broken+'</td></tr>');
     311                    $('#the-comment-list').append('<li>'+wpAjax.broken+'</li>');
    312312                }
    313313            );
  • trunk/wp-admin/upload.php

    r9363 r9413  
    416416<br class="clear" />
    417417
    418 <table class="widefat" style="margin-top: .5em">
    419 <thead>
    420     <tr>
    421         <th scope="col"><?php _e('Comment') ?></th>
    422         <th scope="col"><?php _e('Date') ?></th>
    423         <th scope="col"><?php _e('Actions') ?></th>
    424     </tr>
    425 </thead>
    426 <tbody id="the-comment-list" class="list:comment">
     418<ol id="the-comment-list" class="list:comment">
    427419<?php
    428420        foreach ($comments as $comment)
    429421            _wp_comment_row( $comment->comment_ID, 'detail', false, false );
    430422?>
    431 </tbody>
    432 </table>
     423</ol>
     424
    433425
    434426<?php
  • trunk/wp-admin/wp-admin.css

    r9411 r9413  
    19261926}
    19271927
    1928 #the-comment-list td.comment p.comment-author {
    1929     margin-top: 0;
    1930     margin-left: 0;
     1928#the-comment-list {
     1929    list-style: none;
     1930    margin: 0;
     1931    padding: 0;
     1932    font-size: 11px;
     1933}
     1934
     1935#the-comment-list .sepa {
     1936    color: #999;
     1937}
     1938
     1939#the-comment-list .comment-action-link {
     1940    width: 6em;
     1941    display: inline-block;
     1942}
     1943
     1944#the-comment-list p.comment-author {
     1945    height: 2.8em;
     1946}
     1947
     1948#the-comment-list li.comment-list-item {
     1949    padding: 0 1.2em 1em;
     1950    border-bottom: 1px solid #ccc;
    19311951}
    19321952
     
    19381958#the-comment-list p.comment-author strong a {
    19391959    border: none;
    1940 }
    1941 
    1942 #the-comment-list td {
    1943     vertical-align: top;
    1944 }
    1945 
    1946 #the-comment-list td.comment {
    1947 /*
    1948     width: 65%;
    1949     max-width: 460px;
    1950 */
    1951     word-wrap: break-word;
    1952 }
    1953 
    1954 #the-comment-list .check-column {
    1955     padding-top: 8px;
    19561960}
    19571961
     
    22462250/* reply to comments */
    22472251#replyrow {
     2252    border-width: 1px;
     2253    border-style: solid;
    22482254    font-size: 11px;
     2255    margin: 0 0 12px;
    22492256}
    22502257
     
    29062913    font-style: italic;
    29072914}
     2915
     2916.comments-box {
     2917    margin: 12px 0 5px;
     2918}
     2919
     2920
Note: See TracChangeset for help on using the changeset viewer.