Making WordPress.org


Ignore:
Timestamp:
11/10/2015 11:49:53 PM (9 years ago)
Author:
obenland
Message:

Translate: Dynamic table headings for small screens.

Uses the same information for all screen sizes now, which also allows for table
headings to be translated. Makes the cursor a pointer on column headings to
make it a little more obvious they are sortable.

Fixes #1365.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/translate.wordpress.org/public_html/gp-templates/projects-wp-plugins.php

    r2069 r2070  
    11<?php
    22$edit_link = gp_link_project_edit_get( $project, __( '(edit)' ) );
     3$table_headings = array(
     4    'locale'        => __( 'Locale' ),
     5    'dev'           => __( 'Development' ),
     6    'dev-readme'    => __( 'Development Readme' ),
     7    'stable'        => __( 'Stable' ),
     8    'stable-readme' => __( 'Stable Readme' ),
     9    'waiting'       => __( 'Waiting' ),
     10);
    311
    412gp_title( sprintf( __( '%s &lt; GlotPress' ), esc_html( $project->name ) ) );
     
    3139        <thead>
    3240            <tr>
    33                 <th class="title"><?php _e( 'Locale' ); ?></th>
    34                 <th class="title"><?php _e( 'Development' ); ?></th>
    35                 <th class="title"><?php _e( 'Development Readme' ); ?></th>
    36                 <th class="title"><?php _e( 'Stable' ); ?></th>
    37                 <th class="title"><?php _e( 'Stable Readme' ); ?></th>
    38                 <th class="title"><?php _e( 'Waiting' ); ?></th>
     41                <?php foreach ( $table_headings as $heading ) : ?>
     42                <th class="title"><?php echo $heading; ?></th>
     43                <?php endforeach; ?>
    3944            </tr>
    4045        </thead>
     
    8792                                    endif;
    8893
    89                                     echo '<td data-sort-value="' . esc_attr( $percent ) . '" class="percent' . $percent_class .'">'. gp_link_get( $link_url, $link_text ) . '</td>';
     94                                    echo '<td data-column-title="' . esc_attr( $table_headings[ $subproject_slug ] ) . '" data-sort-value="' . esc_attr( $percent ) . '" class="percent' . $percent_class .'">'. gp_link_get( $link_url, $link_text ) . '</td>';
    9095                                else :
    91                                     echo '<td class="none" data-sort-value="-1">&mdash;</td>';
     96                                    echo '<td class="none" data-column-title="" data-sort-value="-1">&mdash;</td>';
    9297                                endif;
    9398                            endforeach;
Note: See TracChangeset for help on using the changeset viewer.