Theme list table style improvements. Make 'delete' link red and separate from other actions. New action separators. see #20403.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
54b3b79dea
commit
1ec7a95c8b
|
@ -4312,6 +4312,40 @@ h3.available-themes {
|
|||
|
||||
.available-theme .action-links {
|
||||
margin-top: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.available-theme .action-links li {
|
||||
float: left;
|
||||
padding-right: 10px;
|
||||
margin-right: 10px;
|
||||
border-right: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
.available-theme .action-links li:last-child {
|
||||
padding-right: 0;
|
||||
margin-right: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
.available-theme .action-links .delete-theme {
|
||||
float: right;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.available-theme .action-links .delete-theme a {
|
||||
color: red;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.available-theme .action-links .delete-theme a:hover {
|
||||
background: red;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.available-theme .action-links p {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#current-theme {
|
||||
|
|
|
@ -141,13 +141,14 @@ class WP_Themes_List_Table extends WP_List_Table {
|
|||
. esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '">' . __( 'Preview' ) . '</a>'
|
||||
. '<a href="#" class="load-customize hide-if-no-js" ' . $customize_attributes . '>' . __( 'Customize' ) . '</a>';
|
||||
if ( ! is_multisite() && current_user_can( 'delete_themes' ) )
|
||||
$actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&template=$stylesheet", 'delete-theme_' . $stylesheet )
|
||||
$actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&template=$stylesheet", 'delete-theme_' . $stylesheet )
|
||||
. '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete." ), $title ) )
|
||||
. "' );" . '">' . __( 'Delete' ) . '</a>';
|
||||
|
||||
$actions = apply_filters( 'theme_action_links', $actions, $theme );
|
||||
$actions = apply_filters( 'theme_action_links', $actions, $theme );
|
||||
$delete_action = isset( $actions['delete'] ) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
|
||||
unset( $actions['delete'] );
|
||||
|
||||
$actions = implode ( ' | ', $actions );
|
||||
?>
|
||||
<a href="<?php echo $preview_link; ?>" class="load-customize screenshot" <?php echo $customize_attributes; ?>>
|
||||
<?php if ( $screenshot = $theme->get_screenshot() ) : ?>
|
||||
|
@ -157,8 +158,15 @@ class WP_Themes_List_Table extends WP_List_Table {
|
|||
<h3><?php echo $title; ?></h3>
|
||||
<div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
|
||||
<div class="action-links">
|
||||
<?php echo $actions; ?>
|
||||
<span class="separator hide-if-no-js">| </span><a href="#" class="theme-detail hide-if-no-js" tabindex='4'><?php _e('Details') ?></a>
|
||||
<ul>
|
||||
<?php foreach ( $actions as $action ): ?>
|
||||
<li><?php echo $action; ?></li>
|
||||
<?php endforeach; ?>
|
||||
<li class="hide-if-no-js"><a href="#" class="theme-detail" tabindex='4'><?php _e('Details') ?></a></li>
|
||||
</ul>
|
||||
<?php echo $delete_action; ?>
|
||||
|
||||
<?php theme_update_available( $theme ); ?>
|
||||
</div>
|
||||
|
||||
<div class="themedetaildiv hide-if-js">
|
||||
|
@ -175,8 +183,6 @@ class WP_Themes_List_Table extends WP_List_Table {
|
|||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php theme_update_available( $theme ); ?>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
jQuery( function($) {
|
||||
$('#availablethemes').on( 'click', '.theme-detail', function (event) {
|
||||
$(this).parent().siblings('.themedetaildiv').toggle();
|
||||
$(this).parents('.action-links').siblings('.themedetaildiv').toggle();
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue