Changeset 1478
- Timestamp:
- 04/15/2015 09:19:21 AM (10 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php
r1477 r1478 81 81 <span class="four"></span> 82 82 <span class="five"></span> 83 <p class="description"><?php printf( __( '%s out of 5 stars.', 'wporg-themes' ), '<span itemprop="ratingValue">' . number_format_i18n( $theme->rating / 20, 1 ) . '</span>' ); ?></p>83 <p class="description"><?php printf( __( '%s out of 5 stars.', 'wporg-themes' ), '<span itemprop="ratingValue">' . number_format_i18n( round($theme->rating / 20 / 0.5)*0.5, 1 ) . '</span>' ); ?></p> 84 84 </div> 85 85 <?php else : ?> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php
r1477 r1478 75 75 <span class="four"></span> 76 76 <span class="five"></span> 77 <p class="description"><?php printf( __( '%s out of 5 stars.', 'wporg-themes' ), '<span itemprop="ratingValue">{{ ( data.rating / 20 ).toFixed( 1 )}}</span>' ); ?></p>77 <p class="description"><?php printf( __( '%s out of 5 stars.', 'wporg-themes' ), '<span itemprop="ratingValue">{{ Math.round( data.rating / 20 / 0.5 )*0.5 }}</span>' ); ?></p> 78 78 </div> 79 79 <# } else { #> … … 85 85 <# if ( data.ratings ) { #> 86 86 <ul> 87 <?php foreach ( range( 5, 1 ) as $stars ) : ?> 87 88 <li class="counter-container"> 88 <a href="//wordpress.org/support/view/theme-reviews/{{ data.id }}?filter= 5" title="<?php echo esc_attr( sprintf( __( 'Click to see reviews that provided a rating of %d stars', 'wporg-themes' ), 5) ); ?>">89 <span class="counter-label"><?php printf( _n( '%d star', '%d stars', 5, 'wporg-themes' ), 5); ?></span>89 <a href="//wordpress.org/support/view/theme-reviews/{{ data.id }}?filter=<?php echo $stars; ?>" title="<?php echo esc_attr( sprintf( __( 'Click to see reviews that provided a rating of %d stars', 'wporg-themes' ), $stars ) ); ?>"> 90 <span class="counter-label"><?php printf( _n( '%d star', '%d stars', $stars, 'wporg-themes' ), $stars ); ?></span> 90 91 <span class="counter-back"> 91 <span class="counter-bar" style="width: {{ 100 * data.ratings[ 5] / data.num_ratings }}%;"></span>92 <span class="counter-bar" style="width: {{ 100 * data.ratings[<?php echo $stars; ?>] / data.num_ratings }}%;"></span> 92 93 </span> 93 <span class="counter-count">{{ data.ratings[ 5] }}</span>94 <span class="counter-count">{{ data.ratings[<?php echo $stars; ?>] }}</span> 94 95 </a> 95 96 </li> 96 <li class="counter-container"> 97 <a href="//wordpress.org/support/view/theme-reviews/{{ data.id }}?filter=4" title="<?php echo esc_attr( sprintf( __( 'Click to see reviews that provided a rating of %d stars', 'wporg-themes' ), 4 ) ); ?>"> 98 <span class="counter-label"><?php printf( _n( '%d star', '%d stars', 4, 'wporg-themes' ), 4 ); ?></span> 99 <span class="counter-back"> 100 <span class="counter-bar" style="width: {{ 100 * data.ratings[4] / data.num_ratings }}%;"></span> 101 </span> 102 <span class="counter-count">{{ data.ratings[4] }}</span> 103 </a> 104 </li> 105 <li class="counter-container"> 106 <a href="//wordpress.org/support/view/theme-reviews/{{ data.id }}?filter=3" title="<?php echo esc_attr( sprintf( __( 'Click to see reviews that provided a rating of %d stars', 'wporg-themes' ), 3 ) ); ?>"> 107 <span class="counter-label"><?php printf( _n( '%d star', '%d stars', 3, 'wporg-themes' ), 3 ); ?></span> 108 <span class="counter-back"> 109 <span class="counter-bar" style="width: {{ 100 * data.ratings[3] / data.num_ratings }}%;"></span> 110 </span> 111 <span class="counter-count">{{ data.ratings[3] }}</span> 112 </a> 113 </li> 114 <li class="counter-container"> 115 <a href="//wordpress.org/support/view/theme-reviews/{{ data.id }}?filter=2" title="<?php echo esc_attr( sprintf( __( 'Click to see reviews that provided a rating of %d stars', 'wporg-themes' ), 2 ) ); ?>"> 116 <span class="counter-label"><?php printf( _n( '%d star', '%d stars', 2, 'wporg-themes' ), 2 ); ?></span> 117 <span class="counter-back"> 118 <span class="counter-bar" style="width: {{ 100 * data.ratings[2] / data.num_ratings }}%;"></span> 119 </span> 120 <span class="counter-count">{{ data.ratings[2] }}</span> 121 </a> 122 </li> 123 <li class="counter-container"> 124 <a href="//wordpress.org/support/view/theme-reviews/{{ data.id }}?filter=1" title="<?php esc_attr_e( 'Click to see reviews that provided a rating of 1 star', 'wporg-themes' ); ?>"> 125 <span class="counter-label"><?php printf( _n( '%d star', '%d stars', 1, 'wporg-themes' ), 1 ); ?></span> 126 <span class="counter-back"> 127 <span class="counter-bar" style="width: {{ 100 * data.ratings[1] / data.num_ratings }}%;"></span> 128 </span> 129 <span class="counter-count">{{ data.ratings[1] }}</span> 130 </a> 131 </li> 97 <?php endforeach; ?> 132 98 </ul> 133 99 <# } #>
Note: See TracChangeset
for help on using the changeset viewer.