Make WordPress Core


Ignore:
Timestamp:
06/15/2016 04:36:07 PM (8 years ago)
Author:
obenland
Message:

Update/Install: Shiny Updates v2.

Gone are the days of isolation and feelings of "meh", brought on by The Bleak Screen of Sadness. For a shiny knight has arrived to usher our plugins and themes along their arduous journey of installation, updates, and the inevitable fate of ultimate deletion.

Props swissspidy, adamsilverstein, mapk, afragen, ocean90, ryelle, j-falk, michael-arestad, melchoyce, DrewAPicture, AdamSoucie, ethitter, pento, dd32, kraftbj, Ipstenu, jorbin, afercia, stephdau, paulwilde, jipmoors, khag7, svovaf, jipmoors, obenland.
Fixes #22029, #25828, #31002, #31529, #31530, #31773, #33637, #35032.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/theme-install.php

    r37488 r37714  
    5959
    6060wp_enqueue_script( 'theme' );
     61wp_enqueue_script( 'updates' );
    6162
    6263if ( $tab ) {
     
    235236    <# } #>
    236237    <span class="more-details"><?php _ex( 'Details &amp; Preview', 'theme' ); ?></span>
    237     <div class="theme-author"><?php printf( __( 'By %s' ), '{{ data.author }}' ); ?></div>
     238    <div class="theme-author">
     239        <?php
     240        /* translators: %s: Theme author name */
     241        printf( __( 'By %s' ), '{{ data.author }}' );
     242        ?>
     243    </div>
    238244    <h3 class="theme-name">{{ data.name }}</h3>
    239245
    240246    <div class="theme-actions">
    241         <a class="button button-primary" href="{{ data.install_url }}"><?php esc_html_e( 'Install' ); ?></a>
    242         <a class="button button-secondary preview install-theme-preview" href="#"><?php esc_html_e( 'Preview' ); ?></a>
     247        <# if ( data.installed ) { #>
     248            <# if ( data.activate_url ) { #>
     249                <a class="button button-primary activate" href="{{ data.activate_url }}"><?php esc_html_e( 'Activate' ); ?></a>
     250            <# } #>
     251            <# if ( data.customize_url ) { #>
     252                <a class="button button-secondary load-customize" href="{{ data.customize_url }}"><?php esc_html_e( 'Live Preview' ); ?></a>
     253            <# } else { #>
     254                <button class="button-secondary preview install-theme-preview"><?php esc_html_e( 'Preview' ); ?></button>
     255            <# } #>
     256        <# } else { #>
     257            <a class="button button-primary theme-install" data-slug="{{ data.id }}" href="{{ data.install_url }}"><?php esc_html_e( 'Install' ); ?></a>
     258            <button class="button-secondary preview install-theme-preview"><?php esc_html_e( 'Preview' ); ?></button>
     259        <# } #>
    243260    </div>
    244261
    245262    <# if ( data.installed ) { #>
    246         <div class="theme-installed"><?php _ex( 'Already Installed', 'theme' ); ?></div>
     263        <div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
    247264    <# } #>
    248265</script>
     
    251268    <div class="wp-full-overlay-sidebar">
    252269        <div class="wp-full-overlay-header">
    253             <a href="#" class="close-full-overlay"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></a>
    254             <a href="#" class="previous-theme"><span class="screen-reader-text"><?php _ex( 'Previous', 'Button label for a theme' ); ?></span></a>
    255             <a href="#" class="next-theme"><span class="screen-reader-text"><?php _ex( 'Next', 'Button label for a theme' ); ?></span></a>
    256         <# if ( data.installed ) { #>
    257             <a href="#" class="button button-primary theme-install disabled"><?php _ex( 'Installed', 'theme' ); ?></a>
    258         <# } else { #>
    259             <a href="{{ data.install_url }}" class="button button-primary theme-install"><?php _e( 'Install' ); ?></a>
    260         <# } #>
     270            <button class="close-full-overlay"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button>
     271            <button class="previous-theme"><span class="screen-reader-text"><?php _ex( 'Previous', 'Button label for a theme' ); ?></span></button>
     272            <button class="next-theme"><span class="screen-reader-text"><?php _ex( 'Next', 'Button label for a theme' ); ?></span></button>
     273            <# if ( data.installed ) { #>
     274                <a class="button button-primary activate" href="{{ data.activate_url }}"><?php esc_html_e( 'Activate' ); ?></a>
     275            <# } else { #>
     276                <a href="{{ data.install_url }}" class="button button-primary theme-install" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
     277            <# } #>
    261278        </div>
    262279        <div class="wp-full-overlay-sidebar-content">
    263280            <div class="install-theme-info">
    264281                <h3 class="theme-name">{{ data.name }}</h3>
    265                 <span class="theme-by"><?php printf( __( 'By %s' ), '{{ data.author }}' ); ?></span>
    266 
    267                 <img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" />
    268 
    269                 <div class="theme-details">
    270                     <# if ( data.rating ) { #>
    271                         <div class="theme-rating">
    272                             {{{ data.stars }}}
    273                             <span class="num-ratings" aria-hidden="true">({{ data.num_ratings }})</span>
     282                    <span class="theme-by">
     283                        <?php
     284                        /* translators: %s: Theme author name */
     285                        printf( __( 'By %s' ), '{{ data.author }}' );
     286                        ?>
     287                    </span>
     288
     289                    <img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" />
     290
     291                    <div class="theme-details">
     292                        <# if ( data.rating ) { #>
     293                            <div class="theme-rating">
     294                                {{{ data.stars }}}
     295                                <span class="num-ratings">({{ data.num_ratings }})</span>
     296                            </div>
     297                        <# } else { #>
     298                            <span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span>
     299                        <# } #>
     300                        <div class="theme-version">
     301                            <?php
     302                            /* translators: %s: Theme version */
     303                            printf( __( 'Version: %s' ), '{{ data.version }}' );
     304                            ?>
    274305                        </div>
    275                     <# } else { #>
    276                         <span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span>
    277                     <# } #>
    278                     <div class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></div>
    279                     <div class="theme-description">{{{ data.description }}}</div>
     306                        <div class="theme-description">{{{ data.description }}}</div>
     307                    </div>
    280308                </div>
    281309            </div>
    282         </div>
    283         <div class="wp-full-overlay-footer">
    284             <div class="devices">
    285                 <button type="button" class="preview-desktop active" aria-pressed="true" data-device="desktop"><span class="screen-reader-text"><?php _e( 'Enter desktop preview mode' ); ?></span></button>
    286                 <button type="button" class="preview-tablet" aria-pressed="false" data-device="tablet"><span class="screen-reader-text"><?php _e( 'Enter tablet preview mode' ); ?></span></button>
    287                 <button type="button" class="preview-mobile" aria-pressed="false" data-device="mobile"><span class="screen-reader-text"><?php _e( 'Enter mobile preview mode' ); ?></span></button>
     310            <div class="wp-full-overlay-footer">
     311                <button type="button" class="collapse-sidebar button-secondary" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
     312                    <span class="collapse-sidebar-arrow"></span>
     313                    <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
     314                </button>
    288315            </div>
    289             <button type="button" class="collapse-sidebar button-secondary" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
    290                 <span class="collapse-sidebar-arrow"></span>
    291                 <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
    292             </button>
    293         </div>
    294     </div>
    295     <div class="wp-full-overlay-main">
    296         <iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>" />
     316        </div>
     317        <div class="wp-full-overlay-main">
     318        <iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>"></iframe>
    297319    </div>
    298320</script>
    299321
    300322<?php
     323wp_print_request_filesystem_credentials_modal();
     324wp_print_admin_notice_templates();
     325
    301326include(ABSPATH . 'wp-admin/admin-footer.php');
Note: See TracChangeset for help on using the changeset viewer.