Theme browsing UX improvements. see #20403.

* On manage/install themes pages, moved author under theme name.
* On manage themes page, moved version number to details.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
koopersmith 2012-04-10 00:15:13 +00:00
parent 14a2452d72
commit b909e55294
3 changed files with 40 additions and 30 deletions

View File

@ -4304,7 +4304,15 @@ h3.available-themes {
} }
.available-theme h3 { .available-theme h3 {
margin: 15px 0 5px; margin: 15px 0 0;
}
.available-theme .theme-author {
line-height: 18px;
}
.available-theme .action-links {
margin-top: 10px;
} }
#current-theme { #current-theme {

View File

@ -197,10 +197,8 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
<img src='<?php echo esc_url( $theme->screenshot_url ); ?>' width='150' /> <img src='<?php echo esc_url( $theme->screenshot_url ); ?>' width='150' />
</a> </a>
<h3><?php <h3><?php echo $name; ?></h3>
/* translators: 1: theme name, 2: author name */ <div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
printf( __( '%1$s <span>by %2$s</span>' ), $name, $author );
?></h3>
<?php <?php
$this->install_theme_info( $theme ); $this->install_theme_info( $theme );

View File

@ -116,17 +116,17 @@ class WP_Themes_List_Table extends WP_List_Table {
function display_rows() { function display_rows() {
$themes = $this->items; $themes = $this->items;
foreach ( $themes as $theme ) { foreach ( $themes as $theme ):
echo '<div class="available-theme">'; ?><div class="available-theme"><?php
$template = $theme->get_template(); $template = $theme->get_template();
$stylesheet = $theme->get_stylesheet(); $stylesheet = $theme->get_stylesheet();
$title = $theme->display('Name'); $title = $theme->display('Name');
$version = $theme->display('Version'); $version = $theme->display('Version');
$author = $theme->display('Author'); $author = $theme->display('Author');
$activate_link = wp_nonce_url( "themes.php?action=activate&amp;template=" . urlencode( $template ) . "&amp;stylesheet=" . urlencode( $stylesheet ), 'switch-theme_' . $template ); $activate_link = wp_nonce_url( "themes.php?action=activate&amp;template=" . urlencode( $template ) . "&amp;stylesheet=" . urlencode( $stylesheet ), 'switch-theme_' . $template );
$preview_link = esc_url( add_query_arg( $preview_link = esc_url( add_query_arg(
array( 'preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true' ), array( 'preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true' ),
home_url( '/' ) ) ); home_url( '/' ) ) );
@ -154,13 +154,15 @@ class WP_Themes_List_Table extends WP_List_Table {
<img src="<?php echo esc_url( $screenshot ); ?>" alt="" /> <img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
<?php endif; ?> <?php endif; ?>
</a> </a>
<h3><?php <h3><?php echo $title; ?></h3>
/* translators: 1: theme title, 2: theme version, 3: theme author */ <div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
printf( __( '%1$s %2$s by %3$s' ), $title, $version, $author ) ; ?></h3> <div class="action-links">
<?php echo $actions; ?>
<span class='action-links'><?php echo $actions ?></span>
<span class="separator hide-if-no-js">| </span><a href="#" class="theme-detail hide-if-no-js" tabindex='4'><?php _e('Details') ?></a> <span class="separator hide-if-no-js">| </span><a href="#" class="theme-detail hide-if-no-js" tabindex='4'><?php _e('Details') ?></a>
</div>
<div class="themedetaildiv hide-if-js"> <div class="themedetaildiv hide-if-js">
<p><strong><?php _e('Version: '); ?></strong><?php echo $version; ?></p>
<p><?php echo $theme->display('Description'); ?></p> <p><?php echo $theme->display('Description'); ?></p>
<?php if ( current_user_can( 'edit_themes' ) && $theme->parent() ) : <?php if ( current_user_can( 'edit_themes' ) && $theme->parent() ) :
/* translators: 1: theme title, 2: template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?> /* translators: 1: theme title, 2: template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?>
@ -172,10 +174,12 @@ class WP_Themes_List_Table extends WP_List_Table {
$title, str_replace( WP_CONTENT_DIR, '', $theme->get_template_directory() ), str_replace( WP_CONTENT_DIR, '', $theme->get_stylesheet_directory() ) ); ?></p> $title, str_replace( WP_CONTENT_DIR, '', $theme->get_template_directory() ), str_replace( WP_CONTENT_DIR, '', $theme->get_stylesheet_directory() ) ); ?></p>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php theme_update_available( $theme ); ?> <?php theme_update_available( $theme ); ?>
</div> </div>
<?php <?php
} endforeach;
} }
function search_theme( $theme ) { function search_theme( $theme ) {