WordPress.org

Making WordPress.org


Ignore:
Timestamp:
12/11/2014 07:39:05 PM (7 years ago)
Author:
obenland
Message:

WP.org Themes: Revamped modal layout and responsive styles.

See https://wordpress.slack.com/archives/meta/p1418066438000006
See #745.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php

    r1021 r1034  
    1313
    1414include ABSPATH . 'wp-admin/includes/theme.php';
    15 $themes = themes_api( 'query_themes', array(
     15
     16$args = array(
    1617    'per_page' => 15,
    17     'browse'   => get_query_var( 'attachment' ) ? get_query_var( 'attachment' ) : 'featured',
    18     'fields'   => 'tags',
    19 ) );
     18    'fields'   => array_merge( $GLOBALS['theme_field_defaults'], array(
     19        'parent'   => true,
     20    ) ),
     21);
     22
     23if ( get_query_var( 'tag' ) ) {
     24    $args['tag'][] = get_query_var( 'tag' );
     25} else {
     26    $args['browse'] = get_query_var( 'attachment' ) ? get_query_var( 'attachment' ) : 'featured';
     27}
     28$themes = themes_api( 'query_themes', $args );
    2029
    2130get_header();
    2231?>
    2332
    24 <div id="themes" class="wrap">
    25     <div class="wp-filter">
    26         <div class="filter-count">
    27             <span class="count theme-count"><?php echo count( $themes->themes ); ?></span>
    28         </div>
    29 
    30         <ul class="filter-links">
    31             <li><a href="#" data-sort="featured"><?php _ex( 'Featured', 'themes' ); ?></a></li>
    32             <li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
    33             <li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
    34         </ul>
    35 
    36         <a class="drawer-toggle" href="#"><?php _e( 'Feature Filter' ); ?></a>
    37 
    38         <div class="search-form"></div>
    39 
    40         <div class="filter-drawer">
    41             <div class="buttons">
    42                 <a class="apply-filters button button-secondary" href="#"><?php _e( 'Apply Filters' ); ?><span></span></a>
    43                 <a class="clear-filters button button-secondary" href="#"><?php _e( 'Clear' ); ?></a>
     33    <div id="themes" class="wrap">
     34        <div class="wp-filter">
     35            <div class="filter-count">
     36                <span class="count theme-count"><?php echo count( $themes->themes ); ?></span>
    4437            </div>
    4538
    46             <?php foreach ( get_theme_feature_list() as $feature_name => $features ) : ?>
    47             <div class="filter-group">
    48                 <h4><?php echo esc_html( $feature_name ); ?></h4>
    49                 <ol class="feature-group">
    50                     <?php foreach ( $features as $feature => $feature_name ) : ?>
    51                     <li>
    52                         <input type="checkbox" id="filter-id-<?php echo esc_attr( $feature ); ?>" value="<?php echo esc_attr( $feature ); ?>" />
    53                         <label for="filter-id-<?php echo esc_attr( $feature ); ?>"><?php echo esc_html( $feature_name ); ?></label>
    54                     </li>
    55                     <?php endforeach; ?>
    56                 </ol>
     39            <ul class="filter-links">
     40                <li><a href="/browse/featured/" data-sort="featured"><?php _ex( 'Featured', 'themes' ); ?></a></li>
     41                <li><a href="/browse/popular/" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
     42                <li><a href="/browse/new/" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
     43            </ul>
     44
     45            <a class="drawer-toggle" href="#"><?php _e( 'Feature Filter' ); ?></a>
     46
     47            <div class="search-form"></div>
     48
     49            <div class="filter-drawer">
     50                <div class="buttons">
     51                    <a class="apply-filters button button-secondary" href="#"><?php _e( 'Apply Filters' ); ?><span></span></a>
     52                    <a class="clear-filters button button-secondary" href="#"><?php _e( 'Clear' ); ?></a>
     53                </div>
     54
     55                <div class="filtered-by">
     56                    <span><?php _e( 'Filtering by:' ); ?></span>
     57                    <div class="tags"></div>
     58                    <a href="#"><?php _e( 'Edit' ); ?></a>
     59                </div>
     60
     61                <?php foreach( get_theme_feature_list() as $feature_name => $features ) : ?>
     62                <div class="filter-group">
     63                    <h4><?php echo esc_html( $feature_name ); ?></h4>
     64                    <ol class="feature-group">
     65                        <?php foreach ( $features as $feature => $feature_name ) : ?>
     66                        <li>
     67                            <input type="checkbox" id="filter-id-<?php echo esc_attr( $feature ); ?>" value="<?php echo esc_attr( $feature ); ?>" />
     68                            <label for="filter-id-<?php echo esc_attr( $feature ); ?>"><?php echo esc_html( $feature_name ); ?></label>
     69                        </li>
     70                        <?php endforeach; ?>
     71                    </ol>
     72                </div>
     73                <?php endforeach; ?>
    5774            </div>
    58             <?php endforeach; ?>
     75        </div><!-- .wp-filter -->
    5976
    60             <div class="filtered-by">
    61                 <span><?php _e( 'Filtering by:' ); ?></span>
    62                 <div class="tags"></div>
    63                 <a href="#"><?php _e( 'Edit' ); ?></a>
    64             </div>
    65         </div>
    66     </div><!-- .wp-filter -->
    67 
    68     <div class="theme-browser content-filterable">
    69         <div class="themes">
    70             <?php
     77        <div class="theme-browser content-filterable">
     78            <div class="themes">
     79                <?php
    7180                if ( ! is_wp_error( $themes ) ) :
    7281                    foreach ( $themes->themes as $theme ) :
     
    7483                    endforeach;
    7584                endif;
    76             ?>
     85                ?>
     86            </div>
    7787        </div>
     88        <div class="theme-install-overlay"></div>
     89        <div class="theme-overlay"></div>
     90
     91        <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
     92        <span class="spinner"></span>
    7893    </div>
    79     <div class="theme-install-overlay"></div>
    80     <div class="theme-overlay"></div>
    81 
    82     <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
    83     <span class="spinner"></span>
    84 </div>
    8594
    8695<?php
Note: See TracChangeset for help on using the changeset viewer.