Changeset 1006
- Timestamp:
- 11/25/2014 08:49:42 PM (10 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
- Files:
-
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php
r1001 r1006 1 <?php 2 include_once ABSPATH . '/wp-admin/includes/theme.php'; 3 $theme = themes_api( 'theme_information', array( 'slug' => get_post()->post_name ) ); 4 ?> 1 <?php global $theme; ?> 5 2 6 3 <div class="theme-backdrop"></div> 7 4 <div class="theme-wrap"> 8 5 <div class="theme-header"> 6 <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close overlay' ); ?></span></button> 9 7 <button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button> 10 8 <button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button> 11 <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close overlay' ); ?></span></button>12 9 </div> 13 10 <div class="theme-about"> … … 16 13 </div> 17 14 18 <div class="theme-info"> 19 <h3 class="theme-name"><?php the_title(); ?><span 20 class="theme-version"><?php printf( __( 'Version: %s' ), $theme->version ); ?></span> 21 </h3> 22 <h4 class="theme-author"><?php printf( __( 'By %s' ), $theme->author ); ?></h4> 15 <div class="theme-info hentry"> 16 <h3 class="theme-name entry-title"><?php the_title(); ?></h3> 17 <span class="theme-version"><?php printf( __( 'Version: %s' ), $theme->version ); ?></span> 18 <h4 class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">' . $theme->author . '</span>' ); ?></h4> 23 19 24 <p class="theme-description "><?php the_content(); ?></p>20 <p class="theme-description entry-summary"><?php the_content(); ?></p> 25 21 26 22 <div class="rating rating-<?php echo round( $theme->rating, -1 ); ?>"> … … 35 31 36 32 <div class="theme-stats"> 37 <div><strong><?php _e( 'Last updated:' ); ?></strong> < ?php echo $theme->last_updated; ?></div>33 <div><strong><?php _e( 'Last updated:' ); ?></strong> <span class="updated"><?php echo $theme->last_updated; ?></span></div> 38 34 <div><strong><?php _e( 'Downloads:' ); ?></strong> <?php echo $theme->downloaded; ?></div> 39 35 <div><a href="<?php echo esc_url( $theme->homepage ); ?>"><?php _e( 'Theme Homepage »' ); ?></a></div> 40 36 </div> 41 37 42 43 44 45 46 </div> 38 <p class="theme-tags"> 39 <span><?php _e( 'Tags:' ); ?></span> 40 <?php echo implode( ', ', $theme->tags ); ?> 41 </p> 42 </div>å 47 43 </div> 48 44 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content.php
r1001 r1006 1 <?php global $theme; ?>2 <article class="theme">1 <?php global $theme; var_dump($theme);?> 2 <article id="post-<?php echo $theme->slug; ?>" class="theme hentry"> 3 3 <div class="theme-screenshot"> 4 4 <img src="<?php echo esc_url( $theme->screenshot_url ); ?>" alt=""> 5 5 </div> 6 <a href="/<?php echo $theme->slug; ?>" class="more-details"><?php _ex( 'More Info', 'theme' ); ?></a>7 <div class="theme-author"><?php printf( __( 'By %s' ), $theme->author); ?></div>8 <h3 class="theme-name "><?php echo $theme->name; ?></h3>6 <a class="more-details url" href="/<?php echo $theme->slug; ?>" rel="bookmark"><?php _ex( 'More Info', 'theme' ); ?></a> 7 <div class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">' . $theme->author . '</span>' ); ?></div> 8 <h3 class="theme-name entry-title"><?php echo $theme->name; ?></h3> 9 9 10 10 <div class="theme-actions"> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/header.php
r1001 r1006 256 256 </head> 257 257 258 <body id="wordpress-org" >258 <body id="wordpress-org" <?php body_class(); ?>> 259 259 <div id="wporg-header"> 260 260 <div class="wrapper"> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php
r1001 r1006 12 12 */ 13 13 14 $template_part = is_single() ? 'single' : 'index'; 14 15 include ABSPATH . 'wp-admin/includes/theme.php'; 15 $themes = themes_api( 'query_themes', array( 16 'per_page' => 15, 17 'browse' => get_query_var( 'attachment' ) ? get_query_var( 'attachment' ) : 'search', 18 ) ); 16 if ( is_single() ) { 17 $themes = themes_api( 'theme_information', array( 'slug' => get_post()->post_name ) ); 18 } else { 19 $themes = themes_api( 'query_themes', array( 20 'per_page' => 15, 21 'browse' => get_query_var( 'attachment' ) ? get_query_var( 'attachment' ) : 'featured', 22 'fields' => 'tags', 23 ) ); 24 } 19 25 20 26 get_header(); … … 42 48 <a class="clear-filters button button-secondary" href="#"><?php _e( 'Clear' ); ?></a> 43 49 </div> 50 44 51 <?php foreach ( get_theme_feature_list() as $feature_name => $features ) : ?> 45 52 <div class="filter-group"> … … 55 62 </div> 56 63 <?php endforeach; ?> 64 57 65 <div class="filtered-by"> 58 66 <span><?php _e( 'Filtering by:' ); ?></span> … … 61 69 </div> 62 70 </div> 71 </div><!-- .wp-filter --> 72 73 <div class="theme-browser content-filterable"> 74 <div class="themes"> 75 <?php 76 if ( ! is_wp_error( $themes ) ) : 77 foreach ( $themes->themes as $theme ) : 78 get_template_part( 'content', $template_part ); 79 endforeach; 80 endif; 81 ?> 82 </div> 63 83 </div> 64 <div class="theme-browser content-filterable"> 65 <?php 66 if ( ! is_wp_error( $themes ) ) : 67 foreach ( $themes->themes as $theme ) : 68 get_template_part( 'content', 'index' ); 69 endforeach; 70 endif; 71 ?> 72 </div> 84 <div class="theme-install-overlay"></div> 73 85 <div class="theme-overlay"></div> 74 86 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js
r1001 r1006 17 17 'keyup': 'addFocus', 18 18 'touchmove': 'preventExpand' 19 }, 20 }); 21 22 // wp.themes.view.Preview.prototype = wp.themes.view.Details.prototype; 23 24 _.extend( wp.themes.view.Details.prototype, { 25 events: { 26 'click': 'collapse', 27 'click .delete-theme': 'deleteTheme', 28 'click .left': 'previousTheme', 29 'click .right': 'nextTheme', 30 'click .button-secondary': 'preview', 31 'keydown .button-secondary': 'preview', 32 'touchend .button-secondary': 'preview' 33 }, 34 35 preview: function( event ) { 36 var self = this, 37 current, preview; 38 39 // Bail if the user scrolled on a touch device 40 if ( this.touchDrag === true ) { 41 return this.touchDrag = false; 42 } 43 44 // Allow direct link path to installing a theme. 45 if ( $( event.target ).hasClass( 'button-primary' ) ) { 46 return; 47 } 48 49 // 'enter' and 'space' keys expand the details view when a theme is :focused 50 if ( event.type === 'keydown' && ( event.which !== 13 && event.which !== 32 ) ) { 51 return; 52 } 53 54 // pressing enter while focused on the buttons shouldn't open the preview 55 if ( event.type === 'keydown' && event.which !== 13 && $( ':focus' ).hasClass( 'button' ) ) { 56 return; 57 } 58 59 event.preventDefault(); 60 61 event = event || window.event; 62 63 // Set focus to current theme. 64 wp.themes.focusedTheme = this.$el; 65 66 // Construct a new Preview view. 67 preview = new wp.themes.view.Preview({ 68 model: this.model 69 }); 70 71 // Render the view and append it. 72 preview.render(); 73 this.setNavButtonsState(); 74 75 // Hide previous/next navigation if there is only one theme 76 if ( this.model.collection.length === 1 ) { 77 preview.$el.addClass( 'no-navigation' ); 78 } else { 79 preview.$el.removeClass( 'no-navigation' ); 80 } 81 82 preview.$el.addClass( 'wp-full-overlay expanded' ); 83 84 // Append preview 85 $( '.theme-install-overlay' ).append( preview.el ); 86 87 // Listen to our preview object 88 // for `theme:next` and `theme:previous` events. 89 this.listenTo( preview, 'theme:next', function() { 90 91 // Keep local track of current theme model. 92 current = self.model; 93 94 // If we have ventured away from current model update the current model position. 95 if ( ! _.isUndefined( self.current ) ) { 96 current = self.current; 97 } 98 99 // Get next theme model. 100 self.current = self.model.collection.at( self.model.collection.indexOf( current ) + 1 ); 101 102 // If we have no more themes, bail. 103 if ( _.isUndefined( self.current ) ) { 104 self.options.parent.parent.trigger( 'theme:end' ); 105 return self.current = current; 106 } 107 108 preview.model = self.current; 109 110 // Render and append. 111 preview.render(); 112 this.setNavButtonsState(); 113 $( '.next-theme' ).focus(); 114 }) 115 .listenTo( preview, 'theme:previous', function() { 116 117 // Keep track of current theme model. 118 current = self.model; 119 120 // Bail early if we are at the beginning of the collection 121 if ( self.model.collection.indexOf( self.current ) === 0 ) { 122 return; 123 } 124 125 // If we have ventured away from current model update the current model position. 126 if ( ! _.isUndefined( self.current ) ) { 127 current = self.current; 128 } 129 130 // Get previous theme model. 131 self.current = self.model.collection.at( self.model.collection.indexOf( current ) - 1 ); 132 133 // If we have no more themes, bail. 134 if ( _.isUndefined( self.current ) ) { 135 return; 136 } 137 138 preview.model = self.current; 139 140 // Render and append. 141 preview.render(); 142 this.setNavButtonsState(); 143 $( '.previous-theme' ).focus(); 144 }); 145 146 this.listenTo( preview, 'preview:close', function() { 147 self.current = self.model; 148 }); 149 }, 150 151 // Handles .disabled classes for previous/next buttons in theme installer preview 152 setNavButtonsState: function() { 153 var $themeInstaller = $( '.theme-install-overlay' ), 154 current = _.isUndefined( this.current ) ? this.model : this.current; 155 156 // Disable previous at the zero position 157 if ( 0 === this.model.collection.indexOf( current ) ) { 158 $themeInstaller.find( '.previous-theme' ).addClass( 'disabled' ); 159 } 160 161 // Disable next if the next model is undefined 162 if ( _.isUndefined( this.model.collection.at( this.model.collection.indexOf( current ) + 1 ) ) ) { 163 $themeInstaller.find( '.next-theme' ).addClass( 'disabled' ); 164 } 19 165 } 20 166 }); 21 22 wp.themes.view.Preview.prototype = wp.themes.view.Details.prototype;23 167 24 168 _.extend( wp.themes.InstallerRouter.prototype, { -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css
r1001 r1006 10 10 */ 11 11 12 #themes {13 font-family: 'Open Sans', sans-serif;14 }15 12 body { 16 13 background: #f1f1f1; … … 57 54 .theme-overlay .theme-wrap { 58 55 right: 190px; 56 top: 3%; 57 } 58 59 .admin-bar .theme-overlay .theme-wrap { 60 top: calc(3% + 32px); 61 } 62 63 @media only screen and (max-width: 782px) { 64 .theme-overlay .theme-wrap { 65 bottom: 3%; 66 left: 10px; 67 right: 10px; 68 } 69 } 70 71 .theme-overlay .theme-name { 72 display: inline-block; 73 } 74 75 .theme-install-overlay iframe { 76 border: 0; 77 height: 100%; 78 width: 100%; 79 z-index: 20; 80 -webkit-transition: opacity 0.3s; 81 transition: opacity 0.3s; 59 82 } 60 83 … … 208 231 .wp-filter .drawer-toggle:before { 209 232 display: inline-block; 210 vertical-align: top;233 vertical-align: sub; 211 234 content: "\f111"; 212 235 margin: 0 5px 0 0; … … 214 237 height: 16px; 215 238 color: #777; 216 -webkit-transition: color .1s ease-in 0;217 transition: color .1s ease-in 0;239 -webkit-transition: color .1s ease-in; 240 transition: color .1s ease-in; 218 241 font-family: "dashicons"; 219 242 font-size: 16px; … … 433 456 } 434 457 435 .theme-browser .button, 436 .theme-overlay .button { 458 .wrap .button { 437 459 display: inline-block; 438 460 text-decoration: none; … … 453 475 } 454 476 455 .theme-browser .button-primary, 456 .theme-overlay .button-primary { 477 .wrap .button-primary { 457 478 background: #2ea2cc; 458 479 border-color: #0074a2; -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-preview.php
r1001 r1006 5 5 <a href="#" class="previous-theme"><span class="screen-reader-text"><?php _ex( 'Previous', 'Button label for a theme' ); ?></span></a> 6 6 <a href="#" class="next-theme"><span class="screen-reader-text"><?php _ex( 'Next', 'Button label for a theme' ); ?></span></a> 7 <a href="#" class="button button-primary theme-install"><?php _e( 'Download' ); ?></a> 7 8 </div> 8 9 <div class="wp-full-overlay-sidebar-content"> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php
r1001 r1006 3 3 <div class="theme-wrap"> 4 4 <div class="theme-header"> 5 <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close overlay' ); ?></span></button> 5 6 <button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button> 6 7 <button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button> 7 <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close overlay' ); ?></span></button>8 8 </div> 9 9 <div class="theme-about"> … … 16 16 </div> 17 17 18 <div class="theme-info"> 19 <h3 class="theme-name"> 20 {{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{{ data.version }}}' ); ?></span> 21 </h3> 22 <h4 class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.author }}}' ); ?></h4> 18 <div class="theme-info hentry"> 19 <h3 class="theme-name entry-title">{{{ data.name }}}</h3> 20 <span class="theme-version"><?php printf( __( 'Version: %s' ), '{{{ data.version }}}' ); ?></span> 21 <h4 class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">{{{ data.author }}}</span>' ); ?></h4> 23 22 24 <p class="theme-description ">{{{ data.description }}}</p>23 <p class="theme-description entry-summary">{{{ data.description }}}</p> 25 24 26 25 <div class="rating rating-{{ Math.round( data.rating / 10 ) * 10 }}"> … … 35 34 36 35 <div class="theme-stats"> 37 <div><strong><?php _e( 'Last updated:' ); ?></strong> {{ data.last_updated }}</div>36 <div><strong><?php _e( 'Last updated:' ); ?></strong> <span class="updated">{{ data.last_updated }}</span></div> 38 37 <div><strong><?php _e( 'Downloads:' ); ?></strong> {{ data.downloaded }}</div> 39 38 <div><a href="{{ data.homepage }}"><?php _e( 'Theme Homepage »' ); ?></a></div> … … 44 43 <span><?php _e( 'Tags:' ); ?></span> 45 44 <# _.each( data.tags, function( tag ) { #> 46 {{{ tag }}}45 <a href="">{{{ tag }}}</a> 47 46 <# }); #> 48 47 </p> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme.php
r1001 r1006 7 7 <div class="theme-screenshot blank"></div> 8 8 <# } #> 9 <span class="more-details "><?php _ex( 'More Info', 'theme' ); ?></span>10 <div class="theme-author"><?php printf( __( 'By %s' ), ' {{ data.author }}' ); ?></div>11 <h3 class="theme-name ">{{ data.name }}</h3>9 <span class="more-details "><?php _ex( 'More Info', 'theme' ); ?></span> 10 <div class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">{{ data.author }}</span>' ); ?></div> 11 <h3 class="theme-name entry-title">{{ data.name }}</h3> 12 12 13 13 <div class="theme-actions">
Note: See TracChangeset
for help on using the changeset viewer.