Making WordPress.org

Changeset 2660


Ignore:
Timestamp:
03/01/2016 08:10:20 PM (9 years ago)
Author:
ocean90
Message:

Translate: Add filters to plugin's contributors page and display the WP locale of a language pack.

See #1388.

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

Legend:

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

    r2439 r2660  
    4444
    4545    <h3>Activity</h3>
    46     <p>The graph shows the recent activity of your contributors. It's updated once per day.</p>
     46    <p>The graph shows the recent activity of your contributors. It&#8217;s updated once per day.</p>
    4747
    4848    <div class="ct-chart ct-chart-contributors"></div>
     
    5252    <?php
    5353    if ( $contributors_by_locale ) {
    54         echo '<div class="contributors-list-search"><input type="search" placeholder="Filter teams&hellip;" id="contributors-list-search"></div>';
     54        ?>
     55        <div class="contributors-list-filter">
     56            <button type="button" class="button-link filter active" data-filter="all">All</button> |
     57            <button type="button" class="button-link filter" data-filter="has-editors">With Editors</button> |
     58            <button type="button" class="button-link filter" data-filter="no-editors">Without Editors</button>
     59
     60            <input type="search" class="search" placeholder="Filter teams&hellip;" id="contributors-list-search">
     61        </div>
     62        <?php
    5563        echo '<div id="contributors-list" class="contributors-list">';
    5664        foreach ( $contributors_by_locale as $locale_slug => $data ) {
    5765            $locale = GP_Locales::by_slug( $locale_slug );
     66            $has_editors = ! empty ( $data['editors'] );
    5867
    5968            $editors_list = array();
     
    8493
    8594            printf(
    86                 '<div class="contributors-list-box">
     95                '<div class="contributors-list-box%s">
    8796                    <h4><span class="locale-name">%s<span> <span class="contributors-count">%s</span> <span class="locale-code">#%s</span></h4>
    8897                    <p><strong>Editors:</strong> %s</p>
    8998                    <p><strong>Contributors:</strong> %s</p>
    9099                </div>',
     100                $has_editors ? ' has-editors' : ' no-editors',
    91101                $locale->english_name,
    92102                sprintf( _n( '%s person', '%s persons', $data['count'] ), number_format_i18n( $data['count'] ) ),
     
    127137            }).show();
    128138        }
     139    });
     140
     141    $( '.contributors-list-filter .filter' ).on( 'click', function() {
     142        var $el = $( this ), filter = $el.data( 'filter' );
     143
     144        $el.siblings( '.active' ).removeClass( 'active' );
     145        $el.addClass( 'active' );
     146        $( '#contributors-list' ).attr( 'data-current-filter', filter );
    129147    });
    130148});
  • sites/trunk/translate.wordpress.org/public_html/gp-templates-new/projects-wp-plugins-language-packs.php

    r2439 r2660  
    4343    <h3>Language Packs</h3>
    4444
    45     <p>Language packs are installed automatically if they are available. If no secent</p>
     45    <p>Language packs are installed automatically if they are available. Once a locale has reached the threshold for a package build it will be listed here. It also means that you don&#8217;t have to include this language in your plugin anymore.</p>
    4646
    4747    <?php
     
    5050        foreach ( $language_packs->translations as $language_pack ) {
    5151            printf(
    52                 '<li><strong>%s:</strong> Last updated %s for version %s (<a href="%s">zip</a>)</li>',
     52                '<li><strong>%s <span class="locale-code">(%s)</span>:</strong> Last updated %s for version %s (<a href="%s">zip</a>)</li>',
    5353                $language_pack->english_name,
     54                $language_pack->language,
    5455                $language_pack->updated,
    5556                $language_pack->version,
  • sites/trunk/translate.wordpress.org/public_html/gp-templates-new/style.css

    r2439 r2660  
    10881088}
    10891089
     1090.language-packs-list li strong .locale-code {
     1091    font-size: 11px;
     1092    color: #555d66;
     1093}
     1094
    10901095.ct-chart-contributors {
    10911096    position: relative;
     
    12121217}
    12131218
    1214 .contributors-list-search {
     1219.contributors-list-filter {
    12151220    margin: 15px 0 10px;
    12161221    text-align: right;
    12171222}
    12181223
    1219 .contributors-list-search input {
    1220     margin: 0;
     1224.contributors-list-filter .search {
     1225    margin: 0 0 0 10px;
    12211226    padding: 2px 4px;
    12221227    width: 280px;
     
    12341239}
    12351240
     1241@media (max-width: 600px) {
     1242    .contributors-list-filter {
     1243        text-align: center;
     1244    }
     1245
     1246    .contributors-list-filter .search {
     1247        display: block;
     1248        width: 100%;
     1249        margin: 10px 0;
     1250    }
     1251}
     1252
     1253/* Buttons that look like links, for a cross of good semantics with the visual */
     1254.button-link {
     1255    margin: 0;
     1256    padding: 0;
     1257    -webkit-box-shadow: none;
     1258    box-shadow: none;
     1259    border: 0;
     1260    -webkit-border-radius: 0;
     1261    border-radius: 0;
     1262    background: none;
     1263    outline: none;
     1264    cursor: pointer;
     1265    font: inherit;
     1266    color: #0074a2;
     1267}
     1268
     1269.button-link:hover {
     1270    color: #2ea2cc;
     1271}
     1272
     1273.contributors-list-filter .filter.active {
     1274    border-bottom: 1px solid #dfdfdf;
     1275}
     1276
     1277.contributors-list[data-current-filter="has-editors"] .no-editors,
     1278.contributors-list[data-current-filter="no-editors"] .has-editors {
     1279    display: none !important;
     1280}
Note: See TracChangeset for help on using the changeset viewer.