WordPress.org

Make WordPress Core

Changeset 20455


Ignore:
Timestamp:
04/12/2012 09:10:40 PM (10 years ago)
Author:
koopersmith
Message:

Theme list table style improvements. Make 'delete' link red and separate from other actions. New action separators. see #20403.

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/wp-admin.dev.css

    r20446 r20455  
    43134313.available-theme .action-links {
    43144314    margin-top: 10px;
     4315    overflow: hidden;
     4316}
     4317
     4318.available-theme .action-links li {
     4319    float: left;
     4320    padding-right: 10px;
     4321    margin-right: 10px;
     4322    border-right: 1px solid #dfdfdf;
     4323}
     4324
     4325.available-theme .action-links li:last-child {
     4326    padding-right: 0;
     4327    margin-right: 0;
     4328    border-right: 0;
     4329}
     4330
     4331.available-theme .action-links .delete-theme {
     4332    float: right;
     4333    margin-right: 0;
     4334}
     4335
     4336.available-theme .action-links .delete-theme a {
     4337    color: red;
     4338    padding: 2px;
     4339}
     4340
     4341.available-theme .action-links .delete-theme a:hover {
     4342    background: red;
     4343    color: #fff;
     4344    text-decoration: none;
     4345}
     4346
     4347.available-theme .action-links p {
     4348    float: left;
    43154349}
    43164350
  • trunk/wp-admin/includes/class-wp-themes-list-table.php

    r20414 r20455  
    142142                . '<a href="#" class="load-customize hide-if-no-js" ' . $customize_attributes . '>' . __( 'Customize' ) . '</a>';
    143143            if ( ! is_multisite() && current_user_can( 'delete_themes' ) )
    144                 $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&amp;template=$stylesheet", 'delete-theme_' . $stylesheet )
     144                $actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&amp;template=$stylesheet", 'delete-theme_' . $stylesheet )
    145145                    . '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete." ), $title ) )
    146146                    . "' );" . '">' . __( 'Delete' ) . '</a>';
    147147
    148             $actions = apply_filters( 'theme_action_links', $actions, $theme );
    149 
    150             $actions = implode ( ' | ', $actions );
     148            $actions       = apply_filters( 'theme_action_links', $actions, $theme );
     149            $delete_action = isset( $actions['delete'] ) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
     150            unset( $actions['delete'] );
     151
    151152            ?>
    152153            <a href="<?php echo $preview_link; ?>" class="load-customize screenshot" <?php echo $customize_attributes; ?>>
     
    158159            <div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
    159160            <div class="action-links">
    160                 <?php echo $actions; ?>
    161                 <span class="separator hide-if-no-js">| </span><a href="#" class="theme-detail hide-if-no-js" tabindex='4'><?php _e('Details') ?></a>
     161                <ul>
     162                    <?php foreach ( $actions as $action ): ?>
     163                        <li><?php echo $action; ?></li>
     164                    <?php endforeach; ?>
     165                    <li class="hide-if-no-js"><a href="#" class="theme-detail" tabindex='4'><?php _e('Details') ?></a></li>
     166                </ul>
     167                <?php echo $delete_action; ?>
     168
     169                <?php theme_update_available( $theme ); ?>
    162170            </div>
    163171
     
    176184            </div>
    177185
    178             <?php theme_update_available( $theme ); ?>
    179 
    180186            </div>
    181187        <?php
  • trunk/wp-admin/js/theme.dev.js

    r20415 r20455  
    66jQuery( function($) {
    77    $('#availablethemes').on( 'click', '.theme-detail', function (event) {
    8         $(this).parent().siblings('.themedetaildiv').toggle();
     8        $(this).parents('.action-links').siblings('.themedetaildiv').toggle();
    99        event.preventDefault();
    1010    });
Note: See TracChangeset for help on using the changeset viewer.