WordPress.org

Making WordPress.org

Changeset 2070


Ignore:
Timestamp:
11/10/2015 11:49:53 PM (4 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.

Location:
sites/trunk/translate.wordpress.org/public_html/gp-templates
Files:
3 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;
  • sites/trunk/translate.wordpress.org/public_html/gp-templates/stats-overview.php

    r2056 r2070  
    4747                    foreach ( $projects as $slug => $project ) {
    4848                        $projecturl = gp_url( gp_url_join( 'locale', $gp_locale->slug, $set_slug, $project->path ) );
     49                        $project_name = str_replace( array( 'WordPress.org ', 'WordPress for ', 'WordPress ', 'ectory' ), '', $project->name );
    4950
    5051                        if ( isset( $translation_locale_statuses[ $locale_slug ][ $project->path ] ) ) {
     
    5960                                }
    6061                                $percent_class = 'percent' . $percent_class;
    61                                 echo '<td data-sort-value="'. esc_attr( $percent ) . '" class="' . $percent_class .'"><a href="' . $projecturl . '">' . number_format( $percent ) . '</a></td>';
     62                                echo '<td data-column-title="' . esc_attr( $project_name ) . '" data-sort-value="'. esc_attr( $percent ) . '" class="' . $percent_class .'"><a href="' . $projecturl . '">' . number_format( $percent ) . '</a></td>';
    6263                            } else {
    6364                                $percent_class = 'percent' . (int) ( $percent / 10 ) * 10;
    64                                 echo '<td data-sort-value="' . esc_attr( $percent ) . '" class="' . $percent_class .'"><a href="' . $projecturl . '">' . $percent . '%</a></td>';
     65                                echo '<td data-column-title="' . esc_attr( $project_name ) . '" data-sort-value="' . esc_attr( $percent ) . '" class="' . $percent_class .'"><a href="' . $projecturl . '">' . $percent . '%</a></td>';
    6566                            }
    6667
    6768                        } else {
    68                             echo '<td class="none" data-sort-value="-1">&mdash;</td>';
     69                            echo '<td class="none" data-column-title="" data-sort-value="-1">&mdash;</td>';
    6970                        }
    7071                    }
  • sites/trunk/translate.wordpress.org/public_html/gp-templates/style.css

    r1937 r2070  
    904904    }
    905905
    906     .stats-table table tbody td:nth-of-type(1):before { content: "4.2.x"; }
    907     .stats-table table tbody td:nth-of-type(2):before { content: "4.3.x"; }
    908     .stats-table table tbody td:nth-of-type(3):before { content: "Rosetta"; }
    909     .stats-table table tbody td:nth-of-type(4):before { content: "Browse Happy"; }
    910     .stats-table table tbody td:nth-of-type(5):before { content: "Theme Dir"; }
    911     .stats-table table tbody td:nth-of-type(6):before { content: "Plugin Dir"; }
    912     .stats-table table tbody td:nth-of-type(7):before { content: "Forums"; }
    913     .stats-table table tbody td:nth-of-type(8):before { content: "Android"; }
    914     .stats-table table tbody td:nth-of-type(9):before { content: "iOS"; }
    915     .stats-table table tbody td:nth-of-type(10):before { content: "Waiting"; }
     906    .stats-table td:before {
     907        content: attr(data-column-title);
     908    }
    916909}
    917910
     
    933926}
    934927.stats-table table thead th {
     928    cursor: pointer;
    935929    margin: 0;
    936930    margin-right: 0px;
Note: See TracChangeset for help on using the changeset viewer.