Right Now (Dashboard) styling. props Malaiac. fixes #8015

git-svn-id: http://svn.automattic.com/wordpress/trunk@9427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-10-31 04:23:17 +00:00
parent 3bca944c3e
commit 741a20d8b7
4 changed files with 143 additions and 33 deletions

View File

@ -91,6 +91,112 @@ div.postbox div.inside {
padding: 0;
}
/* Right Now */
#dashboard_right_now p.sub, #dashboard_right_now .table, #dashboard_right_now .versions {
margin: -10px;
}
#dashboard_right_now .inside {
font-family: Georgia, serif;
font-size: 14px;
}
#dashboard_right_now p.sub {
font-style: italic;
padding: 5px 10px 15px;
color: #777;
}
#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 a {
text-decoration: none;
}
#dashboard_right_now .b, #dashboard_right_now .b a {
color: #2583ad;
}
#dashboard_right_now td.b {
padding-right: 6px;
text-align: right;
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 14px;
}
#dashboard_right_now td.b a {
font-size: 18px;
}
#dashboard_right_now .t {
font-size: 12px;
padding-right: 12px;
color: #777;
}
#dashboard_right_now td.first,
#dashboard_right_now td.last {
width: 1px;
}
#dashboard_right_now .spam {
color: red;
}
#dashboard_right_now .waiting {
color: orange;
}
#dashboard_right_now .approved {
color: green;
}
#dashboard_right_now .versions {
line-height: 2.5em;
padding: 10px;
}
#dashboard_right_now .versions {
font-style: italic;
font-size: 12px;
}
#dashboard_right_now .versions a, #dashboard_right_now .versions .b {
font-style: normal;
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;;
font-weight: bold;
}
#dashboard_right_now a.button {
font-weight: normal;
float: right;
clear: right;
position: relative;
top: -5px;
}
/* Recent Comments */
#the-comment-list {

View File

