mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-20 16:55:44 +03:00
Build: 7dc7e421ae
This commit is contained in:
parent
7dc7e421ae
commit
5f016b5491
34 changed files with 891 additions and 12 deletions
24
themes/wporg-5ftf-2024/build/pledge-teams/block.json
Normal file
24
themes/wporg-5ftf-2024/build/pledge-teams/block.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 2,
|
||||
"name": "wporg/pledge-teams",
|
||||
"version": "1.0.0-7dc7e42",
|
||||
"title": "Pledge teams",
|
||||
"category": "design",
|
||||
"icon": "",
|
||||
"description": "List out the teams supported by this organization's pledge.",
|
||||
"textdomain": "wporg",
|
||||
"supports": {
|
||||
"html": false
|
||||
},
|
||||
"usesContext": [
|
||||
"postId",
|
||||
"postType"
|
||||
],
|
||||
"editorScript": "file:./index.js",
|
||||
"style": [
|
||||
"dashicons",
|
||||
"file:./style-index.css"
|
||||
],
|
||||
"render": "file:./render.php"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-server-side-render'), 'version' => '8ffaca1c0209a84179ff');
|
1
themes/wporg-5ftf-2024/build/pledge-teams/index.js
Normal file
1
themes/wporg-5ftf-2024/build/pledge-teams/index.js
Normal file
|
@ -0,0 +1 @@
|
|||
(()=>{"use strict";var e,r={911:(e,r,t)=>{const o=window.wp.blocks,n=window.wp.blockEditor,i=window.wp.serverSideRender;var s=t.n(i);const a=JSON.parse('{"UU":"wporg/pledge-teams"}'),l=window.ReactJSXRuntime;(0,o.registerBlockType)(a.UU,{edit:({attributes:e,name:r})=>{const t=(0,n.useBlockProps)();return(0,l.jsx)("div",{...t,children:(0,l.jsx)(s(),{block:r,attributes:e,skipBlockSupportAttributes:!0})})},save:()=>null})}},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,e=[],o.O=(r,t,n,i)=>{if(!t){var s=1/0;for(u=0;u<e.length;u++){t=e[u][0],n=e[u][1],i=e[u][2];for(var a=!0,l=0;l<t.length;l++)(!1&i||s>=i)&&Object.keys(o.O).every((e=>o.O[e](t[l])))?t.splice(l--,1):(a=!1,i<s&&(s=i));if(a){e.splice(u--,1);var p=n();void 0!==p&&(r=p)}}return r}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[t,n,i]},o.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return o.d(r,{a:r}),r},o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={36:0,340:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var n,i,s=t[0],a=t[1],l=t[2],p=0;if(s.some((r=>0!==e[r]))){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(l)var u=l(o)}for(r&&r(t);p<s.length;p++)i=s[p],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(u)},t=self.webpackChunkwporg_5ftf_2024=self.webpackChunkwporg_5ftf_2024||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var n=o.O(void 0,[340],(()=>o(911)));n=o.O(n)})();
|
26
themes/wporg-5ftf-2024/build/pledge-teams/render.php
Normal file
26
themes/wporg-5ftf-2024/build/pledge-teams/render.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
use WordPressDotOrg\FiveForTheFuture\XProfile;
|
||||
|
||||
if ( ! $block->context['postId'] ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$contribution_data = XProfile\get_aggregate_contributor_data_for_pledge( $block->context['postId'] );
|
||||
|
||||
?>
|
||||
<div
|
||||
<?php echo get_block_wrapper_attributes(); // phpcs:ignore ?>
|
||||
>
|
||||
<ul class="team-grid">
|
||||
<?php foreach ( $contribution_data['teams'] as $team ) :
|
||||
$badge_classes = XProfile\get_association_classes( $team );
|
||||
?>
|
||||
<li>
|
||||
<div class="badge item dashicons <?php echo esc_attr( implode( ' ', $badge_classes ) ); ?>"></div>
|
||||
<span class="badge-label"><?php echo esc_html( $team ); ?></span>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<p class="has-small-font-size"><a href="https://make.wordpress.org/"><?php esc_html_e( 'Learn more about contributor teams', 'wporg-5ftf' ); ?></a></p>
|
||||
</div>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue