Making WordPress.org


Ignore:
Timestamp:
04/03/2022 03:31:24 PM (2 years ago)
Author:
ocean90
Message:

Translate: Improve projects overview.

  • Use proper grid layout to ensure same heights of boxes.
  • Use three columns on large screens.
  • Reduce icon size and description length since these don't require to be in the focus unlike in the relevant directories.
  • Keep current filters when changing search keywords.
  • Show pagination on top and bottom.

Fixes #5945.
Fixes #6249.
See #6246.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/locale-projects.php

    r11732 r11741  
    8686    <div class="search-form">
    8787        <form>
     88            <input type="hidden" name="filter" value="<?php echo esc_attr( $filter ?? '' ); ?>">
     89            <input type="hidden" name="without-editors" value="<?php echo esc_attr( $without_editors ? '1' : '' ); ?>">
    8890            <label class="screen-reader-text" for="projects-filter"><?php esc_attr_e( 'Search projects...' ); ?></label>
    89             <input placeholder="<?php esc_attr_e( 'Search projects...' ); ?>" type="search" id="projects-filter" name="s" value="<?php if ( !empty( $search ) ) { echo esc_attr( $search ); } ?>" class="filter-search">
     91            <input placeholder="<?php esc_attr_e( 'Search projects...' ); ?>" type="search" id="projects-filter" name="s" value="<?php echo esc_attr( $search ?? '' ); ?>" class="filter-search">
    9092            <input type="submit" value="<?php esc_attr_e( 'Search' ); ?>" class="screen-reader-text" />
    9193        </form>
     
    103105            $filter_count++;
    104106            ?>
    105             <input id="filter-without-editors" type="checkbox" name="without-editors" value="1"<?php checked( isset( $_GET['without-editors'] ) ); ?>>
     107            <input id="filter-without-editors" type="checkbox" name="without-editors" value="1"<?php checked( $without_editors ); ?>>
    106108            <label for="filter-without-editors">Limit to projects without editors</label>
    107109            <span class="filter-sep" aria-hidden="true">|</span>
     
    144146    </form>
    145147</div>
     148
     149<?php
     150if ( isset( $pages ) && $pages['pages'] > 1 ) {
     151    echo '<div class="projects-paging">';
     152    echo gp_pagination( $pages['page'], $pages['per_page'], $pages['results'] );
     153    echo '</div>';
     154}
     155?>
     156
    146157<div id="projects" class="projects">
    147158    <?php
     
    193204                <div class="project-name">
    194205                    <h4>
    195                         <?php echo gp_link_get( $project_url, $project_name ) ?>
     206                        <?php echo gp_link_get( $project_url, wp_trim_words( $project_name, 10 ) ); ?>
    196207                    </h4>
    197208                </div>
     
    200211                        $description = wp_strip_all_tags( $sub_project->description );
    201212                        $description = str_replace( array( 'WordPress.org Plugin Page', 'WordPress.org Theme Page' ), '', $description );
    202                         echo wp_trim_words( $description, 30 );
     213                        echo wp_trim_words( $description, 15 );
    203214                    ?></p>
    204215                </div>
     
    243254    ?>
    244255</div>
     256
    245257<?php
    246     if ( isset( $pages ) && $pages['pages'] > 1 ) {
    247         echo gp_pagination( $pages['page'], $pages['per_page'], $pages['results'] );
    248     }
     258if ( isset( $pages ) && $pages['pages'] > 1 ) {
     259    echo '<div class="projects-paging">';
     260    echo gp_pagination( $pages['page'], $pages['per_page'], $pages['results'] );
     261    echo '</div>';
     262}
    249263?>
    250264
Note: See TracChangeset for help on using the changeset viewer.