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/themes.php

    r37297 r37714  
    146146add_thickbox();
    147147wp_enqueue_script( 'theme' );
     148wp_enqueue_script( 'updates' );
    148149wp_enqueue_script( 'customize-loader' );
    149150
     
    249250        <div class="theme-screenshot blank"></div>
    250251    <?php } ?>
     252
     253    <?php if ( $theme['hasUpdate'] ) : ?>
     254        <div class="update-message notice inline notice-warning notice-alt">
     255            <p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p>
     256        </div>
     257    <?php endif; ?>
     258
    251259    <span class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></span>
    252260    <div class="theme-author"><?php printf( __( 'By %s' ), $theme['author'] ); ?></div>
     
    277285
    278286    </div>
    279 
    280     <?php if ( $theme['hasUpdate'] ) { ?>
    281         <div class="theme-update"><?php _e( 'Update Available' ); ?></div>
    282     <?php } ?>
    283287</div>
    284288<?php endforeach; ?>
     
    369373        <div class="theme-screenshot blank"></div>
    370374    <# } #>
     375
     376    <# if ( data.hasUpdate ) { #>
     377        <div class="update-message notice inline notice-warning notice-alt"><p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p></div>
     378    <# } #>
     379
    371380    <span class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></span>
    372     <div class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.author }}}' ); ?></div>
     381    <div class="theme-author">
     382        <?php
     383        /* translators: %s: Theme author name */
     384        printf( __( 'By %s' ), '{{{ data.author }}}' );
     385        ?>
     386    </div>
    373387
    374388    <# if ( data.active ) { #>
    375389        <h2 class="theme-name" id="{{ data.id }}-name">
    376390            <?php
    377             /* translators: %s: theme name */
     391            /* translators: %s: Theme name */
    378392            printf( __( '<span>Active:</span> %s' ), '{{{ data.name }}}' );
    379393            ?>
     
    384398
    385399    <div class="theme-actions">
    386 
    387     <# if ( data.active ) { #>
    388         <# if ( data.actions.customize ) { #>
    389             <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a>
     400        <# if ( data.active ) { #>
     401            <# if ( data.actions.customize ) { #>
     402                <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a>
     403            <# } #>
     404        <# } else { #>
     405            <a class="button button-secondary activate" href="{{{ data.actions.activate }}}"><?php _e( 'Activate' ); ?></a>
     406            <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a>
    390407        <# } #>
    391     <# } else { #>
    392         <a class="button button-secondary activate" href="{{{ data.actions.activate }}}"><?php _e( 'Activate' ); ?></a>
    393         <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a>
    394     <# } #>
    395 
    396408    </div>
    397 
    398     <# if ( data.hasUpdate ) { #>
    399         <div class="theme-update"><?php _e( 'Update Available' ); ?></div>
    400     <# } #>
    401409</script>
    402410
     
    462470</script>
    463471
    464 <?php require( ABSPATH . 'wp-admin/admin-footer.php' );
     472<?php
     473wp_print_request_filesystem_credentials_modal();
     474wp_print_admin_notice_templates();
     475wp_print_update_row_templates();
     476
     477require( ABSPATH . 'wp-admin/admin-footer.php' );
Note: See TracChangeset for help on using the changeset viewer.