Skip to content

Commit

Permalink
Add Golden Kubestronaut capability
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Abraham <[email protected]>
  • Loading branch information
cjyabraham committed Dec 3, 2024
1 parent e0b9ea7 commit 7bb3a57
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
'singular_name' => __( 'Person' ),
'all_items' => __( 'All People' ),
),
'public' => false,
'public' => true,
'has_archive' => false,
'show_in_nav_menus' => false,
'show_in_rest' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@

$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 ) :
Expand Down Expand Up @@ -200,7 +205,7 @@ class="js-modal button-reset modal-<?php echo esc_html( $person_slug ); ?>">
?>
<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"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,20 @@ 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,
'lng' => $lng,
'name' => get_the_title(),
'slug' => $post->post_name,
'id' => get_the_ID(),
'golden' => $golden,
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,7 @@
}
}
}

.golden-kubestronaut .person__name {
color: #9c8435;
}

0 comments on commit 7bb3a57

Please sign in to comment.