Making WordPress.org

source: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php

Last change on this file was 12338, checked in by coffee2code, 3 months ago

Theme Directory: Add initial theme categorization features to the theme.

  • Property svn:eol-style set to native
File size: 12.6 KB
Line 
1<script id="tmpl-theme-single" type="text/template">
2        <div class="theme-navigation">
3                <button class="close"><?php _e( 'Return to Themes List', 'wporg-themes' ); ?></button>
4                <div class="navigation post-navigation">
5                        <button class="left dashicons dashicons-arrow-left-alt2"><span class="screen-reader-text"><?php _e( 'Show previous theme', 'wporg-themes' ); ?></span></button>
6                        <button class="right dashicons dashicons-arrow-right-alt2"><span class="screen-reader-text"><?php _e( 'Show next theme', 'wporg-themes' ); ?></span></button>
7                </div>
8        </div>
9        <div class="theme-wrap">
10                <div class="theme-about hentry" data-slug="{{{ data.slug }}}">
11                        <# if ( data.is_outdated ) { #>
12                        <div class="theme-notice notice notice-warning notice-alt">
13                                <p><?php _e( 'This theme <strong>hasn&#146;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                        </div><!-- .theme-notice -->
15                        <# } #>
16
17                        <div>
18                                <h2 class="theme-name entry-title">{{{ data.name }}}</h2>
19                                <# if ( data.author.display_name ) { #>
20                                <div class="theme-author"><?php printf( _x( 'By %s', 'theme author', 'wporg-themes' ), '<a href="{{{ data.path }}}author/{{ data.author.user_nicename }}/"><span class="author">{{{ data.author.display_name }}}</span></a>' ); ?></div>
21                                <# } #>
22
23                                <# if ( data.show_favorites && data.is_favorited ) { #>
24                                        <span class="dashicons dashicons-heart favorite favorited"></span>
25                                <# } else if ( data.show_favorites ) { #>
26                                        <span class="dashicons dashicons-heart favorite"></span>
27                                <# } #>
28                        </div>
29
30                        <div class="theme-head">
31                                <# if ( data.is_community ) { #>
32                                <div class="widget categorization-widget categorization-widget-community">
33                                        <div class="widget-head">
34                                                <h3><?php esc_html_e( 'Community Theme', 'wporg-themes' ); ?></h3>
35                                                <a href="{{{ data.external_repository_url }}}" rel="nofollow"><?php _e( 'Contribute', 'wporg-themes' ); ?></a>
36                                        </div>
37                                        <p><?php esc_html_e( 'This theme is developed and supported by a community.', 'wporg-themes' ); ?></p>
38                                </div>
39                                <# } #>
40
41                                <# if ( data.is_commercial ) { #>
42                                <div class="widget categorization-widget categorization-widget-commercial">
43                                        <div class="widget-head">
44                                                <h3><?php esc_html_e( 'Commercial Theme', 'wporg-themes' ); ?></h3>
45                                                <a href="{{{ data.external_support_url }}}" rel="nofollow"><?php _e( 'Support', 'wporg-themes' ); ?></a>
46                                        </div>
47                                        <p><?php esc_html_e( 'This theme is free but offers additional paid commercial upgrades or support.', 'wporg-themes' ); ?></p>
48                                </div>
49                                <# } #>
50
51                                <div class="theme-actions clear">
52                                        <a href="{{{ data.preview_url }}}" class="button button-secondary alignleft"><?php _e( 'Preview', 'wporg-themes' ); ?></a>
53                                        <a href="{{ data.download_link }}" class="button button-primary alignright"><?php _e( 'Download', 'wporg-themes' ); ?></a>
54                                </div>
55
56                                <# if ( data.parent ) { #>
57                                <div class="theme-notice notice notice-info notice-alt">
58                                        <p class="parent"><?php printf( __( 'This is a child theme of %s.', 'wporg-themes' ), sprintf( '<a href="%1$s">%2$s</a>', '{{{ data.path }}}{{{ data.parent.slug }}}/', '{{{ data.parent.name }}}' ) ); ?></p>
59                                </div>
60                                <# } #>
61
62                                <div class="theme-meta-info">
63                                        <p class="version"><?php printf( __( 'Version: %s', 'wporg-themes' ), '<strong>{{ data.version }}</strong>' ); ?></p>
64                                        <p class="updated"><?php printf( __( 'Last updated: %s', 'wporg-themes' ), '<strong>{{ data.last_updated }}</strong>' ); ?></p>
65                                        <p class="active_installs"><?php printf( __( 'Active Installations: %s', 'wporg-themes' ), '<strong>{{ data.active_installs }}</strong>' ); ?></p>
66                                        <# if ( data.requires ) { #>
67                                        <p class="requires"><?php printf( __( 'WordPress Version: %s', 'wporg-themes' ), '<strong>' . sprintf( __( '%s or higher', 'wporg-themes' ), '{{ data.requires }}' ) . '</strong>' ); ?></p>
68                                        <# } #>
69                                        <# if ( data.requires_php ) { #>
70                                        <p class="requires_php"><?php printf( __( 'PHP Version: %s', 'wporg-themes' ), '<strong>' . sprintf( __( '%s or higher', 'wporg-themes' ), '{{ data.requires_php }}' ) . '</strong>' ); ?></p>
71                                        <# } #>
72                                        <# if ( data.theme_url ) { #>
73                                        <p class="theme_homepage"><a href="{{ data.theme_url }}"><?php _e( 'Theme Homepage', 'wporg-themes' ); ?></a></p>
74                                        <# } #>
75                                </div>
76                        </div><!-- .theme-head -->
77
78                        <div class="theme-info">
79                                <# if ( data.screenshot_url ) { #>
80                                <div class="screenshot">
81                                        <picture>
82                                                <source media="(min-width: 782px)" srcset="{{ data.screenshot_url }}?w=572&strip=all, {{ data.screenshot_url }}?w=1144&strip=all 2x">
83                                                <source media="(min-width: 481px) and (max-width: 782px)" srcset="{{ data.screenshot_url }}?w=700&strip=all, {{ data.screenshot_url }}?w=1400&strip=all 2x">
84                                                <source media="(min-width: 401px) and (max-width: 480px)" srcset="{{ data.screenshot_url }}?w=420&strip=all, {{ data.screenshot_url }}?w=840&strip=all 2x">
85                                                <source media="(max-width: 400px)" srcset="{{ data.screenshot_url }}?w=344&strip=all, {{ data.screenshot_url }}?w=688&strip=all 2x">
86                                                <img src="{{ data.screenshot_url }}?w=572&strip=all" srcset="{{ data.screenshot_url }}?w=1144&strip=all 2x" loading="lazy" alt="">
87                                        </picture>
88                                </div>
89                                <# } else { #>
90                                <div class="screenshot blank"></div>
91                                <# } #>
92
93                                <div class="wporg-style-variations wporg-horizontal-slider-js"></div>
94
95                                <div class="theme-description entry-summary"><p>{{{ data.description }}}</p></div>
96
97                                <# if ( data.tags ) { #>
98                                <div class="theme-tags">
99                                        <h3><?php _e( 'Tags:', 'wporg-themes' ); ?></h3>
100                                        {{{ data.tags }}}
101                                </div><!-- .theme-tags -->
102                                <# } #>
103
104                                <div id="theme-patterns-js" class="theme-patterns" style="display: none;">
105                                        <h3><?php _e( 'Patterns:', 'wporg-themes' ); ?></h3>   
106                                        <div id="theme-patterns-grid-js" class="theme-patterns-grid"></div>
107                                        <a id="theme-patterns-button-js" class="theme-patterns-button" href="#" style="display:none"><?php _e( 'Show all patterns', 'wporg-themes' ); ?></a>
108                                </div>
109
110                                <div class="theme-downloads">
111                                        <h3><?php _e( 'Downloads Per Day', 'wporg-themes' ); ?></h3>
112                                        <div id="theme-download-stats-{{data.id}}" class="chart"></div>
113                                </div><!-- .theme-downloads -->
114
115                                <# if ( data.can_configure_categorization_options && data.is_community ) { #>
116                                <div class="theme-categorization-options">
117                                        <h3><?php _e( 'Community Options', 'wporg-themes' ); ?></h3>
118                                        <p><?php esc_html_e( 'This theme is developed and supported by a community.', 'wporg-themes' ); ?></p>
119                                        <form id="community" class="categorization" method="POST">
120                                        <p>
121                                                <label for="external_repository_url"><?php esc_html_e( 'Development repository URL', 'wporg-themes' ); ?></label>
122                                                <input id="external_repository_url" type="text" name="external_repository_url" value="{{{ data.external_repository_url }}}" data-original-value="{{{ data.external_repository_url}}}">
123                                                <span class="help"><?php esc_html_e( 'Optional. The URL where development happens, such as at github.com.', 'wporg-themes' ); ?></span>
124                                        </p>
125                                        <p>
126                                                <button class="button button-secondary" type="submit"><?php esc_html_e( 'Save', 'wporg-themes' ); ?></button>
127                                                <span class="success-msg"><?php esc_html_e( 'Saved!', 'wporg-themes' ) ?></span>
128                                        </p>
129                                        </form>
130                                </div><!-- .theme-categorization-options -->
131                                <# } #>
132
133                                <# if ( data.can_configure_categorization_options && data.is_commercial ) { #>
134                                <div class="theme-categorization-options">
135                                        <h3><?php _e( 'Commercial Options', 'wporg-themes' ); ?></h3>
136                                        <p><?php esc_html_e( 'This theme is free but offers paid upgrades, support, and/or add-ons.', 'wporg-themes' ); ?></p>
137                                        <form id="commercial" class="categorization" method="POST">
138                                        <p>
139                                                <label for="external_support_url"><?php esc_html_e( 'Commercial support URL', 'wporg-themes' ); ?></label>
140                                                <input id="external_support_url" type="text" name="external_support_url" value="{{{ data.external_support_url }}}" data-original-value="{{{ data.external_support_url }}}">
141                                                <span class="help"><?php esc_html_e( 'Optional. The URL for theme support, other than its support forum on wordpress.org.', 'wporg-themes' ); ?></span>
142                                        </p>
143                                        <p>
144                                                <button class="button button-secondary" type="submit"><?php esc_html_e( 'Save', 'wporg-themes' ); ?></button>
145                                                <span class="success-msg"><?php esc_html_e( 'Saved!', 'wporg-themes' ) ?></span>
146                                        </p>
147                                        </form>
148                                </div><!-- .theme-categorization-options -->
149                                <# } #>
150                        </div>
151
152                        <div class="theme-meta">
153                                <div class="theme-ratings">
154                                        <h3><?php _e( 'Ratings', 'wporg-themes' ); ?></h3>
155
156                                        <a class="reviews-link" href="//wordpress.org/support/theme/{{ data.id }}/reviews/"><?php esc_html_e( 'See all', 'wporg-themes' ); ?></a>
157
158                                        <# if ( data.rating ) { #>
159                                        <div class="rating rating-{{ Math.round( data.rating / 10 ) * 10 }}">
160                                                <span class="one"></span>
161                                                <span class="two"></span>
162                                                <span class="three"></span>
163                                                <span class="four"></span>
164                                                <span class="five"></span>
165                                                <p class="description"><?php printf( __( '%s out of 5 stars.', 'wporg-themes' ), '<span>{{ Math.round( data.rating / 20 / 0.5 )*0.5 }}</span>' ); ?></p>
166                                        </div>
167                                        <# } else { #>
168                                        <div class="rating">
169                                                <div class="ratings"><?php _e( 'This theme has not been rated yet.', 'wporg-themes' ); ?></div>
170                                        </div>
171                                        <# } #>
172
173                                        <# if ( data.ratings ) { #>
174                                        <ul>
175                                                <?php foreach ( range( 5, 1 ) as $stars ) : ?>
176                                                <li class="counter-container">
177                                                        <a href="//wordpress.org/support/theme/{{ data.id }}/reviews/?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 ) ); ?>">
178                                                                <span class="counter-label"><?php printf( _n( '%d star', '%d stars', $stars, 'wporg-themes' ), $stars ); ?></span>
179                                                                <span class="counter-back">
180                                                                        <span class="counter-bar" style="width: {{ 100 * data.ratings[<?php echo $stars; ?>] / data.num_ratings }}%;"></span>
181                                                                </span>
182                                                                <span class="counter-count">{{ data.ratings[<?php echo $stars; ?>] }}</span>
183                                                        </a>
184                                                </li>
185                                                <?php endforeach; ?>
186                                        </ul>
187                                        <# } #>
188
189                                        <a class="button button-secondary" href="https://wordpress.org/support/theme/{{ data.id }}/reviews/#new-post"><?php _e( 'Add my review', 'wporg-themes' ); ?></a>
190                                </div><!-- .theme-rating -->
191
192                                <div class="theme-support">
193                                        <h3><?php _e( 'Support', 'wporg-themes' ); ?></h3>
194                                        <p><?php _e( 'Got something to say? Need help?', 'wporg-themes' ); ?></p>
195                                        <a href="//wordpress.org/support/theme/{{ data.slug }}" class="button button-secondary"><?php _e( 'View support forum', 'wporg-themes' ); ?></a>
196                                </div><!-- .theme-support -->
197
198                                <div class="theme-report">
199                                        <h3><?php _e( 'Report', 'wporg-themes' ); ?></h3>
200                                        <p><?php _e( 'Does this theme have major issues?', 'wporg-themes' ); ?></p>
201                                        <a rel="nofollow" href="https://make.wordpress.org/themes/report-theme/?rep-name={{ data.current_user }}&rep-theme={{ data.homepage }}&rep-subject=Reported+Theme:+{{ data.name }}" class="button button-secondary"><?php _e( 'Report this theme', 'wporg-themes' ); ?></a>
202                                </div><!-- .theme-report -->
203
204                                <div class="theme-translations">
205                                        <h3><?php _e( 'Translations', 'wporg-themes' ); ?></h3>
206                                        <p>
207                                                <a href="https://translate.wordpress.org/projects/wp-themes/{{ data.slug }}">
208                                                        <?php printf( __( 'Translate %s', 'wporg-themes' ), '{{ data.name }}' ); ?>
209                                                </a>
210                                        </p>
211                                </div><!-- .theme-translations -->
212
213                                <div class="theme-devs">
214                                        <h3><?php _e( 'Subscribe', 'wporg-themes' ); ?></h3>
215                                        <ul class="unmarked-list">
216                                                <li>
217                                                        <a href="//themes.trac.wordpress.org/log/{{data.id}}?limit=100&mode=stop_on_copy&format=rss">
218                                                                <span class="dashicons dashicons-rss"></span><?php _e( 'Development Log', 'wporg-themes' ); ?>
219                                                        </a>
220                                                </li>
221                                        </ul>
222
223                                        <h3><?php _e( 'Browse the Code', 'wporg-themes' ); ?></h3>
224                                        <ul class="unmarked-list">
225                                                <li><a href="//themes.trac.wordpress.org/log/{{data.id}}/" rel="nofollow"><?php _e( 'Development Log', 'wporg-themes' ); ?></a></li>
226                                                <li><a href="//themes.svn.wordpress.org/{{data.id}}/" rel="nofollow"><?php _e( 'Subversion Repository', 'wporg-themes' ); ?></a></li>
227                                                <li><a href="//themes.trac.wordpress.org/browser/{{data.id}}/" rel="nofollow"><?php _e( 'Browse in Trac', 'wporg-themes' ); ?></a></li>
228                                                <li><a href="//themes.trac.wordpress.org/query?keywords=~theme-{{data.id}}" rel="nofollow"><?php _e( 'Trac Tickets', 'wporg-themes' ); ?></a></li>
229                                        </ul>
230                                </div><!-- .theme-devs -->
231                        </div>
232                </div>
233        </div>
234</script>
Note: See TracBrowser for help on using the repository browser.