@ -163,16 +163,16 @@ function wp_dashboard_right_now() {
$num_comm = get_comment_count( );
echo '<p>' . __('At a Glance') . '</p>';
echo '<table>';
echo '<tr>';
echo "\n\t".'<p class="sub">' . __('At a Glance') . '</p>';
echo "\n\t".'<div class="table">'."\n\t".'<table>';
echo "\n\t".'<tr class="first">';
// Posts
$num = number_format_i18n( $num_posts->publish );
if ( current_user_can( 'edit_posts' ) )
$num = "<a href='edit.php'>$num</a>";
echo "<td>$num</td>";
echo '<td>' . __ngettext( 'Post', 'Posts', $num_posts->publish ) . '</td>';
echo '<td class="first b b-posts">'.$num.'</td>';
echo '<td class="t posts">' . __ngettext( 'Post', 'Posts', $num_posts->publish ) . '</td>';
/* TODO: Show status breakdown on hover
if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can
$post_type_texts[] = '<a href="edit-pages.php">'.sprintf( __ngettext( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>';
@ -194,8 +194,8 @@ function wp_dashboard_right_now() {
$num = number_format_i18n($num_comm['total_comments']);
if ( current_user_can( 'moderate_comments' ) )
$num = "<a href='edit-comments.php'>$num</a>";
echo "<td>$num</td>";
echo '<td>' . __ngettext( 'Comment', 'Comments', $num_comm['total_comments'] ) . '</td>';
echo '<td class="b b-comments">'.$num.'</td>';
echo '<td class="last t comments">' . __ngettext( 'Comment', 'Comments', $num_comm['total_comments'] ) . '</td>';
echo '</tr><tr>';
@ -203,65 +203,69 @@ function wp_dashboard_right_now() {
$num = number_format_i18n( $num_pages->publish );
if ( current_user_can( 'edit_pages' ) )
$num = "<a href='edit-pages.php'>$num</a>";
echo "<td>$num</td>";
echo '<td>' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . '</td>';
echo '<td class="first b b_pages">'.$num.'</td>';
echo '<td class="t pages">' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . '</td>';
// Approved Comments
$num = number_format_i18n($num_comm['approved']);
if ( current_user_can( 'moderate_comments' ) )
$num = "<a href='edit-comments.php?comment_status=approved'>$num</a>";
echo "<td>$num</td>";
echo '<td>' . __ngettext( 'Approved', 'Approved', $num_comm['approved'] ) . '</td>';
echo '<td class="b b_approved">'.$num.'</td>';
echo '<td class="last t approved">' . __ngettext( 'Approved', 'Approved', $num_comm['approved'] ) . '</td>';
echo '</tr><tr>';
echo "</tr>\n\t<tr>";
// Categories
$num = number_format_i18n( $num_cats );
if ( current_user_can( 'manage_categories' ) )
$num = "<a href='categories.php'>$num</a>";
echo "<td>$num</td>";
echo '<td>' . __ngettext( 'Category', 'Categories', $num_cats ) . '</td>';
$num = "<a href='caftegories.php'>$num</a>";
echo '<td class="first b b-cats">'.$num.'</td>';
echo '<td class="t cats">' . __ngettext( 'Category', 'Categories', $num_cats ) . '</td>';
// Spam Comments
$num = number_format_i18n($num_comm['spam']);
if ( current_user_can( 'moderate_comments' ) )
$num = "<a href='edit-comments.php?comment_status=spam'>$num</a>";
echo "<td>$num</td>";
echo '<td>' . __ngettext( 'Spam', 'Spam', $num_comm['spam'] ) . '</td>';
echo '<td class="b b-spam">'.$num.'</td>';
echo '<td class="last t spam">' . __ngettext( 'Spam', 'Spam', $num_comm['spam'] ) . '</td>';
echo '</tr><tr>';
echo "</tr>\n\t<tr>";
// Tags
$num = number_format_i18n( $num_tags );
if ( current_user_can( 'manage_categories' ) )
$num = "<a href='edit-tags.php'>$num</a>";
echo "<td>$num</td>";
echo '<td>' . __ngettext( 'Tag', 'Tags', $num_tags ) . '</td>';
echo '<td class="first b b-tags">'.$num.'</td>';
echo '<td class="t tags">' . __ngettext( 'Tag', 'Tags', $num_tags ) . '</td>';
// Pending Comments
$num = number_format_i18n($num_comm['awaiting_moderation']);
if ( current_user_can( 'moderate_comments' ) )
$num = "<a href='edit-comments.php?comment_status=moderated'>$num</a>";
echo "<td>$num</td>";
echo '<td>' . __ngettext( 'Pending', 'Pending', $num_comm['awaiting_moderation'] ) . '</td>';
echo '</tr></table>';
echo '<td class="b b-waiting">'.$num.'</td>';
echo '<td class="last t waiting">' . __ngettext( 'Awaiting Moderation', 'Awaiting Moderation', $num_comm['awaiting_moderation'] ) . '</td>';
echo "</tr>\n\t</table>\n\t</div>";
echo "\n\t".'<div class="versions">';
$ct = current_theme_info();
$sidebars_widgets = wp_get_sidebars_widgets();
$num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ), 0 );
$num = number_format_i18n( $num_widgets );
if ( $can_switch_themes = current_user_can( 'switch_themes' ) )
$num = "<a href='widgets.php'>$num</a>";
echo '<p>';
printf(__ngettext('Theme %1$s with %2$s Widget', 'Theme %1$s with %2$s Widgets', $num_widgets), $ct->title, $num);
if ( $can_switch_themes )
echo ' <a href="themes.php" class="rbutton">' . __('Change Theme') . '</a>';
echo "\n\t<p>";
if ( current_user_can( 'switch_themes' ) ) {
echo '<a href="themes.php" class="button rbutton">' . __('Change Theme') . '</a>';
printf(__ngettext('Theme <span class="b"><a href="themes.php">%1$s</a></span> with <span class="b"><a href="widgets.php">%2$s Widget</a></span>', 'Theme <span class="b"><a href="themes.php">%1$s</a></span> with <span class="b"><a href="widgets.php">%2$s Widgets</a></span>', $num_widgets), $ct->title, $num);
} else {
printf(__ngettext('Theme <span class="b">%1$s</span> with <span class="b">%2$s Widget</span>', 'Theme <span class="b">%1$s</span> with <span class="b">%2$s Widgets</span>', $num_widgets), $ct->title, $num);
}
echo '</p>';
update_right_now_message();
echo "\n\t".'</div>';
do_action( 'rightnow_end' );
do_action( 'activity_box_end' );
}

View File

@ -57,9 +57,9 @@ function update_nag() {
function update_right_now_message() {
$cur = get_option( 'update_core' );
$msg = sprintf( __('This is WordPress version %s.'), $GLOBALS['wp_version'] );
$msg = sprintf( __('You are using <span class="b">WordPress %s</span>.'), $GLOBALS['wp_version'] );
if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('manage_options') )
$msg .= " <a href='update.php?action=upgrade-core' class='rbutton'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
$msg .= " <a href='update.php?action=upgrade-core' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
echo "<span id='wp-version-message'>$msg</span>";
}

View File

@ -330,7 +330,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'global', '/wp-admin/css/global.css', array(), '20081029' );
$styles->add( 'media', '/wp-admin/css/media.css', array(), '20080709' );
$styles->add( 'widgets', '/wp-admin/css/widgets.css' );
$styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20081008' );
$styles->add( 'dashboard', '/wp-admin/css/dashboard.css', array(), '20081030' );
$styles->add( 'install', '/wp-admin/css/install.css', array(), '20080708' );
$styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css' );
$styles->add( 'press-this', '/wp-admin/css/press-this.css', array(), '20080922' );