Plugin Directory

Changeset 786541


Ignore:
Timestamp:
10/11/2013 06:41:10 PM (12 years ago)
Author:
lessbloat
Message:

Added Joens "no activity" smiley. Also a few top-level code review nit picks. More full featured code review still coming.

Location:
dashboard/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • dashboard/trunk/activity.php

    r786433 r786541  
    1212    echo '<div id="activity-widget">';
    1313
    14     dash_show_published_posts( array(
     14    $future_posts = dash_show_published_posts( array(
    1515        'display' => 2,
    1616        'max' => 5,
     
    1919        'id' => 'future-posts',
    2020    ) );
    21     dash_show_published_posts( array(
     21    $recent_posts = dash_show_published_posts( array(
    2222        'display' => 2,
    2323        'max' => 5,
     
    2626        'id' => 'published-posts',
    2727    ) );
    28     dash_comments();
     28    $recent_comments = dash_comments();
     29   
     30    if ( !$future_posts && !$recent_posts && !$recent_comments ) {
     31        echo '<div class="no-activity">';
     32        echo '<p class="smiley"></p>';
     33        echo '<p>' . __( 'No activity yet!' ) . '</p>';
     34        echo '</div>';
     35    }
    2936
    3037    echo '</div>';
     
    7380        echo '</div>';
    7481
     82    } else {
     83        return false;
    7584    }
    7685
    7786    wp_reset_postdata();
    7887
     88    return true;
    7989}
    8090
     
    103113    }
    104114   
    105     echo '<div id="latest-comments" class="activity-block">';
    106     echo '<h4>' . __( 'Comments' ) . '</h4>';
     115   
    107116
    108117    if ( $comments ) {
     118        echo '<div id="latest-comments" class="activity-block">';
     119        echo '<h4>' . __( 'Comments' ) . '</h4>';
     120       
    109121        echo '<div id="the-comment-list" data-wp-lists="list:comment">';
    110122        foreach ( $comments as $comment )
     
    117129        wp_comment_reply( -1, false, 'dashboard', false );
    118130        wp_comment_trashnotice();
     131       
     132        echo '</div>';
    119133    } else {
    120         echo '<p>' . __( 'No comments yet.' ) . '</p>';
     134        return false;
    121135    }
    122    
    123     echo '</div>';
    124 
     136    return true;
    125137}
    126138
  • dashboard/trunk/css/activity.css

    r786433 r786541  
    114114    margin: 4px 0 0 0;
    115115}
     116
     117#dashboard_activity .no-activity {
     118    overflow: hidden;
     119    padding: 0 12px 12px;
     120    text-align: center;
     121}
     122
     123#dashboard_activity .no-activity p {
     124    color: #999;
     125    font-size: 16px;
     126}
     127
     128#dashboard_activity .no-activity .smiley {
     129    margin-top: 0;
     130}
     131
     132#dashboard_activity .no-activity .smiley:before {
     133    content: '\f328';
     134    font: normal 120px/1 'dashicons';
     135    speak: none;
     136    display: block;
     137    margin: 0 5px 0 0;
     138    padding: 0;
     139    text-indent: 0;
     140    text-align: center;
     141    position: relative;
     142    -webkit-font-smoothing: antialiased;
     143    text-decoration: none !important;
     144}
  • dashboard/trunk/css/dash-rwd.css

    r786433 r786541  
    6767}
    6868
     69#dashboard-widgets-wrap {
     70    overflow: hidden;
     71}
     72
    6973#dashboard-widgets-wrap .columns-3 #postbox-container-4 .empty-container {
    7074    border: none !important;
  • dashboard/trunk/dashboard-override.php

    r786069 r786541  
    2727if ( current_user_can( 'install_plugins' ) )
    2828    wp_enqueue_script( 'plugin-install' );
    29 if ( current_user_can( 'upload_files' ) )
    30     wp_enqueue_script( 'media-upload' );
    3129add_thickbox();
    3230 
     
    107105 
    108106<div class="wrap">
    109 <?php screen_icon(); ?>
    110 <h2><?php $words = array( 'Hola', 'Bonjour', 'Aloha', 'Ahoy There', "G'day", "It's Go Time", 'Break a Leg', 'Go For Broke' ); echo esc_html( $words[ mt_rand( 0, count( $words) -1 ) ] ); ?></h2>
     107    <?php screen_icon(); ?>
     108    <h2><?php $words = array( 'Hola', 'Bonjour', 'Aloha', 'Ahoy There', "G'day", "It's Go Time", 'Break a Leg', 'Go For Broke' ); echo esc_html( $words[ mt_rand( 0, count( $words) -1 ) ] ); ?></h2>
    111109 
    112 <?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
     110    <?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
    113111    $classes = 'welcome-panel';
    114112 
     
    134132        ?>
    135133    </div>
    136 <?php endif; ?>
     134    <?php endif; ?>
    137135 
    138 <div id="dashboard-widgets-wrap">
    139  
    140 <?php wp_dashboard(); ?>
    141  
    142 <div class="clear"></div>
    143 </div><!-- dashboard-widgets-wrap -->
     136    <div id="dashboard-widgets-wrap">
     137    <?php wp_dashboard(); ?>
     138    </div><!-- dashboard-widgets-wrap -->
    144139 
    145140</div><!-- wrap -->
  • dashboard/trunk/dashboard.php

    r785653 r786541  
    3939                    include $module;
    4040            }
     41           
    4142            $this->screen = 'dashboard';
    4243        }
  • dashboard/trunk/wpnews.php

    r784802 r786541  
    33// Add the WordPress News widget to the dashboard
    44add_action( 'wp_dashboard_setup', 'add_wpnews_dashboard_widget' );
    5 
    65function add_wpnews_dashboard_widget() {
    76    if ( is_blog_admin() )
     7        // Note it would be ideal to have this loaded by default in the right column
     8        // Currently there is no way to set a $location arg in wp_add_dashboard_widget()
     9        // Would love to add that in core when merging this in.
    810        wp_add_dashboard_widget( 'dashboard_rss', __( 'WordPress News' ), 'wp_dashboard_rss', 'wp_dashboard_news_feed_control' );
    911}
Note: See TracChangeset for help on using the changeset viewer.