mirror of https://github.com/cncf/cncf.io.git
				
				
				
			Add Golden Kubestronaut capability (#909)
* Add Golden Kubestronaut capability Signed-off-by: Chris Abraham <cjyabraham@gmail.com> * darken the golden marker slightly Signed-off-by: Chris Abraham <cjyabraham@gmail.com> * store golden designation in meta Signed-off-by: Chris Abraham <cjyabraham@gmail.com> * improve styling Signed-off-by: Chris Abraham <cjyabraham@gmail.com> * sync Signed-off-by: Chris Abraham <cjyabraham@gmail.com> * no sync Signed-off-by: Chris Abraham <cjyabraham@gmail.com> * fix url Signed-off-by: Chris Abraham <cjyabraham@gmail.com> * hide people again Signed-off-by: Chris Abraham <cjyabraham@gmail.com> * temporarily sync people on page load Signed-off-by: Chris Abraham <cjyabraham@gmail.com> * undo temporary sync Signed-off-by: Chris Abraham <cjyabraham@gmail.com> --------- Signed-off-by: Chris Abraham <cjyabraham@gmail.com>
This commit is contained in:
		
							parent
							
								
									3ae48b661b
								
							
						
					
					
						commit
						9f2b25ce1a
					
				|  | @ -189,6 +189,13 @@ foreach ( $people as $p ) { | |||
| 		} | ||||
| 		if ( property_exists( $p, 'category' ) ) { | ||||
| 			wp_set_object_terms( $newid, $p->category, 'lf-person-category', false ); | ||||
| 
 | ||||
| 			// if category contains element "Golden-Kubestronaut", then set meta field "lf_person_golden" to true.
 | ||||
| 			if ( in_array( 'Golden-Kubestronaut', $p->category, true ) ) { | ||||
| 				update_post_meta( $newid, 'lf_person_golden', true ); | ||||
| 			} else { | ||||
| 				update_post_meta( $newid, 'lf_person_golden', false ); | ||||
| 			} | ||||
| 		} else { | ||||
| 			wp_set_object_terms( $newid, array(), 'lf-person-category', false ); | ||||
| 		} | ||||
|  |  | |||
|  | @ -38,8 +38,13 @@ $current_url           = home_url( 'people/ambassadors' ); | |||
| 
 | ||||
| $show_modal = isset( $args['show_profile'] ) && $args['show_profile'] ? true : false; | ||||
| $show_logos = isset( $args['show_logos'] ) && $args['show_logos'] ? true : false; | ||||
| 
 | ||||
| $extra_classes = ''; | ||||
| if ( has_term( 'golden-kubestronaut', 'lf-person-category' ) ) { | ||||
| 	$extra_classes = 'golden-kubestronaut'; | ||||
| } | ||||
| ?>
 | ||||
| <div class="person has-animation-scale-2"> | ||||
| <div class="person has-animation-scale-2<?php echo ' ' . esc_html( $extra_classes ); ?>"> | ||||
| 	<?php | ||||
| 	// Make image link if show_modal.
 | ||||
| 	if ( $show_modal ) : | ||||
|  | @ -208,7 +213,7 @@ $show_logos = isset( $args['show_logos'] ) && $args['show_logos'] ? true : false | |||
| 			?>
 | ||||
| 		<div class="modal-hide" id="modal-<?php echo esc_html( $person_id ); ?>" | ||||
| 			aria-hidden="true"> | ||||
| 			<div class="modal-content-wrapper"> | ||||
| 			<div class="modal-content-wrapper<?php echo ' ' . esc_html( $extra_classes ); ?>"> | ||||
| 
 | ||||
| 				<figure class="person__image"> | ||||
| 					<img loading="lazy" | ||||
|  |  | |||
|  | @ -0,0 +1 @@ | |||
| <svg width="32" height="38" viewBox="0 0 32 38" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.1 5.884C.634 11.35.634 20.215 6.1 25.683l9.9 9.9 9.9-9.9c5.467-5.468 5.467-14.332 0-19.8-5.468-5.466-14.332-5.466-19.8 0Z" fill="#FFFDFD" stroke="#000" stroke-width="2.771" stroke-linecap="round"/><circle cx="16" cy="10" r="3" fill="url(#a)"/><path d="M13 18a3 3 0 1 1 6 0v6h-6v-6Z" fill="url(#b)"/><defs><linearGradient id="a" x1="13" y1="11.812" x2="18.999" y2="5.813" gradientUnits="userSpaceOnUse"><stop stop-color="#ddbd55"/><stop offset="1" stop-color="#6c6037"/></linearGradient><linearGradient id="b" x1="13" y1="22.218" x2="17.16" y2="12.233" gradientUnits="userSpaceOnUse"><stop stop-color="#ddbd55"/><stop offset="1" stop-color="#6c6037"/></linearGradient></defs></svg> | ||||
| After Width: | Height: | Size: 787 B | 
|  | @ -74,6 +74,12 @@ function add_cncf_people_map_shortcode( $atts ) { | |||
| 		$lat = get_post_meta( $post->ID, 'lf_person_location_lat' ); | ||||
| 		$lng = get_post_meta( $post->ID, 'lf_person_location_lng' ); | ||||
| 
 | ||||
| 		if ( has_term( 'golden-kubestronaut', 'lf-person-category' ) ) { | ||||
| 			$golden = true; | ||||
| 		} else { | ||||
| 			$golden = false; | ||||
| 		} | ||||
| 
 | ||||
| 		if ( $lat && $lng ) { | ||||
| 			$people[] = array( | ||||
| 				'lat'  => $lat, | ||||
|  | @ -81,6 +87,7 @@ function add_cncf_people_map_shortcode( $atts ) { | |||
| 				'name' => get_the_title(), | ||||
| 				'slug' => $post->post_name, | ||||
| 				'id'   => get_the_ID(), | ||||
| 				'golden' => $golden, | ||||
| 			); | ||||
| 		} | ||||
| 	} | ||||
|  |  | |||
|  | @ -71,10 +71,16 @@ | |||
| 
 | ||||
| 				const latLng = new google.maps.LatLng( lat, lng ); | ||||
| 
 | ||||
| 				if ( peopleObj[i]['golden'] ) { | ||||
| 					iconFile = '/wp-content/themes/cncf-twenty-two/images/map-markers/person-golden.svg'; | ||||
| 				} else { | ||||
| 					iconFile = '/wp-content/themes/cncf-twenty-two/images/map-markers/person.svg'; | ||||
| 				} | ||||
| 
 | ||||
| 				const marker = new google.maps.Marker( | ||||
| 					{ | ||||
| 						position: latLng, | ||||
| 						icon: '/wp-content/themes/cncf-twenty-two/images/map-markers/person.svg', | ||||
| 						icon: iconFile, | ||||
| 					} | ||||
| 				); | ||||
| 
 | ||||
|  |  | |||
|  | @ -11,7 +11,7 @@ | |||
| 	align-items: flex-start; | ||||
| 	background-color: $white; | ||||
| 	box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1); | ||||
| 	border-radius: 3px; | ||||
| 	border-radius: 5px; | ||||
| 
 | ||||
| 	button.button-reset { | ||||
| 		width: 100%; | ||||
|  | @ -282,3 +282,11 @@ | |||
| 		} | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| .golden-kubestronaut .person__name { | ||||
| 	color: #9c8435; | ||||
| } | ||||
| 
 | ||||
| .golden-kubestronaut.person { | ||||
| 	border: 2px #d8c68d solid; | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue