Ticket #34080: 34080.patch
| File 34080.patch, 6.3 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/css/themes.css
1154 1154 } 1155 1155 } 1156 1156 1157 .theme-details . star-rating {1158 margin: 15px 0 0;1157 .theme-details .theme-rating { 1158 line-height: 23px; 1159 1159 } 1160 1160 1161 .theme-details .star-rating span:before { 1162 color: #ffb900; 1163 content: "\f154"; 1164 display: inline-block; 1165 -webkit-font-smoothing: antialiased; 1166 font: normal 20px/1 dashicons; 1167 vertical-align: top; 1161 .theme-details .star-rating { 1162 display: inline; 1168 1163 } 1169 1164 1170 /* Half stars */ 1171 .star-rating.rating-10 span.one:before, 1172 .star-rating.rating-30 span.two:before, 1173 .star-rating.rating-50 span.three:before, 1174 .star-rating.rating-70 span.four:before, 1175 .star-rating.rating-90 span.five:before { 1176 content: "\f459"; 1165 .theme-details .num-ratings, 1166 .theme-details .no-rating { 1167 font-size: 11px; 1168 color: #999; 1177 1169 } 1178 1170 1179 /* Full stars */ 1180 .star-rating.rating-20 span.one:before, 1181 .star-rating.rating-30 span.one:before, 1182 .star-rating.rating-40 span.one:before, 1183 .star-rating.rating-40 span.two:before, 1184 .star-rating.rating-50 span.one:before, 1185 .star-rating.rating-50 span.two:before, 1186 .star-rating.rating-60 span.one:before, 1187 .star-rating.rating-60 span.two:before, 1188 .star-rating.rating-60 span.three:before, 1189 .star-rating.rating-70 span.one:before, 1190 .star-rating.rating-70 span.two:before, 1191 .star-rating.rating-70 span.three:before, 1192 .star-rating.rating-80 span.one:before, 1193 .star-rating.rating-80 span.two:before, 1194 .star-rating.rating-80 span.three:before, 1195 .star-rating.rating-80 span.four:before, 1196 .star-rating.rating-90 span.one:before, 1197 .star-rating.rating-90 span.two:before, 1198 .star-rating.rating-90 span.three:before, 1199 .star-rating.rating-90 span.four:before, 1200 .star-rating.rating-100 > span:before { 1201 content: "\f155"; 1202 } 1203 1204 .theme-details .star-rating .ratings { 1171 .theme-details .no-rating { 1205 1172 display: block; 1206 1173 line-height: 20px; 1207 color: #999;1208 1174 } 1209 1175 1210 1176 /*------------------------------------------------------------------------------ … … 1628 1594 } 1629 1595 1630 1596 .install-theme-info .theme-screenshot { 1631 margin -top: 15px;1597 margin: 15px 0; 1632 1598 width: 258px; 1633 1599 border: 1px solid #ccc; 1634 1600 } -
src/wp-admin/includes/ajax-actions.php
2797 2797 $theme->author = wp_kses( $theme->author, $themes_allowedtags ); 2798 2798 $theme->version = wp_kses( $theme->version, $themes_allowedtags ); 2799 2799 $theme->description = wp_kses( $theme->description, $themes_allowedtags ); 2800 $theme->num_ratings = sprintf( _n( '(based on %s rating)', '(based on %s ratings)', $theme->num_ratings ), number_format_i18n( $theme->num_ratings ) ); 2800 $theme->stars = wp_star_rating( array( 'rating' => $theme->rating, 'type' => 'percent', 'number' => $theme->num_ratings, 'echo' => false ) ); 2801 $theme->num_ratings = number_format_i18n( $theme->num_ratings ); 2801 2802 $theme->preview_url = set_url_scheme( $theme->preview_url ); 2802 2803 } 2803 2804 -
src/wp-admin/includes/template-functions.php
1949 1949 * number of ratings may also be displayed by passing the $number parameter. 1950 1950 * 1951 1951 * @since 3.8.0 1952 * @since 4.4.0 Introduced the `echo` parameter. 1953 * 1952 1954 * @param array $args { 1953 1955 * Optional. Array of star ratings arguments. 1954 1956 * … … 1957 1959 * @type string $type Format that the $rating is in. Valid values are 'rating' (default), 1958 1960 * or, 'percent'. Default 'rating'. 1959 1961 * @type int $number The number of ratings that makes up this rating. Default 0. 1962 * @type bool $echo Whether to echo the generated markup. False to return the markup instead 1963 * of echoing it. Default true. 1960 1964 * } 1961 1965 */ 1962 1966 function wp_star_rating( $args = array() ) { 1963 1967 $defaults = array( 1964 1968 'rating' => 0, 1965 'type' => 'rating',1969 'type' => 'rating', 1966 1970 'number' => 0, 1971 'echo' => true, 1967 1972 ); 1968 1973 $r = wp_parse_args( $args, $defaults ); 1969 1974 … … 1989 1994 $title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) ); 1990 1995 } 1991 1996 1992 echo '<div class="star-rating" title="' . esc_attr( $title ) . '">'; 1993 echo '<span class="screen-reader-text">' . $title . '</span>'; 1994 echo str_repeat( '<div class="star star-full"></div>', $full_stars ); 1995 echo str_repeat( '<div class="star star-half"></div>', $half_stars ); 1996 echo str_repeat( '<div class="star star-empty"></div>', $empty_stars); 1997 echo '</div>'; 1997 $output = '<div class="star-rating" title="' . esc_attr( $title ) . '">'; 1998 $output .= '<span class="screen-reader-text">' . $title . '</span>'; 1999 $output .= str_repeat( '<div class="star star-full"></div>', $full_stars ); 2000 $output .= str_repeat( '<div class="star star-half"></div>', $half_stars ); 2001 $output .= str_repeat( '<div class="star star-empty"></div>', $empty_stars ); 2002 $output .= '</div>'; 2003 2004 if ( $r['echo'] ) { 2005 echo $output; 2006 } 2007 2008 return $output; 1998 2009 } 1999 2010 2000 2011 /** -
src/wp-admin/theme-install.php
239 239 240 240 <div class="theme-details"> 241 241 <# if ( data.rating ) { #> 242 <div class=" star-rating rating-{{ Math.round( data.rating / 10 ) * 10 }}">243 <span class="one"></span><span class="two"></span><span class="three"></span><span class="four"></span><span class="five"></span>244 <s mall class="ratings">{{ data.num_ratings }}</small>242 <div class="theme-rating"> 243 {{{ data.stars }}} 244 <span class="num-ratings">({{ data.num_ratings }})</span> 245 245 </div> 246 246 <# } else { #> 247 <div class="star-rating"> 248 <small class="ratings"><?php _e( 'This theme has not been rated yet.' ); ?></small> 249 </div> 247 <span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span> 250 248 <# } #> 251 249 <div class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></div> 252 250 <div class="theme-description">{{{ data.description }}}</div>
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)