Making WordPress.org


Ignore:
Timestamp:
03/02/2016 02:54:02 PM (11 years ago)
Author:
ocean90
Message:

Translate: Enhance the contributors table on project pages of a locale.

See #1388.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/translate.wordpress.org/public_html/gp-templates-new/locale-project.php

    r2663 r2667  
    183183                <h3>Translation Contributors</h3>
    184184                <?php if ( $locale_contributors['contributors'] ) : ?>
    185                 <ul>
     185                <table class="locale-project-contributors-table">
     186                        <thead>
     187                                <th class="contributor-name">Contributor</th>
     188                                <th class="contributor-stats">Translations*</th>
     189                        </thead>
     190                        <tbody>
    186191                        <?php
    187192                        foreach ( $locale_contributors['contributors'] as $contributor ) {
    188193                                printf(
    189                                         '<li><a href="https://profiles.wordpress.org/%s/">%s %s</a></li>',
     194                                        '<tr>
     195                                                <td class="contributor-name">
     196                                                        <a href="https://profiles.wordpress.org/%s/">%s %s</a>
     197                                                        <span>Last Activity: %s ago</span>
     198                                                </td>
     199                                                <td class="contributor-stats">
     200                                                        <div class="total">
     201                                                                <span>Total</span>
     202                                                                <p>%s</p>
     203                                                        </div>
     204                                                        <div class="current">
     205                                                                <span>Translated</span>
     206                                                                <p>%s</p>
     207                                                        </div>
     208                                                        <div class="waiting">
     209                                                                <span>Suggested</span>
     210                                                                <p>%s</p>
     211                                                        </div>
     212                                                        <div class="fuzzy">
     213                                                                <span>Fuzzy</span>
     214                                                                <p>%s</p>
     215                                                        </div>
     216                                                <td>
     217                                        </tr>',
    190218                                        $contributor->nicename,
    191                                         get_avatar( $contributor->email, 30 ),
    192                                         $contributor->display_name ? $contributor->display_name : $contributor->nicename
     219                                        get_avatar( $contributor->email, 40 ),
     220                                        $contributor->display_name ? $contributor->display_name : $contributor->nicename,
     221                                        human_time_diff( strtotime(  $contributor->last_update ) ),
     222                                        number_format_i18n( $contributor->total_count ),
     223                                        number_format_i18n( $contributor->current_count ),
     224                                        number_format_i18n( $contributor->waiting_count ),
     225                                        number_format_i18n( $contributor->fuzzy_count )
    193226                                );
    194227                        }
    195228                        ?>
    196                 </ul>
     229                        </tbody>
     230                </table>
     231                <p class="stats-hint">* Data for the last 356 days.</p>
    197232                <?php else : ?>
    198233                        <p>None, be the first?</p>
    199234                <?php endif; ?>
    200235        </div>
    201         <div class="locale-project-contributors-group locale-project-contributors-editors">
    202                 <h3>Translation Editors</h3>
    203                 <?php if ( $locale_contributors['editors'] ) : ?>
    204                 <ul>
    205                         <?php
    206                         foreach ( $locale_contributors['editors'] as $editor ) {
    207                                 printf(
    208                                         '<li><a href="https://profiles.wordpress.org/%s/">%s %s</a></li>',
    209                                         $editor->nicename,
    210                                         get_avatar( $editor->email, 40 ),
    211                                         $editor->display_name ? $editor->display_name : $editor->nicename
    212                                 );
    213                         }
    214                         ?>
    215                 </ul>
    216                 <?php else : ?>
    217                         <p>None, be the first?</p>
    218                 <?php endif; ?>
    219         </div>
     236
     237        <?php if ( $locale_contributors['editors'] ) : ?>
     238                <div class="locale-project-contributors-group locale-project-contributors-editors">
     239                        <h3>Translation Editors</h3>
     240                        <ul>
     241                                <?php
     242                                foreach ( $locale_contributors['editors'] as $editor ) {
     243                                        printf(
     244                                                '<li><a href="https://profiles.wordpress.org/%s/">%s %s</a></li>',
     245                                                $editor->nicename,
     246                                                get_avatar( $editor->email, 50 ),
     247                                                $editor->display_name ? $editor->display_name : $editor->nicename
     248                                        );
     249                                }
     250                                ?>
     251                        </ul>
     252                </div>
     253        <?php endif; ?>
    220254</div>
    221255
Note: See TracChangeset for help on using the changeset viewer.