Making WordPress.org

Changeset 1886


Ignore:
Timestamp:
09/18/2015 01:43:16 AM (10 years ago)
Author:
dd32
Message:

Translate: Stats overview: Add colour coding to the waiting column (100% = 0 string, 0% = 500 strings or more), expand the size of the table to fit the extra 2 columns.

Props Sam for styles!
See #1202

Location:
sites/trunk/translate.wordpress.org/public_html/gp-templates
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/translate.wordpress.org/public_html/gp-templates/stats-overview.php

    r1885 r1886  
    5151                            $percent = $translation_locale_statuses[ $locale_slug ][ $project->path ];
    5252
    53                             if ( 'waiting' === $project->path  ) {
    54                                 echo '<td><a href="' . $projecturl . '">' . number_format( $percent ) . '</a></td>';
     53                            if ( 'waiting' === $project->path ) {
     54                                // Color code it on -0~500 waiting strings
     55                                $percent_class = 100-min( (int) ( $percent / 50 ) * 10, 100 );
     56                                // It's only 100 if it has 0 strings.
     57                                if ( 100 == $percent_class && $percent ) {
     58                                    $percent_class = 90;
     59                                }
     60                                $percent_class = 'percent' . $percent_class;
     61                                echo '<td class="' . $percent_class .'"><a href="' . $projecturl . '">' . number_format( $percent ) . '</a></td>';
    5562                            } else {
    5663                                $percent_class = 'percent' . (int) ( $percent / 10 ) * 10;
  • sites/trunk/translate.wordpress.org/public_html/gp-templates/style.css

    r1859 r1886  
    871871
    872872.stats-table table.table {
    873     width: 620px;
     873    width: 740px;
    874874    text-align: center;
    875875    border-collapse: collapse;
Note: See TracChangeset for help on using the changeset viewer.