From 174a0381d63b25e17f52ee4751b9b1c48c46c983 Mon Sep 17 00:00:00 2001 From: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Date: Thu, 17 Mar 2022 15:13:24 -0700 Subject: [PATCH] Theme: Add support for Openverse team, fix Themes Team badge This syncs `r17406-dotorg` to the canonical Git repo. --- plugins/wporg-5ftf/includes/xprofile.php | 11 +++++++++++ themes/wporg-5ftf/css/components/_team-badges.scss | 8 ++++++++ themes/wporg-5ftf/functions.php | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/plugins/wporg-5ftf/includes/xprofile.php b/plugins/wporg-5ftf/includes/xprofile.php index 030664b..af3abd6 100644 --- a/plugins/wporg-5ftf/includes/xprofile.php +++ b/plugins/wporg-5ftf/includes/xprofile.php @@ -120,6 +120,17 @@ function get_aggregate_contributor_data_for_pledge( $pledge_id ) { return $carry; }, $initial ); + $aggregate_data['teams'] = array_map( + function( $team ) { + // Fix for renamed team. + if ( 'Theme Review Team' === $team ) { + $team = 'Themes Team'; + } + + return $team; + }, + $aggregate_data['teams'] + ); $aggregate_data['teams'] = array_unique( $aggregate_data['teams'] ); sort( $aggregate_data['teams'] ); diff --git a/themes/wporg-5ftf/css/components/_team-badges.scss b/themes/wporg-5ftf/css/components/_team-badges.scss index d260e36..d2289fb 100644 --- a/themes/wporg-5ftf/css/components/_team-badges.scss +++ b/themes/wporg-5ftf/css/components/_team-badges.scss @@ -123,6 +123,14 @@ color: rgb(251, 161, 108); } +.badge-openverse { + background: rgba(103, 74, 255, 0.25); + box-shadow: 0 0 0 4px rgb(103, 74, 255); +} +.badge-openverse:before { + color: rgb(103, 74, 255); +} + .badge-training{ background: rgba(233, 192, 45, 0.25); box-shadow: 0 0 0 4px rgb(233, 192, 45); diff --git a/themes/wporg-5ftf/functions.php b/themes/wporg-5ftf/functions.php index c2112fc..c769c1f 100644 --- a/themes/wporg-5ftf/functions.php +++ b/themes/wporg-5ftf/functions.php @@ -265,6 +265,10 @@ function get_badge_classes( $team ) { $classes = array( 'badge-mobile', 'dashicons-smartphone' ); break; + case 'openverse team': + $classes = array( 'badge-openverse', 'dashicons-search' ); + break; + case 'polyglots team': $classes = array( 'badge-translation-editor', 'dashicons-translation' ); break; @@ -277,6 +281,7 @@ function get_badge_classes( $team ) { $classes = array( 'badge-test-team', 'dashicons-desktop' ); break; + case 'themes team': case 'theme review team': $classes = array( 'badge-themes-reviewer', 'dashicons-admin-appearance' ); break;