Changeset 9615
- Timestamp:
- 03/22/2020 11:21:55 AM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/consistency.php
r6570 r9615 82 82 foreach ( $translations_unique as $translation ) { 83 83 printf( 84 '<li>%s <small>(%s)</small> <a href="#%s">↓</a></li>',84 '<li>%s <small>(%s)</small> <a class="anchor-jumper with-tooltip" aria-label="Go to translation" href="#%s">↓</a></li>', 85 85 str_replace( ' ', '<span class="space"> </span>', esc_translation( $translation ) ), 86 86 1 === $translations_unique_counts[ $translation ] ? $translations_unique_counts[ $translation ] . ' time' : $translations_unique_counts[ $translation ] . ' times', … … 100 100 <tbody> 101 101 <?php 102 $previous_translation = '';103 102 $previous_translation = ''; 103 $translations_unique_index = 0; 104 104 foreach ( $results as $result ) { 105 105 $project_name = $result->project_name; … … 120 120 121 121 if ( $has_different_translations && $previous_translation !== $result->translation ) { 122 $prev_arrow = ''; 123 $next_arrow = ''; 124 125 126 if ( 0 === $translations_unique_index ) { 127 $next_arrow = '<a class="anchor-jumper with-tooltip" aria-label="Go to next translation" href="' . esc_attr( '#t-' . md5( $translations_unique[ $translations_unique_index + 1 ] ) ) . '">↓</a>'; 128 } elseif ( $translations_unique_count - 1 === $translations_unique_index ) { 129 $prev_arrow = '<a class="anchor-jumper with-tooltip" aria-label="Go to previous translation" href="' . esc_attr( '#t-' . md5( $translations_unique[ $translations_unique_index - 1 ] ) ) . '">↑</a>'; 130 } else { 131 $prev_arrow = '<a class="anchor-jumper with-tooltip" aria-label="Go to previous translation" href="' . esc_attr( '#t-' . md5( $translations_unique[ $translations_unique_index - 1 ] ) ) . '">↑</a>'; 132 $next_arrow = '<a class="anchor-jumper with-tooltip" aria-label="Go to next translation" href="' . esc_attr( '#t-' . md5( $translations_unique[ $translations_unique_index + 1 ] ) ) . '">↓</a>'; 133 } 134 135 printf( 136 '<tr id="%s" class="new-translation"><th colspan="2"><strong>%s</strong> %s %s</th></tr>', 137 esc_attr( 't-' . md5( $result->translation ) ), 138 esc_translation( $result->translation ), 139 $next_arrow, 140 $prev_arrow 141 ); 142 122 143 $previous_translation = $result->translation; 123 printf( 124 '<tr id="%s" class="new-translation"><td colspan="2"><strong>%s</strong> <a href="#translations-overview">↑</a></td></tr>', 125 esc_attr( 't-' . md5( $result->translation ) ), 126 esc_translation( $result->translation ) 127 ); 144 $translations_unique_index++; 128 145 } 129 146 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css
r9558 r9615 2027 2027 2028 2028 .consistency-table tr.new-translation { 2029 border-bottom-width: 3px;2029 border-bottom-width: 0; 2030 2030 } 2031 2031 … … 2035 2035 } 2036 2036 2037 .consistency-table tr.new-translation td { 2038 padding: 40px 0 10px; 2037 .consistency-table tr.new-translation th { 2038 position: sticky; 2039 top: 0; 2040 padding: 20px 0 10px; 2041 background: #fff; 2042 text-align: left; 2043 box-shadow: 0 -1px 0 #e2e4e7, 0 3px 0 #e2e4e7; 2044 } 2045 2046 @media screen and (min-width: 600px) { 2047 .consistency-table tr.new-translation th { 2048 top: 46px; 2049 } 2050 } 2051 2052 @media screen and (min-width: 783px) { 2053 .consistency-table tr.new-translation th { 2054 top: 32px; 2055 } 2056 } 2057 2058 .anchor-jumper { 2059 padding: 0 5px; 2060 font-weight: 600; 2061 } 2062 2063 .consistency-table tr.new-translation th .anchor-jumper { 2064 float: right; 2039 2065 } 2040 2066 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-consistency.php
r6570 r9615 73 73 ] ); 74 74 75 $translations = wp_list_pluck( $results, 'translation', 'translation_id' );76 $translations_unique = array_unique( $translations);75 $translations = wp_list_pluck( $results, 'translation', 'translation_id' ); 76 $translations_unique = array_values( array_unique( $translations ) ); 77 77 $translations_unique_counts = array_count_values( $translations ); 78 78 }
Note: See TracChangeset
for help on using the changeset viewer.