WordPress.org

Make WordPress Core

Ticket #12202: 12202.diff

File 12202.diff, 18.5 KB (added by matveb, 8 years ago)

First patch for the Right Now module

  • wp-admin/includes/dashboard.php

     
    206206
    207207        $num_comm = wp_count_comments( );
    208208
    209         echo "\n\t".'<p class="sub">' . __('At a Glance') . '</p>';
    210         echo "\n\t".'<div class="table">'."\n\t".'<table>';
     209        echo "\n\t".'<div class="table table_content">'."\n\t".'<table>';
     210        echo "\n\t".'<caption>' . __('Content') . '</caption>';
    211211        echo "\n\t".'<tr class="first">';
    212212
    213213        // Posts
     
    219219        }
    220220        echo '<td class="first b b-posts">' . $num . '</td>';
    221221        echo '<td class="t posts">' . $text . '</td>';
     222       
     223        echo '</tr><tr>';
    222224        /* TODO: Show status breakdown on hover
    223225        if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds.  Don't show if !current_user_can
    224226                $post_type_texts[] = '<a href="edit-pages.php">'.sprintf( _n( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>';
     
    235237                $pending_text = '';
    236238        }
    237239        */
     240       
     241        // Pages
     242        $num = number_format_i18n( $num_pages->publish );
     243        $text = _n( 'Page', 'Pages', $num_pages->publish );
     244        if ( current_user_can( 'edit_pages' ) ) {
     245                $num = "<a href='edit.php?post_type=page'>$num</a>";
     246                $text = "<a href='edit.php?post_type=page'>$text</a>";
     247        }
     248        echo '<td class="first b b_pages">' . $num . '</td>';
     249        echo '<td class="t pages">' . $text . '</td>';
     250       
     251        echo '</tr><tr>';
    238252
     253        // Categories
     254        $num = number_format_i18n( $num_cats );
     255        $text = _n( 'Category', 'Categories', $num_cats );
     256        if ( current_user_can( 'manage_categories' ) ) {
     257                $num = "<a href='categories.php'>$num</a>";
     258                $text = "<a href='categories.php'>$text</a>";
     259        }
     260        echo '<td class="first b b-cats">' . $num . '</td>';
     261        echo '<td class="t cats">' . $text . '</td>';
     262       
     263        echo '</tr><tr>';
     264       
     265        // Tags
     266        $num = number_format_i18n( $num_tags );
     267        $text = _n( 'Tag', 'Tags', $num_tags );
     268        if ( current_user_can( 'manage_categories' ) ) {
     269                $num = "<a href='edit-tags.php'>$num</a>";
     270                $text = "<a href='edit-tags.php'>$text</a>";
     271        }
     272        echo '<td class="first b b-tags">' . $num . '</td>';
     273        echo '<td class="t tags">' . $text . '</td>';
     274       
     275        echo "</tr>";
     276        echo "\n\t</table>\n\t</div>";
     277       
     278        echo "\n\t".'<div class="table table_discussion">'."\n\t".'<table>';
     279        echo "\n\t".'<caption>' . __('Discussion') . '</caption>';
     280        echo "\n\t".'<tr class="first">';
     281       
    239282        // Total Comments
    240283        $num = '<span class="total-count">' . number_format_i18n($num_comm->total_comments) . '</span>';
    241284        $text = _n( 'Comment', 'Comments', $num_comm->total_comments );
     
    248291
    249292        echo '</tr><tr>';
    250293
    251         // Pages
    252         $num = number_format_i18n( $num_pages->publish );
    253         $text = _n( 'Page', 'Pages', $num_pages->publish );
    254         if ( current_user_can( 'edit_pages' ) ) {
    255                 $num = "<a href='edit.php?post_type=page'>$num</a>";
    256                 $text = "<a href='edit.php?post_type=page'>$text</a>";
    257         }
    258         echo '<td class="first b b_pages">' . $num . '</td>';
    259         echo '<td class="t pages">' . $text . '</td>';
    260 
    261294        // Approved Comments
    262295        $num = '<span class="approved-count">' . number_format_i18n($num_comm->approved) . '</span>';
    263296        $text = _nx( 'Approved', 'Approved', $num_comm->approved, 'Right Now' );
     
    270303
    271304        echo "</tr>\n\t<tr>";
    272305
    273         // Categories
    274         $num = number_format_i18n( $num_cats );
    275         $text = _n( 'Category', 'Categories', $num_cats );
    276         if ( current_user_can( 'manage_categories' ) ) {
    277                 $num = "<a href='edit-tags.php?taxonomy=category'>$num</a>";
    278                 $text = "<a href='edit-tags.php?taxonomy=category'>$text</a>";
    279         }
    280         echo '<td class="first b b-cats">' . $num . '</td>';
    281         echo '<td class="t cats">' . $text . '</td>';
    282 
    283306        // Pending Comments
    284307        $num = '<span class="pending-count">' . number_format_i18n($num_comm->moderated) . '</span>';
    285308        $text = _n( 'Pending', 'Pending', $num_comm->moderated );
     
    292315
    293316        echo "</tr>\n\t<tr>";
    294317
    295         // Tags
    296         $num = number_format_i18n( $num_tags );
    297         $text = _n( 'Tag', 'Tags', $num_tags );
    298         if ( current_user_can( 'manage_categories' ) ) {
    299                 $num = "<a href='edit-tags.php'>$num</a>";
    300                 $text = "<a href='edit-tags.php'>$text</a>";
    301         }
    302         echo '<td class="first b b-tags">' . $num . '</td>';
    303         echo '<td class="t tags">' . $text . '</td>';
    304 
    305318        // Spam Comments
    306319        $num = number_format_i18n($num_comm->spam);
    307320        $text = _n( 'Spam', 'Spam', $num_comm->spam );
     
    315328        echo "</tr>";
    316329        do_action('right_now_table_end');
    317330        echo "\n\t</table>\n\t</div>";
    318 
     331       
    319332        echo "\n\t".'<div class="versions">';
    320333        $ct = current_theme_info();
    321334
     
    412425                <p class="submit">
    413426                        <input type="hidden" name="action" id="quickpost-action" value="post-quickpress-save" />
    414427                        <input type="hidden" name="quickpress_post_ID" value="<?php echo (int) $post->ID; ?>" />
    415                         <input type="hidden" name="post_type" value="post" />
    416428                        <?php wp_nonce_field('add-post'); ?>
    417429                        <input type="submit" name="save" id="save-post" class="button" tabindex="4" value="<?php esc_attr_e('Save Draft'); ?>" />
    418430                        <input type="reset" value="<?php esc_attr_e( 'Reset' ); ?>" class="button" />
     
    958970 */
    959971function wp_dashboard_empty() {}
    960972
    961 ?>
     973?>
     974 No newline at end of file
  • wp-admin/css/dashboard.dev.css

     
    9191
    9292#dashboard_right_now .inside {
    9393        font-size: 12px;
     94        padding-top: 20px;
    9495}
    9596
    96 #dashboard_right_now p.sub {
     97#dashboard_right_now caption {
    9798        font-style: italic;
    9899        font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
    99100        padding: 5px 10px 15px;
    100101        color: #777;
    101102        font-size: 13px;
     103        position: absolute;
     104        top: -26px;
     105        left: 3px;
    102106}
    103107
    104108#dashboard_right_now .table {
     109        width: 45%;
     110        margin: 0 -9px;
     111        padding: 0 10px;
    105112        background: #f9f9f9;
    106113        border-top: #ececec 1px solid;
    107114        border-bottom: #ececec 1px solid;
    108         margin: 0 -9px 10px;
    109         padding: 0 10px;
     115        position: relative;
    110116}
    111117
    112 #dashboard_right_now table {
    113         width: 100%;
     118#dashboard_right_now .table_content {
     119        float: left;
     120        border-right: #ececec 1px solid;
    114121}
    115122
     123#dashboard_right_now .table_discussion {
     124        float: right;
     125        border-left: #ececec 1px solid;
     126}
     127
    116128#dashboard_right_now table  td {
    117129        border-top: #ececec 1px solid;
    118130        padding: 3px 0;
     
    128140        text-align: right;
    129141        font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
    130142        font-size: 14px;
     143        width: 1%;
    131144}
    132145
    133146#dashboard_right_now td.b a {
     
    149162        white-space: nowrap;
    150163}
    151164
    152 #dashboard_right_now td.first,
    153 #dashboard_right_now td.last {
    154         width: 1%;
    155 }
    156 
    157165#dashboard_right_now .spam {
    158166        color: red;
    159167}
     
    168176
    169177#dashboard_right_now .versions {
    170178        padding: 6px 10px 12px;
     179        clear: left;
    171180}
    172181
    173182#dashboard_right_now .versions .b {
     
    390399.dashboard-comment-wrap {
    391400        overflow: hidden;
    392401        word-wrap: break-word;
    393 }
    394 
     402}
     403 No newline at end of file
  • wp-admin/css/dashboard.css

     
    1 .postbox p,.postbox ul,.postbox ol,.postbox blockquote,#wp-version-message{font-size:11px;}.edit-box{display:none;}h3:hover .edit-box{display:inline;}form .input-text-wrap{border-style:solid;border-width:1px;padding:2px 3px;border-color:#ccc;}#dashboard-widgets form .input-text-wrap input{border:0 none;outline:none;margin:0;padding:0;width:99%;color:#333;}form .textarea-wrap{border-style:solid;border-width:1px;padding:2px;border-color:#ccc;}#dashboard-widgets form .textarea-wrap textarea{border:0 none;padding:0;outline:none;width:99%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}#dashboard-widgets .postbox form .submit{float:none;margin:.5em 0 0;padding:0;border:none;}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input{margin:0;}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish{min-width:0;}div.postbox div.inside{margin:10px;position:relative;}#dashboard-widgets a{text-decoration:none;}#dashboard-widgets h3 a{text-decoration:underline;}#dashboard-widgets h3 .postbox-title-action{position:absolute;right:30px;padding:0;}#dashboard-widgets h4{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px;margin:0 0 .2em;padding:0;}#dashboard_right_now p.sub,#dashboard_right_now .table,#dashboard_right_now .versions{margin:-12px;}#dashboard_right_now .inside{font-size:12px;}#dashboard_right_now p.sub{font-style:italic;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:5px 10px 15px;color:#777;font-size:13px;}#dashboard_right_now .table{background:#f9f9f9;border-top:#ececec 1px solid;border-bottom:#ececec 1px solid;margin:0 -9px 10px;padding:0 10px;}#dashboard_right_now table{width:100%;}#dashboard_right_now table td{border-top:#ececec 1px solid;padding:3px 0;white-space:nowrap;}#dashboard_right_now table tr.first td{border-top:none;}#dashboard_right_now td.b{padding-right:6px;text-align:right;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;}#dashboard_right_now td.b a{font-size:18px;}#dashboard_right_now td.b a:hover{color:#d54e21;}#dashboard_right_now .t{font-size:12px;padding-right:12px;padding-top:6px;color:#777;}#dashboard_right_now .t a{white-space:nowrap;}#dashboard_right_now td.first,#dashboard_right_now td.last{width:1%;}#dashboard_right_now .spam{color:red;}#dashboard_right_now .waiting{color:#e66f00;}#dashboard_right_now .approved{color:green;}#dashboard_right_now .versions{padding:6px 10px 12px;}#dashboard_right_now .versions .b{font-weight:bold;}#dashboard_right_now a.button{float:right;clear:right;position:relative;top:-5px;}#dashboard_recent_comments h3{margin-bottom:0;}#dashboard_recent_comments .inside{margin-top:0;}#dashboard_recent_comments .comment-meta .approve{font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:10px;}#the-comment-list{position:relative;}#the-comment-list .comment-item{padding:1em 10px;border-top:1px solid;}#the-comment-list .pingback{padding-left:9px!important;}#the-comment-list .comment-item,#the-comment-list #replyrow{margin:0 -10px;}#the-comment-list .comment-item:first-child{border-top:none;}#the-comment-list .comment-item .avatar{float:left;margin:0 10px 5px 0;}#the-comment-list .comment-item h4{line-height:1.4;margin-top:-.2em;font-weight:normal;color:#999;}#the-comment-list .comment-item h4 cite{font-style:normal;font-weight:normal;}#the-comment-list .comment-item blockquote,#the-comment-list .comment-item blockquote p{margin:0;padding:0;display:inline;}#dashboard_recent_comments #the-comment-list .trackback blockquote,#dashboard_recent_comments #the-comment-list .pingback blockquote{display:block;}#the-comment-list .comment-item p.row-actions{margin:3px 0 0;padding:0;font-size:10px;}#dashboard_quick_press h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;float:left;width:5.5em;clear:both;font-weight:normal;text-align:right;padding-top:5px;font-size:12px;}#dashboard_quick_press h4 label{margin-right:10px;}#dashboard_quick_press .input-text-wrap,#dashboard_quick_press .textarea-wrap{margin:0 0 1em 5em;}#dashboard_quick_press #media-buttons{margin:0 0 .5em 5em;padding:0 0 0 10px;font-size:11px;}#dashboard_quick_press #media-buttons a{vertical-align:bottom;}#dashboard-widgets #dashboard_quick_press form p.submit{margin-left:4.6em;}#dashboard-widgets #dashboard_quick_press form p.submit input{float:left;}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 1em 0 10px;}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:right;}#dashboard_recent_drafts ul{margin:0;padding:0;list-style:none;}#dashboard_recent_drafts ul li{margin-bottom:.6em;}#dashboard_recent_drafts h4{font-weight:normal;}#dashboard_recent_drafts h4 abbr{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:11px;color:#999;margin-left:3px;}#dashboard_recent_drafts p{margin:0;padding:0;}.rss-widget ul{margin:0;padding:0;list-style:none;}a.rsswidget{font-size:13px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;line-height:1.7em;}.rss-widget ul li{line-height:1.5em;margin-bottom:12px;}.rss-widget span.rss-date{margin-left:3px;}.rss-widget cite{display:block;text-align:right;margin:0 0 1em;padding:0;}.rss-widget cite:before{content:'\2014';}#dashboard_plugins h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}#dashboard_plugins h5{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px!important;margin:0;display:inline;line-height:1.4em;}#dashboard_plugins h5 a{font-weight:normal;line-height:1.7em;}#dashboard_plugins p{margin:0 0 1.4em;line-height:1.4em;}.dashboard-comment-wrap{overflow:hidden;word-wrap:break-word;}
    2  No newline at end of file
     1.postbox p,.postbox ul,.postbox ol,.postbox blockquote,#wp-version-message{font-size:11px}.edit-box{display:none}h3:hover .edit-box{display:inline}form .input-text-wrap{border-style:solid;border-width:1px;padding:2px 3px;border-color:#ccc}#dashboard-widgets form .input-text-wrap input{border:0 none;outline:none;margin:0;padding:0;width:99%;color:#333}form .textarea-wrap{border-style:solid;border-width:1px;padding:2px;border-color:#ccc}#dashboard-widgets form .textarea-wrap textarea{border:0 none;padding:0;outline:none;width:99%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#dashboard-widgets .postbox form .submit{float:none;margin:.5em 0 0;padding:0;border:none}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input{margin:0}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish{min-width:0}div.postbox div.inside{margin:10px;position:relative}#dashboard-widgets a{text-decoration:none}#dashboard-widgets h3 a{text-decoration:underline}#dashboard-widgets h3 .postbox-title-action{position:absolute;right:30px;padding:0}#dashboard-widgets h4{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px;margin:0 0 .2em;padding:0}#dashboard_right_now p.sub,#dashboard_right_now .table,#dashboard_right_now .versions{margin:-12px}#dashboard_right_now .inside{font-size:12px;padding-top:20px}#dashboard_right_now caption{font-style:italic;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:5px 10px 15px;color:#777;font-size:13px;position:absolute;top:-26px;left:3px}#dashboard_right_now .table{width:45%;margin:0 -9px;padding:0 10px;background:#f9f9f9;border-top:#ececec 1px solid;border-bottom:#ececec 1px solid;position:relative}#dashboard_right_now .table_content{float:left;border-right:#ececec 1px solid}#dashboard_right_now .table_discussion{float:right;border-left:#ececec 1px solid}#dashboard_right_now table td{border-top:#ececec 1px solid;padding:3px 0;white-space:nowrap}#dashboard_right_now table tr.first td{border-top:none}#dashboard_right_now td.b{padding-right:6px;text-align:right;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;width:1%}#dashboard_right_now td.b a{font-size:18px}#dashboard_right_now td.b a:hover{color:#d54e21}#dashboard_right_now .t{font-size:12px;padding-right:12px;padding-top:6px;color:#777}#dashboard_right_now .t a{white-space:nowrap}#dashboard_right_now .spam{color:red}#dashboard_right_now .waiting{color:#e66f00}#dashboard_right_now .approved{color:green}#dashboard_right_now .versions{padding:6px 10px 12px;clear:left}#dashboard_right_now .versions .b{font-weight:bold}#dashboard_right_now a.button{float:right;clear:right;position:relative;top:-5px}#dashboard_recent_comments h3{margin-bottom:0}#dashboard_recent_comments .inside{margin-top:0}#dashboard_recent_comments .comment-meta .approve{font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:10px}#the-comment-list{position:relative}#the-comment-list .comment-item{padding:1em 10px;border-top:1px solid}#the-comment-list .pingback{padding-left:9px !important}#the-comment-list .comment-item,#the-comment-list #replyrow{margin:0 -10px}#the-comment-list .comment-item:first-child{border-top:none}#the-comment-list .comment-item .avatar{float:left;margin:0 10px 5px 0}#the-comment-list .comment-item h4{line-height:1.4;margin-top:-.2em;font-weight:normal;color:#999}#the-comment-list .comment-item h4 cite{font-style:normal;font-weight:normal}#the-comment-list .comment-item blockquote,#the-comment-list .comment-item blockquote p{margin:0;padding:0;display:inline}#dashboard_recent_comments #the-comment-list .trackback blockquote,#dashboard_recent_comments #the-comment-list .pingback blockquote{display:block}#the-comment-list .comment-item p.row-actions{margin:3px 0 0;padding:0;font-size:10px}#dashboard_quick_press h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;float:left;width:5.5em;clear:both;font-weight:normal;text-align:right;padding-top:5px;font-size:12px}#dashboard_quick_press h4 label{margin-right:10px}#dashboard_quick_press .input-text-wrap,#dashboard_quick_press .textarea-wrap{margin:0 0 1em 5em}#dashboard_quick_press #media-buttons{margin:0 0 .5em 5em;padding:0 0 0 10px;font-size:11px}#dashboard_quick_press #media-buttons a{vertical-align:bottom}#dashboard-widgets #dashboard_quick_press form p.submit{margin-left:4.6em}#dashboard-widgets #dashboard_quick_press form p.submit input{float:left}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 1em 0 10px}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:right}#dashboard_recent_drafts ul{margin:0;padding:0;list-style:none}#dashboard_recent_drafts ul li{margin-bottom:0.6em}#dashboard_recent_drafts h4{font-weight:normal}#dashboard_recent_drafts h4 abbr{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:11px;color:#999;margin-left:3px}#dashboard_recent_drafts p{margin:0;padding:0}.rss-widget ul{margin:0;padding:0;list-style:none}a.rsswidget{font-size:13px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;line-height:1.7em}.rss-widget ul li{line-height:1.5em;margin-bottom:12px}.rss-widget span.rss-date{margin-left:3px}.rss-widget cite{display:block;text-align:right;margin:0 0 1em;padding:0}.rss-widget cite:before{content:'\2014'}#dashboard_plugins h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif}#dashboard_plugins h5{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px !important;margin:0;display:inline;line-height:1.4em}#dashboard_plugins h5 a{font-weight:normal;line-height:1.7em}#dashboard_plugins p{margin:0 0 1.4em;line-height:1.4em}.dashboard-comment-wrap{overflow:hidden;word-wrap:break-word}
     2 No newline at end of file