Make WordPress Core

Changeset 29219


Ignore:
Timestamp:
07/18/2014 06:07:21 AM (10 years ago)
Author:
helen
Message:

Plugin install cards:

  • Move author attribution to its own line.
  • Use esc_url() where appropriate.
  • Better i18n.
  • min-height for cards for a more even appearance.
  • Show more cards on wide screens.
  • Tighten up spacing below the filter bar.

props ocean90, helen. see #28785.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/list-tables.css

    r29133 r29219  
    12121212}
    12131213
     1214.plugin-install-php .wp-filter {
     1215    margin-bottom: 0;
     1216}
     1217
    12141218/* Plugin card table view */
    12151219.plugin-card {
     
    12261230}
    12271231
     1232.plugin-card:nth-child(odd) {
     1233    clear: both;
     1234    margin-left: 0;
     1235}
     1236
     1237.plugin-card:nth-child(even) {
     1238    margin-right: 0;
     1239}
     1240
     1241@media screen and ( min-width: 1600px ) {
     1242    .plugin-card {
     1243        width: 30%;
     1244        width: -webkit-calc( 33.1% - 8px );
     1245        width: calc( 33.1% - 8px );
     1246    }
     1247
     1248    .plugin-card:nth-child(odd) {
     1249        clear: none;
     1250        margin-left: 8px;
     1251    }
     1252
     1253    .plugin-card:nth-child(even) {
     1254        margin-right: 8px;
     1255    }
     1256
     1257    .plugin-card:nth-child(3n+1) {
     1258        clear: both;
     1259        margin-left: 0;
     1260    }
     1261
     1262    .plugin-card:nth-child(3n) {
     1263        margin-right: 0;
     1264    }
     1265}
     1266
    12281267@media screen and ( max-width: 782px ) {
    12291268    .plugin-card {
     
    12341273}
    12351274
    1236 .plugin-card:nth-child(odd) {
    1237     clear: both;
    1238     margin-left: 0;
    1239 }
    1240 
    1241 .plugin-card:nth-child(even) {
    1242     margin-right: 0
    1243 }
    1244 
    12451275.plugin-card-top {
    12461276    padding: 20px 20px 10px;
     1277    min-height: 115px; /* 2 lines for the description + author */
    12471278}
    12481279
  • trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r29218 r29219  
    307307                                '&TB_iframe=true&width=600&height=550' );
    308308
    309             $action_links[] = '<a href="' . esc_attr( $details_link ) . '" class="thickbox" aria-labelledby="' . $plugin['slug'] . '" data-title="' . esc_attr( $name ) . '">' . __( 'More Details' ) . '</a>';
     309            $action_links[] = '<a href="' . esc_url( $details_link ) . '" class="thickbox" aria-labelledby="' . $plugin['slug'] . '" data-title="' . esc_attr( $name ) . '">' . __( 'More Details' ) . '</a>';
    310310
    311311
     
    323323            <div class="plugin-card-top">
    324324                <div class="name column-name"<?php echo $style['name']; ?>>
    325                     <h4><a href="<?php echo esc_attr( $details_link ) ?>" class="thickbox"><?php echo $title; ?></a></h4>
     325                    <h4><a href="<?php echo esc_url( $details_link ) ?>" class="thickbox"><?php echo $title; ?></a></h4>
    326326                    <div class="action-links">
    327327                        <?php
     
    333333                </div>
    334334                <div class="desc column-description"<?php echo $style['description']; ?>>
    335                     <p><?php echo $description ?>
    336                     <span class="authors">
    337                         <?php echo $author; ?>
    338                     </span>
    339                     </p>
     335                    <p><?php echo $description ?></p>
     336                    <p class="authors"><?php echo $author; ?></p>
    340337                </div>
    341338            </div>
     
    345342                    <span class="num-ratings">(<?php echo number_format_i18n( $plugin['num_ratings'] ); ?>)</span>
    346343                </div>
    347                 <div class="column-updated"><?php echo __( '<strong>Last updated:</strong>' ) . ' '. sprintf( '%s ago', human_time_diff( strtotime($plugin['last_updated']) ) ); ?></div>
    348                 <div class="column-downloaded"><?php echo sprintf( __('%s downloads'), number_format_i18n( $plugin['downloaded'] ) ); ?></div>
     344                <div class="column-updated">
     345                    <strong><?php _e( 'Last Updated:' ); ?></strong> <span title="<?php echo esc_attr( $plugin['last_updated'] ); ?>">
     346                        <?php printf( __( '%s ago' ), human_time_diff( strtotime( $plugin['last_updated'] ) ) ); ?>
     347                    </span>
     348                </div>
     349                <div class="column-downloaded">
     350                    <?php echo sprintf( _n( '%s download', '%s downloads', $plugin['downloaded'] ), number_format_i18n( $plugin['downloaded'] ) ); ?>
     351                </div>
    349352                <div class="column-compatibility">
    350                 <?php
     353                    <?php
    351354                    if ( ! empty( $plugin['tested'] ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $plugin['tested'] ) ), $plugin['tested'], '>' ) ) {
    352355                        echo  __( '<strong>Untested</strong> with your install ');
     
    356359                        echo __( '<strong>Compatible</strong> with your install ');
    357360                    }
    358                 ?>
     361                    ?>
    359362                </div>
    360363            </div>
Note: See TracChangeset for help on using the changeset viewer.