Changeset 8497 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/locale-project.php
- Timestamp:
- 03/24/2019 05:14:26 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/locale-project.php
r7480 r8497 207 207 <table class="locale-project-contributors-table"> 208 208 <thead> 209 <th class="contributor-name">Contributor</th> 210 <th class="contributor-stats">Translations*</th> 209 <tr> 210 <th class="contributor-name">Contributor</th> 211 <th class="contributor-stats">Translations</th> 212 </tr> 211 213 </thead> 212 214 <tbody> 213 215 <?php 214 216 foreach ( $locale_contributors['contributors'] as $contributor ) { 217 $detailed = ''; 218 219 if ( 'wp-plugins' === $project->path ) { 220 // Ensure consistent order of development and stable projects. 221 usort( $contributor->detailed, function( $a, $b ) { 222 return strnatcasecmp( $a->project->name, $b->project->name ); 223 } ); 224 } 225 226 foreach ( $contributor->detailed as $detail_project_id => $detail_data ) { 227 $detailed .= '<strong class="detailed__project-name">' . $detail_data->project->name . ':</strong>'; 228 229 if ( $detail_data->total_count > 0 ) { 230 $total_count = gp_link_get( 231 gp_url_project( 232 $detail_data->project->path, 233 gp_url_join( $locale->slug, $set_slug ), 234 [ 235 'filters[translated]' => 'yes', 236 'filters[status]' => 'current_or_waiting_or_fuzzy_or_untranslated', 237 'filters[user_login]' => $contributor->login, 238 ] 239 ), 240 number_format_i18n( $detail_data->total_count ) 241 ); 242 } else { 243 $total_count = number_format_i18n( $detail_data->total_count ); 244 } 245 246 if ( $detail_data->current_count > 0 ) { 247 $current_count = gp_link_get( 248 gp_url_project( 249 $detail_data->project->path, 250 gp_url_join( $locale->slug, $set_slug ), 251 [ 252 'filters[translated]' => 'yes', 253 'filters[status]' => 'current', 254 'filters[user_login]' => $contributor->login, 255 ] 256 ), 257 number_format_i18n( $detail_data->current_count ) 258 ); 259 } else { 260 $current_count = number_format_i18n( $detail_data->current_count ); 261 } 262 263 if ( $detail_data->waiting_count > 0 ) { 264 $waiting_count = gp_link_get( 265 gp_url_project( 266 $detail_data->project->path, 267 gp_url_join( $locale->slug, $set_slug ), 268 [ 269 'filters[translated]' => 'yes', 270 'filters[status]' => 'waiting', 271 'filters[user_login]' => $contributor->login, 272 ] 273 ), 274 number_format_i18n( $detail_data->waiting_count ) 275 ); 276 } else { 277 $waiting_count = number_format_i18n( $detail_data->waiting_count ); 278 } 279 280 if ( $detail_data->fuzzy_count > 0 ) { 281 $fuzzy_count = gp_link_get( 282 gp_url_project( 283 $detail_data->project->path, 284 gp_url_join( $locale->slug, $set_slug ), 285 [ 286 'filters[translated]' => 'yes', 287 'filters[status]' => 'fuzzy', 288 'filters[user_login]' => $contributor->login, 289 ] 290 ), 291 number_format_i18n( $detail_data->fuzzy_count ) 292 ); 293 } else { 294 $fuzzy_count = number_format_i18n( $detail_data->fuzzy_count ); 295 } 296 297 $detailed .= sprintf( 298 ' 299 <div class="total"> 300 <p>%s</p> 301 </div> 302 <div class="current"> 303 <p>%s</p> 304 </div> 305 <div class="waiting"> 306 <p>%s</p> 307 </div> 308 <div class="fuzzy"> 309 <p>%s</p> 310 </div> 311 ', 312 $total_count, 313 $current_count, 314 $waiting_count, 315 $fuzzy_count 316 ); 317 } 318 215 319 printf( 216 320 '<tr> … … 218 322 %s 219 323 <a href="https://profiles.wordpress.org/%s/">%s %s</a> 220 <span>Last Activity: %s ago</span>324 <span>Last translation submitted: %s ago</span> 221 325 </td> 222 326 <td class="contributor-stats"> … … 237 341 <p>%s</p> 238 342 </div> 239 <td> 343 <div class="detailed"> 344 <details> 345 <summary>Per project</summary> 346 %s 347 </details> 348 </div> 349 </td> 240 350 </tr>', 241 351 $contributor->is_editor ? '<span class="translation-editor">Editor</span>' : '', 242 352 $contributor->nicename, 243 353 get_avatar( $contributor->email, 40 ), 244 $contributor->display_name ? $contributor->display_name: $contributor->nicename,354 $contributor->display_name ?: $contributor->nicename, 245 355 human_time_diff( strtotime( $contributor->last_update ) ), 246 356 number_format_i18n( $contributor->total_count ), 247 357 number_format_i18n( $contributor->current_count ), 248 358 number_format_i18n( $contributor->waiting_count ), 249 number_format_i18n( $contributor->fuzzy_count ) 359 number_format_i18n( $contributor->fuzzy_count ), 360 $detailed 250 361 ); 251 362 } … … 253 364 </tbody> 254 365 </table> 255 <p class="stats-hint">* Data for the last 365 days.</p>256 366 <?php else : ?> 257 367 <p>None, be the first?</p> … … 272 382 $editor->nicename, 273 383 get_avatar( $editor->email, 40 ), 274 $editor->display_name ? $editor->display_name: $editor->nicename384 $editor->display_name ?: $editor->nicename 275 385 ); 276 386 }
Note: See TracChangeset
for help on using the changeset viewer.