Ticket #3078: 3078.2.diff
File 3078.2.diff, 11.3 KB (added by , 5 years ago) |
---|
-
wordpress.org/public_html/wp-content/plugins/wporg-meeting-posttype/wporg-meeting-posttype.php
diff --git wordpress.org/public_html/wp-content/plugins/wporg-meeting-posttype/wporg-meeting-posttype.php wordpress.org/public_html/wp-content/plugins/wporg-meeting-posttype/wporg-meeting-posttype.php index f6cb97bf0..7350e541a 100644
class Meeting_Post_Type { 30 30 add_action( 'admin_head', array( $mpt, 'meeting_column_width' ) ); 31 31 add_action( 'admin_bar_menu', array( $mpt, 'add_edit_meetings_item_to_admin_bar' ), 80 ); 32 32 add_action( 'wp_enqueue_scripts', array( $mpt, 'add_edit_meetings_icon_to_admin_bar' ) ); 33 add_shortcode( 'meeting_time', array( $mpt, 'meeting_time_shortcode' ) ); 33 34 } 34 35 35 36 public function meeting_column_width() { ?> … … class Meeting_Post_Type { 462 463 ' ); 463 464 } 464 465 466 /** 467 * Renders meeting information with the next meeting time based on user's local timezone. Used in Make homepage. 468 */ 469 public function meeting_time_shortcode( $attr, $content = '' ) { 470 471 if ( empty( $attr['team'] ) ) { 472 return ''; 473 } 474 475 if ( $attr['team'] === 'Documentation' ) { 476 $attr['team'] = 'Docs'; 477 } 478 479 $query = new WP_Query( 480 array( 481 'post_type' => 'meeting', 482 'meta_query' => array( 483 array( 484 'key' => 'team', 485 'value' => $attr['team'], 486 'compare' => 'EQUALS', 487 ) 488 ) 489 ) 490 ); 491 492 if ( count( $query->posts ) > 0 ) { 493 494 $post = $query->posts[0]; 495 $next_meeting_datestring = $post->next_date; 496 $next_meeting_iso = $next_meeting_datestring . 'T' . $post->time . ':00+00:00'; 497 $next_meeeting_timestamp = strtotime( $next_meeting_datestring . $post->time ); 498 499 $out = '<p>'; 500 $out .= 'Next meeting: ' . __( $post->post_title ); 501 $display_count = count( $query->posts ) - 1; 502 $out .= $display_count === 0 ? '' : ' <a title="Click to view all meetings for this team" href="/meetings#' . esc_attr( $attr['team'] ) . '">' . sprintf( __( '(+%s more)'), $display_count ) . '</a>'; 503 $out .= '</br>'; 504 $out .= '<time class="date" date-time="' . esc_attr( $next_meeting_iso ) . '">' . $next_meeting_iso . '</time> '; 505 $out .= sprintf( __( '(%s from now)' ), human_time_diff( $next_meeeting_timestamp, current_time('timestamp') ) ); 506 $out .= empty( $post->location ) ? '' : ' ' . sprintf( __('at %s on Slack'), $post->location ); 507 $out .= '</p>'; 508 } 509 510 511 return $out; 512 } 465 513 } 466 514 467 515 // fire it up -
wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/archive-meeting.php
diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/archive-meeting.php wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/archive-meeting.php index 3f0e4da4b..aa57e91c9 100644
function wporg_makehome_time_converter_script() { 111 111 } 112 112 } 113 113 } 114 115 // Allow client side filtering using # in url 116 var hash = window.location.hash.replace('#',''); 117 if (hash) { 118 var rowsToRemove = $('.schedule').find('tr td:nth-child(1)').filter(function() { 119 console.log($(this).text()); 120 var reg = new RegExp(hash, "i"); 121 return !reg.test($(this).text()); 122 }); 123 124 for (var i = 0; i < rowsToRemove.length; i++) { 125 $(rowsToRemove[i]).parent().remove(); 126 } 127 } 128 129 // avoid page flickers on load 130 $('.schedule').show(); 114 131 }); 115 132 </script> 116 133 <?php -
wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/front-page.php
diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/front-page.php wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/front-page.php index 72e45c759..da101f56b 100644
8 8 <div class="wrapper"> 9 9 <h2 class="section-title"><?php _e( 'There are many different ways for you to get involved with WordPress:', 'make-wporg' ); ?></h2> 10 10 <div class="js-masonry" data-masonry-options='{ "itemSelector": ".make_site" }'> 11 <?php 11 <?php 12 12 $sites_query = new WP_Query( 'post_type=make_site&posts_per_page=-1&order=ASC' ); 13 13 $makesites = make_site_get_network_sites(); 14 14 ?> 15 <?php while ( $sites_query->have_posts() ) : $sites_query->the_post(); ?>16 <?php17 $make_site_id = get_post_meta( $post->ID, 'make_site_id', true );18 $url = $makesites[$make_site_id];19 ?> 15 <?php while ( $sites_query->have_posts() ) : $sites_query->the_post(); ?> 16 <?php 17 $make_site_id = get_post_meta( $post->ID, 'make_site_id', true ); 18 $url = $makesites[ $make_site_id ]; 19 ?> 20 20 <article id="site-<?php the_ID(); ?>" <?php post_class(); ?>> 21 21 <h2> 22 22 <?php if ( $url ) : ?> 23 <a href="<?php echo esc_url( $url ); ?>"><?php the_title(); ?></a> 23 <a 24 title="<?php printf( esc_attr( 'Learn more about %s.', 'make-wporg' ), esc_html( get_the_title() ) ); ?>" 25 href="<?php echo esc_url( $url ); ?>" 26 ><?php the_title(); ?></a> 24 27 <?php else : ?> 25 28 <?php the_title(); ?> 26 29 <?php endif; ?> 27 30 </h2> 28 31 29 32 <div class="team-description"> 30 33 <?php the_content(); ?> 31 <?php if ( $url ) : ?>32 <p><a href="<?php echo esc_url( $url ); ?>"><?php printf( __( 'Learn more about %s »', 'make-wporg' ), get_the_title() ); ?></a></p>33 <?php endif; ?>34 34 </div> 35 36 <?php if ( '1' == get_post_meta( get_the_ID(), 'weekly_meeting', true ) ) : ?> 37 <small> 38 <p><?php printf( __( 'Weekly chats: %s', 'make-wporg' ), get_post_meta( get_the_ID(), 'weekly_meeting_when', true ) ); ?></p> 39 <p><?php echo get_post_meta( get_the_ID(), 'weekly_meeting_where', true ); ?></p> 40 </small> 41 <?php endif; /**/ ?> 35 36 <div class="team-meeting"> 37 <?php 38 echo do_shortcode( sprintf( '[meeting_time team="%s"][/meeting_time]', $post->post_title ) ); 39 ?> 40 </div> 42 41 </article> 43 42 <?php endwhile; ?> 44 43 </div> 45 44 </div> 46 45 </section> 47 46 47 <script type="text/javascript"> 48 49 var parse_date = function (text) { 50 var m = /^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})\+00:00$/.exec(text); 51 var d = new Date(); 52 d.setUTCFullYear(+m[1]); 53 d.setUTCDate(+m[3]); 54 d.setUTCMonth(+m[2]-1); 55 d.setUTCHours(+m[4]); 56 d.setUTCMinutes(+m[5]); 57 d.setUTCSeconds(+m[6]); 58 return d; 59 } 60 var format_time = function (d) { 61 return d.toLocaleTimeString(navigator.language, {weekday: 'long'}); 62 } 63 64 var nodes = document.getElementsByTagName('time'); 65 for (var i=0; i<nodes.length; ++i) { 66 var node = nodes[i]; 67 if (node.className === 'date') { 68 var d = parse_date(node.getAttribute('date-time')); 69 if (d) { 70 node.textContent = format_time(d); 71 } 72 } 73 } 74 </script> 48 75 <?php get_footer(); ?> -
wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/style.css
diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/style.css wordpress.org/public_html/wp-content/themes/pub/wporg-makehome/style.css index ba4628452..32431e8fe 100644
section.get-involved article:nth-of-type(odd) { 203 203 clear: left; 204 204 } 205 205 206 section.get-involved article h2 :before {206 section.get-involved article h2 a:before { 207 207 font-family: 'dashicons'; 208 208 content: '\f109'; 209 209 margin-right: 0.4em; … … section.get-involved article h2:before { 214 214 -moz-osx-font-smoothing: grayscale; 215 215 } 216 216 217 section.get-involved article.make-core h2 :before { content: "\f475"; }218 section.get-involved article.make- design h2:before { content: "\f309"; }219 section.get-involved article.make- mobile h2:before { content: "\f470"; }220 section.get-involved article.make-accessibility h2 :before { content: "\f483"; }221 section.get-involved article.make-polyglots h2 :before { content: '\f326'; }222 section.get-involved article.make-support h2 :before { content: "\f125"; }223 section.get-involved article.make-themes h2 :before { content: '\f100'; }224 section.get-involved article.make-plugins h2 :before { content: '\f106'; }225 section.get-involved article.make-docs h2 :before { content: '\f105'; }226 section.get-involved article.make-community h2 :before { content: '\f307'; }227 section.get-involved article.make-meta h2 :before { content: '\f325'; }228 section.get-involved article.make-training h2 :before { content: '\f118'; }229 section.get-involved article.make-flow h2 :before { content: '\f115'; }230 section.get-involved article.make-tv h2 :before { content: '\f235'; }231 section.get-involved article.make-marketing h2 :before { content: '\f130'; }232 section.get-involved article.make-cli h2 :before { content: '\f345'; }233 section.get-involved article.make-hosting h2 :before { content: '\f176'; }234 section.get-involved article.make-tide h2 :before { content: '\f10d'; }217 section.get-involved article.make-core h2 a:before { content: "\f475"; } 218 section.get-involved article.make-mobile h2 a:before { content: "\f470"; } 219 section.get-involved article.make-design h2 a:before { content: "\f309"; } 220 section.get-involved article.make-accessibility h2 a:before { content: "\f483"; } 221 section.get-involved article.make-polyglots h2 a:before { content: '\f326'; } 222 section.get-involved article.make-support h2 a:before { content: "\f125"; } 223 section.get-involved article.make-themes h2 a:before { content: '\f100'; } 224 section.get-involved article.make-plugins h2 a:before { content: '\f106'; } 225 section.get-involved article.make-docs h2 a:before { content: '\f105'; } 226 section.get-involved article.make-community h2 a:before { content: '\f307'; } 227 section.get-involved article.make-meta h2 a:before { content: '\f325'; } 228 section.get-involved article.make-training h2 a:before { content: '\f118'; } 229 section.get-involved article.make-flow h2 a:before { content: '\f115'; } 230 section.get-involved article.make-tv h2 a:before { content: '\f235'; } 231 section.get-involved article.make-marketing h2 a:before { content: '\f130'; } 232 section.get-involved article.make-cli h2 a:before { content: '\f345'; } 233 section.get-involved article.make-hosting h2 a:before { content: '\f176'; } 234 section.get-involved article.make-tide h2 a:before { content: '\f10d'; } 235 235 236 236 section.get-involved article.featured-group h2:after { 237 237 display: block; … … section.get-involved article.featured-group h2:after { 243 243 244 244 section.get-involved article h2 a { 245 245 font-weight: 600; 246 color: #444444; 246 } 247 248 section.get-involved article h2 a { 249 font-weight: 600; 247 250 } 248 251 249 252 section.get-involved article div.team-description p { … … section.get-involved article div.team-description p { 252 255 line-height: 1.5; 253 256 } 254 257 255 section.get-involved article small{258 div.team-meeting { 256 259 display: block; 257 260 font-size: 0.8em; 258 261 font-style: italic; 259 opacity: 0. 5;262 opacity: 0.75; 260 263 padding-top: 0.5em; 261 264 } 262 265 263 section.get-involved article small p{266 section.get-involved article .team-meeting { 264 267 line-height: 1.5; 265 268 } 266 269 … … h2.title { 311 314 line-height: 1.3; 312 315 } 313 316 table.schedule { 317 /* table is set to show after JS is completed to avoid fickering */ 318 display: none; 314 319 width: 100%; 315 320 margin: 30px 10px; 316 321 font-size: 1.4em;