Making WordPress.org


Ignore:
Timestamp:
09/18/2015 01:43:16 AM (9 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

File:
1 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;
Note: See TracChangeset for help on using the changeset viewer.