Changeset 1489 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/theme-single.php
- Timestamp:
- 04/20/2015 02:17:13 AM (9 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/theme-single.php
r1483 r1489 1 < script id="tmpl-theme-single" type="text/template">1 <div> 2 2 <div class="theme-navigation"> 3 < button class="close"><?php _e( 'Return to Themes List', 'wporg-themes' ); ?></button>3 <a class="close" href="<?php echo home_url('/'); ?>"><?php _e( 'Return to Themes List', 'wporg-themes' ); ?></a> 4 4 <div class="navigation post-navigation"> 5 <button class="left dashicons dashicons-no "><span class="screen-reader-text"><?php _e( 'Show previous theme', 'wporg-themes' ); ?></span></button>6 <button class="right dashicons dashicons-no "><span class="screen-reader-text"><?php _e( 'Show next theme', 'wporg-themes' ); ?></span></button>5 <button class="left dashicons dashicons-no disabled"><span class="screen-reader-text"><?php _e( 'Show previous theme', 'wporg-themes' ); ?></span></button> 6 <button class="right dashicons dashicons-no disabled"><span class="screen-reader-text"><?php _e( 'Show next theme', 'wporg-themes' ); ?></span></button> 7 7 </div> 8 8 </div> 9 9 <div class="theme-wrap"> 10 10 <div class="theme-about hentry" itemscope itemtype="http://schema.org/CreativeWork"> 11 < # if ( data.is_outdated ) { #>11 <?php if ( time() - strtotime( $theme->last_updated ) > 2 * YEAR_IN_SECONDS ) { ?> 12 12 <div class="theme-notice notice notice-warning"> 13 13 <p><?php _e( 'This theme <strong>hasn’t been updated in over 2 years</strong>. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.', 'wporg-themes' ); ?></p> 14 14 </div><!-- .theme-notice --> 15 < # } #>15 <?php } ?> 16 16 17 17 <div> 18 <h3 class="theme-name entry-title" itemprop="name"> {{{ data.name }}}</h3>19 <h4 class="theme-author"><?php printf( _x( 'By %s', 'theme author', 'wporg-themes' ), '<a href="https://wordpress.org/themes/author/ {{ data.author.user_nicename }}/"><span class="author" itemprop="author">{{{ data.author.display_name }}}</span></a>' ); ?></h4>18 <h3 class="theme-name entry-title" itemprop="name"><?php echo esc_html( $theme->name ); ?></h3> 19 <h4 class="theme-author"><?php printf( _x( 'By %s', 'theme author', 'wporg-themes' ), '<a href="https://wordpress.org/themes/author/' . $theme->author->user_nicename . '/"><span class="author" itemprop="author">' . esc_html( $theme->author->display_name ) . '</span></a>' ); ?></h4> 20 20 </div> 21 21 22 22 <div class="theme-head"> 23 23 <div class="theme-actions clear"> 24 <a href=" {{{ data.preview_url }}}" class="button button-secondary alignleft"><?php _e( 'Preview', 'wporg-themes' ); ?></a>25 <a href=" //downloads.wordpress.org/theme/{{ data.slug }}.{{ data.version }}.zip" class="button button-primary alignright"><?php _e( 'Download', 'wporg-themes' ); ?></a>24 <a href="<?php echo esc_url( $theme->preview_url ); ?>" class="button button-secondary alignleft"><?php _e( 'Preview', 'wporg-themes' ); ?></a> 25 <a href="<?php echo esc_url( $theme->download_link); ?>" class="button button-primary alignright"><?php _e( 'Download', 'wporg-themes' ); ?></a> 26 26 </div> 27 27 28 < # if ( data.parent ) { #>28 <?php if ( !empty( $theme->parent ) ) { ?> 29 29 <div class="theme-notice notice notice-info"> 30 <p class="parent"><?php printf( __( 'This is a child theme of %s.', 'wporg-themes' ), sprintf( '<a href=" /themes/%1$s/">%2$s</a>', '{{{ data.parent.slug }}}', '{{{ data.parent.name }}}') ); ?></p>30 <p class="parent"><?php printf( __( 'This is a child theme of %s.', 'wporg-themes' ), sprintf( '<a href="%1$s">%2$s</a>', home_url( $theme->parent['slug'] . '/' ), esc_html( $theme->parent['name'] ) ) ); ?></p> 31 31 </div> 32 < # } #>32 <?php } ?> 33 33 34 34 <div class="theme-meta-info"> 35 <p class="updated"><?php printf( __( 'Last updated: %s', 'wporg-themes' ), '<strong> {{ data.last_updated }}</strong>' ); ?></p>36 < # if ( data.theme_url ) { #>37 <a href=" {{ data.theme_url }}"><?php _e( 'Theme Homepage', 'wporg-themes' ); ?></a>38 < # } #>35 <p class="updated"><?php printf( __( 'Last updated: %s', 'wporg-themes' ), '<strong>' . date_i18n( 'F j, Y', strtotime( $theme->last_updated ) ) . '</strong>' ); ?></p> 36 <?php if ( $theme->theme_url ) { ?> 37 <a href="<?php echo esc_url( $theme->theme_url ); ?>"><?php _e( 'Theme Homepage', 'wporg-themes' ); ?></a> 38 <?php } ?> 39 39 </div> 40 40 </div><!-- .theme-head --> 41 41 42 42 <div class="theme-info"> 43 < # if ( data.screenshot_url ) { #>44 <div class="screenshot"><img src="{{ data.screenshot_url }}?w=1142&strip=all" alt=""/></div>45 < # } else { #>46 <div class="screenshot blank"></div>47 < # } #>43 <?php if ( $theme->screenshot_url ) { ?> 44 <div class="screenshot"><img src="<?php echo esc_url( $theme->screenshot_url ); ?>?w=1142&strip=all" alt=""/></div> 45 <?php } else { ?> 46 <div class="screenshot blank"></div> 47 <?php } ?> 48 48 49 <div class="theme-description entry-summary" itemprop="description"><p> {{{ data.description }}}</p></div>49 <div class="theme-description entry-summary" itemprop="description"><p><?php echo esc_html( $theme->description ); ?></p></div> 50 50 51 < # if ( data.tags ) { #>51 <?php if ( $theme->tags ) { ?> 52 52 <div class="theme-tags"> 53 53 <h4><?php _e( 'Tags:', 'wporg-themes' ); ?></h4> 54 {{{ data.tags }}} 54 <?php 55 $tag_links = array(); 56 foreach ( $theme->tags as $slug => $tagname ) { 57 $tag_links[] = sprintf( 58 "<a href='%s'>%s</a>", 59 esc_url( home_url( "/tags/$slug/" ) ), 60 esc_html( $tagname ) 61 ); 62 } 63 echo implode( ', ', $tag_links ); 64 ?> 55 65 </div><!-- .theme-tags --> 56 < # } #>66 <?php } ?> 57 67 58 68 <div class="theme-downloads"> 59 <h4><?php _e( 'Downloads Per Day', 'wporg-themes' ); ?></h4> 60 <div id="theme-download-stats-{{data.id}}" class="chart"></div> 61 <p class="total-downloads"><?php printf( __( 'Total downloads: %s', 'wporg-themes' ), '<strong>{{ data.downloaded }}</strong>' ); ?></p> 69 <p class="total-downloads"><?php printf( __( 'Total downloads: %s', 'wporg-themes' ), '<strong>' . number_format_i18n( $theme->downloaded ) . '</strong>' ); ?></p> 62 70 </div><!-- .theme-downloads --> 63 71 </div> … … 65 73 <div class="theme-meta"> 66 74 <div class="theme-ratings" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> 67 <meta itemprop="ratingCount" content=" {{ data.num_ratings }}"/>75 <meta itemprop="ratingCount" content="<?php echo $theme->num_ratings; ?>"/> 68 76 <h4><?php _e( 'Ratings', 'wporg-themes' ); ?></h4> 69 77 70 < # if ( data.rating ) { #>71 <div class="rating rating- {{ Math.round( data.rating / 10 ) * 10 }}">78 <?php if ( $theme->rating ) { ?> 79 <div class="rating rating-<?php echo round( $theme->rating / 10 ) * 10; ?>"> 72 80 <span class="one"></span> 73 81 <span class="two"></span> … … 75 83 <span class="four"></span> 76 84 <span class="five"></span> 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>85 <p class="description"><?php printf( __( '%s out of 5 stars.', 'wporg-themes' ), '<span itemprop="ratingValue">' . round( $theme->rating / 20 / 0.5 )*0.5 . '</span>' ); ?></p> 78 86 </div> 79 < # } else { #>87 <?php } else { ?> 80 88 <div class="rating"> 81 89 <div class="ratings"><?php _e( 'This theme has not been rated yet.', 'wporg-themes' ); ?></div> 82 90 </div> 83 < # } #>91 <?php } ?> 84 92 85 < # if ( data.ratings ) { #>93 <?php if ( $theme->ratings ) { ?> 86 94 <ul> 87 <?php foreach ( range( 5, 1 ) as $stars ) : ?> 95 <?php foreach ( range( 5, 1 ) as $stars ) : 96 $rating_bar_width = $theme->num_ratings ? 100 * $theme->ratings[$stars] / $theme->num_ratings : 0; 97 ?> 88 98 <li class="counter-container"> 89 <a href="//wordpress.org/support/view/theme-reviews/ {{ data.id }}?filter=<?php echo $stars; ?>" title="<?php echo esc_attr( sprintf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $stars, 'wporg-themes' ), $stars ) ); ?>">99 <a href="//wordpress.org/support/view/theme-reviews/<?php echo $theme->slug; ?>?filter=<?php echo $stars; ?>" title="<?php echo esc_attr( sprintf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $stars, 'wporg-themes' ), $stars ) ); ?>"> 90 100 <span class="counter-label"><?php printf( _n( '%d star', '%d stars', $stars, 'wporg-themes' ), $stars ); ?></span> 91 101 <span class="counter-back"> 92 <span class="counter-bar" style="width: {{ 100 * data.ratings[<?php echo $stars; ?>] / data.num_ratings }}%;"></span>102 <span class="counter-bar" style="width: <?php echo $rating_bar_width; ?>%;"></span> 93 103 </span> 94 <span class="counter-count"> {{ data.ratings[<?php echo $stars; ?>] }}</span>104 <span class="counter-count"><?php echo $theme->ratings[$stars]; ?></span> 95 105 </a> 96 106 </li> 97 107 <?php endforeach; ?> 98 108 </ul> 99 < # } #>109 <?php } ?> 100 110 101 <a class="button button-secondary" href="https://wordpress.org/support/view/theme-reviews/ {{ data.id }}#postform"><?php _e( 'Add your review', 'wporg-themes' ); ?></a>111 <a class="button button-secondary" href="https://wordpress.org/support/view/theme-reviews/<?php echo $theme->slug; ?>#postform"><?php _e( 'Add your review', 'wporg-themes' ); ?></a> 102 112 </div><!-- .theme-rating --> 103 113 … … 105 115 <h4><?php _e( 'Support', 'wporg-themes' ); ?></h4> 106 116 <p><?php _e( 'Got something to say? Need help?', 'wporg-themes' ); ?></p> 107 <a href="//wordpress.org/support/theme/ {{ data.slug }}" class="button button-secondary"><?php _e( 'View support forum', 'wporg-themes' ); ?></a>117 <a href="//wordpress.org/support/theme/<?php echo $theme->slug; ?>" class="button button-secondary"><?php _e( 'View support forum', 'wporg-themes' ); ?></a> 108 118 </div><!-- .theme-support --> 109 119 … … 113 123 <ul class="unmarked-list"> 114 124 <li> 115 <a href="//themes.trac.wordpress.org/log/ {{data.id}}?limit=100&mode=stop_on_copy&format=rss">125 <a href="//themes.trac.wordpress.org/log/<?php echo $theme->slug; ?>?limit=100&mode=stop_on_copy&format=rss"> 116 126 <img src="//s.w.org/style/images/feedicon.png" /> 117 127 <?php _e( 'Development Log', 'wporg-themes' ); ?> … … 122 132 <h5><?php _e( 'Browse the Code', 'wporg-themes' ); ?></h5> 123 133 <ul class="unmarked-list"> 124 <li><a href="//themes.trac.wordpress.org/log/ {{data.id}}/" rel="nofollow"><?php _e( 'Development Log', 'wporg-themes' ); ?></a></li>125 <li><a href="//themes.svn.wordpress.org/ {{data.id}}/" rel="nofollow"><?php _e( 'Subversion Repository', 'wporg-themes' ); ?></a></li>126 <li><a href="//themes.trac.wordpress.org/browser/ {{data.id}}/" rel="nofollow"><?php _e( 'Browse in Trac', 'wporg-themes' ); ?></a></li>134 <li><a href="//themes.trac.wordpress.org/log/<?php echo $theme->slug; ?>/" rel="nofollow"><?php _e( 'Development Log', 'wporg-themes' ); ?></a></li> 135 <li><a href="//themes.svn.wordpress.org/<?php echo $theme->slug; ?>/" rel="nofollow"><?php _e( 'Subversion Repository', 'wporg-themes' ); ?></a></li> 136 <li><a href="//themes.trac.wordpress.org/browser/<?php echo $theme->slug; ?>/" rel="nofollow"><?php _e( 'Browse in Trac', 'wporg-themes' ); ?></a></li> 127 137 </ul> 128 138 </div><!-- .theme-devs --> … … 130 140 </div> 131 141 </div> 132 </ script>142 </div>
Note: See TracChangeset
for help on using the changeset viewer.