- Timestamp:
- 09/18/2015 08:09:58 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/translate.wordpress.org/public_html/gp-templates/stats-overview.php
r1886 r1895 1 1 <?php 2 2 gp_title( __( 'Translation status overview < GlotPress' ) ); 3 wp_enqueue_script( 'tablesorter' ); 3 4 4 5 $breadcrumb = array(); … … 8 9 gp_tmpl_header(); 9 10 10 11 11 ?> 12 12 <div class="stats-table"> 13 <table class="table">13 <table id="stats-table" class="table"> 14 14 <thead> 15 15 <tr> … … 41 41 <th title="<?php echo esc_attr( $gp_locale->english_name ); ?>"> 42 42 <a href="<?php echo gp_url_join( 'locale', $gp_locale->slug, $set_slug ); ?>"> 43 <?php echo esc_html( $gp_locale->wp_locale ); ?> 43 <?php echo esc_html( $gp_locale->wp_locale ); ?> 44 44 </a> 45 45 </th> … … 59 59 } 60 60 $percent_class = 'percent' . $percent_class; 61 echo '<td class="' . $percent_class .'"><a href="' . $projecturl . '">' . number_format( $percent ) . '</a></td>';61 echo '<td data-sort-value="'. esc_attr( $percent ) . '" class="' . $percent_class .'"><a href="' . $projecturl . '">' . number_format( $percent ) . '</a></td>'; 62 62 } else { 63 63 $percent_class = 'percent' . (int) ( $percent / 10 ) * 10; 64 echo '<td class="' . $percent_class .'"><a href="' . $projecturl . '">' . $percent . '%</a></td>';64 echo '<td data-sort-value="' . esc_attr( $percent ) . '" class="' . $percent_class .'"><a href="' . $projecturl . '">' . $percent . '%</a></td>'; 65 65 } 66 66 67 67 } else { 68 echo '<td class="none" >—</td>';68 echo '<td class="none" data-sort-value="-1">—</td>'; 69 69 } 70 71 72 70 } 73 71 ?> … … 76 74 </tbody> 77 75 </table> 78 79 76 </div> 80 77 78 <script type="text/javascript"> 79 jQuery( document ).ready( function( $ ) { 80 $( '#stats-table' ).tablesorter( { 81 textExtraction: function( node ) { 82 var cellValue = $( node ).text(), 83 sortValue = $( node ).data( 'sortValue' ); 84 85 return ( undefined !== sortValue ) ? sortValue : cellValue; 86 } 87 }); 88 }); 89 </script> 81 90 <?php 82 91 gp_tmpl_footer();
Note: See TracChangeset
for help on using the changeset viewer.