<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[2660] sites/trunk/translate.wordpress.org/public_html/gp-templates-new: Translate: Add filters to plugin's contributors page and display the WP locale of a language pack.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/2660">2660</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/2660","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>ocean90</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-03-01 20:10:20 +0000 (Tue, 01 Mar 2016)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Translate: Add filters to plugin's contributors page and display the WP locale of a language pack.

See <a href="http://meta.trac.wordpress.org/ticket/1388">#1388</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunktranslatewordpressorgpublic_htmlgptemplatesnewprojectswppluginscontributorsphp">sites/trunk/translate.wordpress.org/public_html/gp-templates-new/projects-wp-plugins-contributors.php</a></li>
<li><a href="#sitestrunktranslatewordpressorgpublic_htmlgptemplatesnewprojectswppluginslanguagepacksphp">sites/trunk/translate.wordpress.org/public_html/gp-templates-new/projects-wp-plugins-language-packs.php</a></li>
<li><a href="#sitestrunktranslatewordpressorgpublic_htmlgptemplatesnewstylecss">sites/trunk/translate.wordpress.org/public_html/gp-templates-new/style.css</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunktranslatewordpressorgpublic_htmlgptemplatesnewprojectswppluginscontributorsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/translate.wordpress.org/public_html/gp-templates-new/projects-wp-plugins-contributors.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/translate.wordpress.org/public_html/gp-templates-new/projects-wp-plugins-contributors.php     2016-03-01 19:59:36 UTC (rev 2659)
+++ sites/trunk/translate.wordpress.org/public_html/gp-templates-new/projects-wp-plugins-contributors.php       2016-03-01 20:10:20 UTC (rev 2660)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="project-sub-page">
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        <h3>Activity</h3>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <p>The graph shows the recent activity of your contributors. It's updated once per day.</p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <p>The graph shows the recent activity of your contributors. It&#8217;s updated once per day.</p>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        <div class="ct-chart ct-chart-contributors"></div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,10 +51,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">        <p>For each locale a plugin can have translation editors and contributors. If a locale has no editor yet then you should probably <a href="https://make.wordpress.org/polyglots/handbook/rosetta/theme-plugin-directories/#translating-themes-plugins">make a request</a>.</p>
</span><span class="cx" style="display: block; padding: 0 10px">        <?php
</span><span class="cx" style="display: block; padding: 0 10px">        if ( $contributors_by_locale ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                echo '<div class="contributors-list-search"><input type="search" placeholder="Filter teams&hellip;" id="contributors-list-search"></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         ?>
+               <div class="contributors-list-filter">
+                       <button type="button" class="button-link filter active" data-filter="all">All</button> |
+                       <button type="button" class="button-link filter" data-filter="has-editors">With Editors</button> |
+                       <button type="button" class="button-link filter" data-filter="no-editors">Without Editors</button>
+
+                       <input type="search" class="search" placeholder="Filter teams&hellip;" id="contributors-list-search">
+               </div>
+               <?php
</ins><span class="cx" style="display: block; padding: 0 10px">                 echo '<div id="contributors-list" class="contributors-list">';
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $contributors_by_locale as $locale_slug => $data ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        $locale = GP_Locales::by_slug( $locale_slug );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        $has_editors = ! empty ( $data['editors'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $editors_list = array();
</span><span class="cx" style="display: block; padding: 0 10px">                        foreach ( $data['editors'] as $editor ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,11 +92,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        printf(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                '<div class="contributors-list-box">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         '<div class="contributors-list-box%s">
</ins><span class="cx" style="display: block; padding: 0 10px">                                         <h4><span class="locale-name">%s<span> <span class="contributors-count">%s</span> <span class="locale-code">#%s</span></h4>
</span><span class="cx" style="display: block; padding: 0 10px">                                        <p><strong>Editors:</strong> %s</p>
</span><span class="cx" style="display: block; padding: 0 10px">                                        <p><strong>Contributors:</strong> %s</p>
</span><span class="cx" style="display: block; padding: 0 10px">                                </div>',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $has_editors ? ' has-editors' : ' no-editors',
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $locale->english_name,
</span><span class="cx" style="display: block; padding: 0 10px">                                sprintf( _n( '%s person', '%s persons', $data['count'] ), number_format_i18n( $data['count'] ) ),
</span><span class="cx" style="display: block; padding: 0 10px">                                $locale->wp_locale,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -127,6 +137,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }).show();
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px">        });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+       $( '.contributors-list-filter .filter' ).on( 'click', function() {
+               var $el = $( this ), filter = $el.data( 'filter' );
+
+               $el.siblings( '.active' ).removeClass( 'active' );
+               $el.addClass( 'active' );
+               $( '#contributors-list' ).attr( 'data-current-filter', filter );
+       });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> new Chartist.Line('.ct-chart-contributors', {
</span></span></pre></div>
<a id="sitestrunktranslatewordpressorgpublic_htmlgptemplatesnewprojectswppluginslanguagepacksphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/translate.wordpress.org/public_html/gp-templates-new/projects-wp-plugins-language-packs.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/translate.wordpress.org/public_html/gp-templates-new/projects-wp-plugins-language-packs.php   2016-03-01 19:59:36 UTC (rev 2659)
+++ sites/trunk/translate.wordpress.org/public_html/gp-templates-new/projects-wp-plugins-language-packs.php     2016-03-01 20:10:20 UTC (rev 2660)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -42,15 +42,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="project-sub-page">
</span><span class="cx" style="display: block; padding: 0 10px">        <h3>Language Packs</h3>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <p>Language packs are installed automatically if they are available. If no secent</p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <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>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        <?php
</span><span class="cx" style="display: block; padding: 0 10px">        if ( isset( $language_packs->translations ) && $language_packs->translations ) {
</span><span class="cx" style="display: block; padding: 0 10px">                echo '<ul class="language-packs-list">';
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $language_packs->translations as $language_pack ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        printf(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                '<li><strong>%s:</strong> Last updated %s for version %s (<a href="%s">zip</a>)</li>',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         '<li><strong>%s <span class="locale-code">(%s)</span>:</strong> Last updated %s for version %s (<a href="%s">zip</a>)</li>',
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $language_pack->english_name,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                $language_pack->language,
</ins><span class="cx" style="display: block; padding: 0 10px">                                 $language_pack->updated,
</span><span class="cx" style="display: block; padding: 0 10px">                                $language_pack->version,
</span><span class="cx" style="display: block; padding: 0 10px">                                $language_pack->package
</span></span></pre></div>
<a id="sitestrunktranslatewordpressorgpublic_htmlgptemplatesnewstylecss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/translate.wordpress.org/public_html/gp-templates-new/style.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/translate.wordpress.org/public_html/gp-templates-new/style.css        2016-03-01 19:59:36 UTC (rev 2659)
+++ sites/trunk/translate.wordpress.org/public_html/gp-templates-new/style.css  2016-03-01 20:10:20 UTC (rev 2660)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1087,6 +1087,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">        margin-left: -30px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.language-packs-list li strong .locale-code {
+       font-size: 11px;
+       color: #555d66;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .ct-chart-contributors {
</span><span class="cx" style="display: block; padding: 0 10px">        position: relative;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1211,13 +1216,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">        margin-bottom: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.contributors-list-search {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.contributors-list-filter {
</ins><span class="cx" style="display: block; padding: 0 10px">         margin: 15px 0 10px;
</span><span class="cx" style="display: block; padding: 0 10px">        text-align: right;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.contributors-list-search input {
-       margin: 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.contributors-list-filter .search {
+       margin: 0 0 0 10px;
</ins><span class="cx" style="display: block; padding: 0 10px">         padding: 2px 4px;
</span><span class="cx" style="display: block; padding: 0 10px">        width: 280px;
</span><span class="cx" style="display: block; padding: 0 10px">        font-size: 13px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1233,3 +1238,43 @@
</span><span class="cx" style="display: block; padding: 0 10px">        -webkit-appearance: textfield;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+@media (max-width: 600px) {
+       .contributors-list-filter {
+               text-align: center;
+       }
+
+       .contributors-list-filter .search {
+               display: block;
+               width: 100%;
+               margin: 10px 0;
+       }
+}
+
+/* Buttons that look like links, for a cross of good semantics with the visual */
+.button-link {
+       margin: 0;
+       padding: 0;
+       -webkit-box-shadow: none;
+       box-shadow: none;
+       border: 0;
+       -webkit-border-radius: 0;
+       border-radius: 0;
+       background: none;
+       outline: none;
+       cursor: pointer;
+       font: inherit;
+       color: #0074a2;
+}
+
+.button-link:hover {
+       color: #2ea2cc;
+}
+
+.contributors-list-filter .filter.active {
+       border-bottom: 1px solid #dfdfdf;
+}
+
+.contributors-list[data-current-filter="has-editors"] .no-editors,
+.contributors-list[data-current-filter="no-editors"] .has-editors {
+       display: none !important;
+}
</ins></span></pre>
</div>
</div>

</body>
</html>