mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-17 15:45:44 +03:00
Build: 7dc7e421ae
This commit is contained in:
parent
7dc7e421ae
commit
5f016b5491
34 changed files with 891 additions and 12 deletions
17
themes/wporg-5ftf-2024/build/my-pledge-list/block.json
Normal file
17
themes/wporg-5ftf-2024/build/my-pledge-list/block.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 2,
|
||||
"name": "wporg/my-pledge-list",
|
||||
"version": "1.0.0-7dc7e42",
|
||||
"title": "My pledges",
|
||||
"category": "design",
|
||||
"icon": "",
|
||||
"description": "List out the pledges for this user.",
|
||||
"textdomain": "wporg",
|
||||
"supports": {
|
||||
"html": false
|
||||
},
|
||||
"editorScript": "file:./index.js",
|
||||
"style": "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' => '8a66cc955de2db1bbef8');
|
1
themes/wporg-5ftf-2024/build/my-pledge-list/index.js
Normal file
1
themes/wporg-5ftf-2024/build/my-pledge-list/index.js
Normal file
|
@ -0,0 +1 @@
|
|||
(()=>{"use strict";var r,e={620:(r,e,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/my-pledge-list"}'),l=window.ReactJSXRuntime;(0,o.registerBlockType)(a.UU,{edit:({attributes:r,name:e})=>{const t=(0,n.useBlockProps)();return(0,l.jsx)("div",{...t,children:(0,l.jsx)(s(),{block:e,attributes:r,skipBlockSupportAttributes:!0})})},save:()=>null})}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.m=e,r=[],o.O=(e,t,n,i)=>{if(!t){var s=1/0;for(u=0;u<r.length;u++){t=r[u][0],n=r[u][1],i=r[u][2];for(var a=!0,l=0;l<t.length;l++)(!1&i||s>=i)&&Object.keys(o.O).every((r=>o.O[r](t[l])))?t.splice(l--,1):(a=!1,i<s&&(s=i));if(a){r.splice(u--,1);var p=n();void 0!==p&&(e=p)}}return e}i=i||0;for(var u=r.length;u>0&&r[u-1][2]>i;u--)r[u]=r[u-1];r[u]=[t,n,i]},o.n=r=>{var e=r&&r.__esModule?()=>r.default:()=>r;return o.d(e,{a:e}),e},o.d=(r,e)=>{for(var t in e)o.o(e,t)&&!o.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})},o.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={23:0,743:0};o.O.j=e=>0===r[e];var e=(e,t)=>{var n,i,s=t[0],a=t[1],l=t[2],p=0;if(s.some((e=>0!==r[e]))){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(l)var u=l(o)}for(e&&e(t);p<s.length;p++)i=s[p],o.o(r,i)&&r[i]&&r[i][0](),r[i]=0;return o.O(u)},t=self.webpackChunkwporg_5ftf_2024=self.webpackChunkwporg_5ftf_2024||[];t.forEach(e.bind(null,0)),t.push=e.bind(null,t.push.bind(t))})();var n=o.O(void 0,[743],(()=>o(620)));n=o.O(n)})();
|
103
themes/wporg-5ftf-2024/build/my-pledge-list/render.php
Normal file
103
themes/wporg-5ftf-2024/build/my-pledge-list/render.php
Normal file
|
@ -0,0 +1,103 @@
|
|||
<?php
|
||||
/**
|
||||
* Render the pledge list for the current user.
|
||||
* Mostly copied from Contributor\render_my_pledges, updated markup to use blocks.
|
||||
*/
|
||||
|
||||
use WordPressDotOrg\FiveForTheFuture\{ Contributor, XProfile };
|
||||
use function WordPressdotorg\Theme\FiveForTheFuture_2024\My_Pledge_List\{render_single_pledge, render_notice};
|
||||
use const WordPressDotOrg\FiveForTheFuture\Contributor\CPT_ID as CONTRIBUTOR_POST_TYPE;
|
||||
|
||||
if ( ! is_user_logged_in() ) {
|
||||
render_notice( 'warning', sprintf(
|
||||
__( 'Please <a href="%s">log in to your WordPress.org account</a> in order to view your pledges.', 'wporg-5ftf' ),
|
||||
esc_url( wp_login_url( get_permalink() ) )
|
||||
) );
|
||||
return;
|
||||
}
|
||||
|
||||
$user = wp_get_current_user();
|
||||
$profile_data = XProfile\get_contributor_user_data( $user->ID );
|
||||
$pledge_url = get_permalink( get_page_by_path( 'for-organizations' ) );
|
||||
$success_message = Contributor\process_my_pledges_form();
|
||||
|
||||
$contributor_pending_posts = get_posts( array(
|
||||
'title' => $user->user_login,
|
||||
'post_type' => CONTRIBUTOR_POST_TYPE,
|
||||
'post_status' => array( 'pending' ),
|
||||
'numberposts' => 100,
|
||||
) );
|
||||
|
||||
$contributor_publish_posts = get_posts( array(
|
||||
'title' => $user->user_login,
|
||||
'post_type' => CONTRIBUTOR_POST_TYPE,
|
||||
'post_status' => array( 'publish' ),
|
||||
'numberposts' => 100,
|
||||
) );
|
||||
|
||||
$has_contributions = $contributor_pending_posts || $contributor_publish_posts;
|
||||
$has_profile_data = $profile_data['hours_per_week'] && $profile_data['team_names'];
|
||||
|
||||
?>
|
||||
<div
|
||||
<?php echo get_block_wrapper_attributes(); // phpcs:ignore ?>
|
||||
>
|
||||
<?php
|
||||
if ( $success_message ) {
|
||||
render_notice( 'success', $success_message );
|
||||
echo '<div style="margin-top:var(--wp--preset--spacing--40);height:0" aria-hidden="true" class="wp-block-spacer"></div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( $has_contributions ) : ?>
|
||||
|
||||
<?php if ( $contributor_publish_posts ) : ?>
|
||||
<h2 class="screen-reader-text"><?php esc_html_e( 'Pledges', 'wporg-5ftf' ); ?></h2>
|
||||
|
||||
<div class="my-pledges__list">
|
||||
<?php
|
||||
foreach ( $contributor_publish_posts as $contributor_post ) {
|
||||
render_single_pledge( $contributor_post, $has_profile_data );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $contributor_pending_posts ) : ?>
|
||||
|
||||
<h2><?php esc_html_e( 'Pending Pledges', 'wporg-5ftf' ); ?></h2>
|
||||
|
||||
<div class="my-pledges__list is-pending-list">
|
||||
<?php
|
||||
if ( ! $has_profile_data ) {
|
||||
render_notice(
|
||||
'warning',
|
||||
sprintf(
|
||||
__( 'You need to <a href="%s">update your profile</a> before joining an organization.', 'wporg-5ftf' ),
|
||||
'https://profiles.wordpress.org/me/profile/edit/group/5/'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
foreach ( $contributor_pending_posts as $contributor_post ) {
|
||||
render_single_pledge( $contributor_post, $has_profile_data );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses_data( sprintf(
|
||||
__( 'You don’t currently have any sponsorships. If your employer is sponsoring part of your time to contribute to WordPress, please ask them to <a href="%s">submit a pledge</a> and list you as a contributor.', 'wporg-5ftf' ),
|
||||
esc_url( $pledge_url )
|
||||
) );
|
||||
?>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
|
@ -0,0 +1 @@
|
|||
.wp-block-wporg-my-pledge-list>p{max-width:var(--wp--custom--layout--content-size)}.wp-block-wporg-my-pledge-list .my-pledges__list>*+*{margin-top:var(--wp--preset--spacing--60)}.wp-block-wporg-my-pledge-list .my-pledges__list.is-pending-list>.wp-block-wporg-notice{margin-top:var(--wp--preset--spacing--20)}.wp-block-wporg-my-pledge-list>h2{margin-top:80px!important}@media(max-width:600px){.wp-block-wporg-my-pledge-list>h2{margin-top:40px!important}}.wp-block-wporg-my-pledge-list .my-pledges__pledge-actions form{display:flex;flex-wrap:wrap;gap:var(--wp--preset--spacing--20)}.wp-block-wporg-my-pledge-list .my-pledges__pledge-actions .wp-block-button{display:inline-block}.wp-block-wporg-my-pledge-list .my-pledges__pledge-actions .wp-block-button [disabled=disabled]{--wp--custom--button--color--background:var(--wp--preset--color--blueberry-2);pointer-events:none}
|
|
@ -0,0 +1 @@
|
|||
.wp-block-wporg-my-pledge-list>p{max-width:var(--wp--custom--layout--content-size)}.wp-block-wporg-my-pledge-list .my-pledges__list>*+*{margin-top:var(--wp--preset--spacing--60)}.wp-block-wporg-my-pledge-list .my-pledges__list.is-pending-list>.wp-block-wporg-notice{margin-top:var(--wp--preset--spacing--20)}.wp-block-wporg-my-pledge-list>h2{margin-top:80px!important}@media(max-width:600px){.wp-block-wporg-my-pledge-list>h2{margin-top:40px!important}}.wp-block-wporg-my-pledge-list .my-pledges__pledge-actions form{display:flex;flex-wrap:wrap;gap:var(--wp--preset--spacing--20)}.wp-block-wporg-my-pledge-list .my-pledges__pledge-actions .wp-block-button{display:inline-block}.wp-block-wporg-my-pledge-list .my-pledges__pledge-actions .wp-block-button [disabled=disabled]{--wp--custom--button--color--background:var(--wp--preset--color--blueberry-2);pointer-events:none}
|
21
themes/wporg-5ftf-2024/build/pledge-contributors/block.json
Normal file
21
themes/wporg-5ftf-2024/build/pledge-contributors/block.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 2,
|
||||
"name": "wporg/pledge-contributors",
|
||||
"version": "1.0.0-7dc7e42",
|
||||
"title": "Pledge contributors",
|
||||
"category": "design",
|
||||
"icon": "",
|
||||
"description": "List out the contributors for this organization's pledge.",
|
||||
"textdomain": "wporg",
|
||||
"supports": {
|
||||
"html": false
|
||||
},
|
||||
"usesContext": [
|
||||
"postId",
|
||||
"postType"
|
||||
],
|
||||
"editorScript": "file:./index.js",
|
||||
"style": "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' => 'd5ac64c46f40b9fd623c');
|
|
@ -0,0 +1 @@
|
|||
(()=>{"use strict";var r,e={687:(r,e,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-contributors"}'),l=window.ReactJSXRuntime;(0,o.registerBlockType)(a.UU,{edit:({attributes:r,name:e})=>{const t=(0,n.useBlockProps)();return(0,l.jsx)("div",{...t,children:(0,l.jsx)(s(),{block:e,attributes:r,skipBlockSupportAttributes:!0})})},save:()=>null})}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.m=e,r=[],o.O=(e,t,n,i)=>{if(!t){var s=1/0;for(u=0;u<r.length;u++){t=r[u][0],n=r[u][1],i=r[u][2];for(var a=!0,l=0;l<t.length;l++)(!1&i||s>=i)&&Object.keys(o.O).every((r=>o.O[r](t[l])))?t.splice(l--,1):(a=!1,i<s&&(s=i));if(a){r.splice(u--,1);var p=n();void 0!==p&&(e=p)}}return e}i=i||0;for(var u=r.length;u>0&&r[u-1][2]>i;u--)r[u]=r[u-1];r[u]=[t,n,i]},o.n=r=>{var e=r&&r.__esModule?()=>r.default:()=>r;return o.d(e,{a:e}),e},o.d=(r,e)=>{for(var t in e)o.o(e,t)&&!o.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})},o.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={102:0,394:0};o.O.j=e=>0===r[e];var e=(e,t)=>{var n,i,s=t[0],a=t[1],l=t[2],p=0;if(s.some((e=>0!==r[e]))){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(l)var u=l(o)}for(e&&e(t);p<s.length;p++)i=s[p],o.o(r,i)&&r[i]&&r[i][0](),r[i]=0;return o.O(u)},t=self.webpackChunkwporg_5ftf_2024=self.webpackChunkwporg_5ftf_2024||[];t.forEach(e.bind(null,0)),t.push=e.bind(null,t.push.bind(t))})();var n=o.O(void 0,[394],(()=>o(687)));n=o.O(n)})();
|
50
themes/wporg-5ftf-2024/build/pledge-contributors/render.php
Normal file
50
themes/wporg-5ftf-2024/build/pledge-contributors/render.php
Normal file
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
use WordPressDotOrg\FiveForTheFuture\Contributor;
|
||||
use const WordPressdotorg\Theme\FiveForTheFuture_2024\Pledge_Contributors\TRUNCATED_MAX;
|
||||
|
||||
if ( ! $block->context['postId'] ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$contributors = Contributor\get_contributor_user_objects(
|
||||
Contributor\get_pledge_contributors( $block->context['postId'], 'publish' )
|
||||
);
|
||||
|
||||
$is_truncated = isset( $attributes['className'] ) && str_contains( $attributes['className'], 'is-style-truncated' );
|
||||
|
||||
// Initialize count to zero for untruncated view.
|
||||
$count_more = 0;
|
||||
|
||||
// Set avatar size at smallest usage in px.
|
||||
$avatar_size = 70;
|
||||
|
||||
if ( $is_truncated ) {
|
||||
$count_more = count( $contributors ) - TRUNCATED_MAX;
|
||||
$contributors = array_splice( $contributors, 0, TRUNCATED_MAX );
|
||||
$avatar_size = 30;
|
||||
}
|
||||
|
||||
?>
|
||||
<div
|
||||
<?php echo get_block_wrapper_attributes(); // phpcs:ignore ?>
|
||||
>
|
||||
<?php if ( ! empty( $contributors ) ) : ?>
|
||||
<ul class="pledge-contributors">
|
||||
<?php foreach ( $contributors as $contributor ) : ?>
|
||||
<li class="pledge-contributor">
|
||||
<span class="pledge-contributor__avatar">
|
||||
<a href="<?php echo esc_url( 'https://profiles.wordpress.org/' . $contributor->user_nicename . '/' ); ?>">
|
||||
<?php echo get_avatar( $contributor->user_email, $avatar_size, 'mystery', $contributor->display_name ); ?>
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
<?php if ( $count_more > 0 ) : ?>
|
||||
<li class="pledge-contributors__more"><?php echo '+' . esc_html( $count_more ); ?></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
<?php else : ?>
|
||||
<p class="pledge-no-contributors"><?php esc_html_e( 'No confirmed contributors yet.', 'wporg-5ftf' ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
|
@ -0,0 +1 @@
|
|||
.wp-block-wporg-pledge-contributors{--wporg-pledge-contributors--spacing--size:70px;--wporg-pledge-contributors--spacing--block-gap:var(--wp--preset--spacing--10)}.wp-block-wporg-pledge-contributors ul{align-content:center;display:flex;flex-wrap:wrap;gap:var(--wporg-pledge-contributors--spacing--block-gap);list-style:none;padding-right:0}.wp-block-wporg-pledge-contributors li{height:var(--wporg-pledge-contributors--spacing--size);width:var(--wporg-pledge-contributors--spacing--size)}.wp-block-wporg-pledge-contributors .pledge-contributor__avatar a{background:var(--wp--preset--color--light-grey-2);border-radius:50%;display:inline-block}.wp-block-wporg-pledge-contributors .pledge-contributor__avatar a:focus{box-shadow:0 0 0 3px var(--wp--preset--color--blueberry-1);outline:1.5px solid var(--wp--preset--color--white)}.wp-block-wporg-pledge-contributors .pledge-contributor__avatar a img{border-radius:50%;display:block;height:auto;max-width:100%}.wp-block-wporg-pledge-contributors .pledge-contributors__more{align-content:center;width:45px}.wp-block-wporg-pledge-contributors .pledge-contributors__more,.wp-block-wporg-pledge-contributors .pledge-no-contributors{font-size:var(--wp--preset--font-size--small);line-height:var(--wp--custom--body--small--typography--line-height)}.wp-block-wporg-pledge-contributors.is-style-truncated{--wporg-pledge-contributors--spacing--size:30px;--wporg-pledge-contributors--spacing--block-gap:4px}
|
|
@ -0,0 +1 @@
|
|||
.wp-block-wporg-pledge-contributors{--wporg-pledge-contributors--spacing--size:70px;--wporg-pledge-contributors--spacing--block-gap:var(--wp--preset--spacing--10)}.wp-block-wporg-pledge-contributors ul{align-content:center;display:flex;flex-wrap:wrap;gap:var(--wporg-pledge-contributors--spacing--block-gap);list-style:none;padding-left:0}.wp-block-wporg-pledge-contributors li{height:var(--wporg-pledge-contributors--spacing--size);width:var(--wporg-pledge-contributors--spacing--size)}.wp-block-wporg-pledge-contributors .pledge-contributor__avatar a{background:var(--wp--preset--color--light-grey-2);border-radius:50%;display:inline-block}.wp-block-wporg-pledge-contributors .pledge-contributor__avatar a:focus{box-shadow:0 0 0 3px var(--wp--preset--color--blueberry-1);outline:1.5px solid var(--wp--preset--color--white)}.wp-block-wporg-pledge-contributors .pledge-contributor__avatar a img{border-radius:50%;display:block;height:auto;max-width:100%}.wp-block-wporg-pledge-contributors .pledge-contributors__more{align-content:center;width:45px}.wp-block-wporg-pledge-contributors .pledge-contributors__more,.wp-block-wporg-pledge-contributors .pledge-no-contributors{font-size:var(--wp--preset--font-size--small);line-height:var(--wp--custom--body--small--typography--line-height)}.wp-block-wporg-pledge-contributors.is-style-truncated{--wporg-pledge-contributors--spacing--size:30px;--wporg-pledge-contributors--spacing--block-gap:4px}
|
20
themes/wporg-5ftf-2024/build/pledge-edit-button/block.json
Normal file
20
themes/wporg-5ftf-2024/build/pledge-edit-button/block.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 2,
|
||||
"name": "wporg/pledge-edit-button",
|
||||
"version": "1.0.0-7dc7e42",
|
||||
"title": "Edit pledge button",
|
||||
"category": "design",
|
||||
"icon": "",
|
||||
"description": "Render the pledge edit button and form.",
|
||||
"textdomain": "wporg",
|
||||
"supports": {
|
||||
"html": false
|
||||
},
|
||||
"usesContext": [
|
||||
"postId",
|
||||
"postType"
|
||||
],
|
||||
"editorScript": "file:./index.js",
|
||||
"style": "file:./style-index.css"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks'), 'version' => '991b4c260ce2a74e87cc');
|
1
themes/wporg-5ftf-2024/build/pledge-edit-button/index.js
Normal file
1
themes/wporg-5ftf-2024/build/pledge-edit-button/index.js
Normal file
|
@ -0,0 +1 @@
|
|||
(()=>{"use strict";var r,e={49:()=>{const r=window.wp.blocks,e=window.wp.blockEditor,o=JSON.parse('{"UU":"wporg/pledge-edit-button"}'),t=window.ReactJSXRuntime;(0,r.registerBlockType)(o.UU,{edit:()=>{const r=(0,e.useBlockProps)();return(0,t.jsx)("div",{...r,children:(0,t.jsx)("button",{children:"Edit Pledge"})})},save:()=>null})}},o={};function t(r){var n=o[r];if(void 0!==n)return n.exports;var i=o[r]={exports:{}};return e[r](i,i.exports,t),i.exports}t.m=e,r=[],t.O=(e,o,n,i)=>{if(!o){var s=1/0;for(c=0;c<r.length;c++){o=r[c][0],n=r[c][1],i=r[c][2];for(var l=!0,p=0;p<o.length;p++)(!1&i||s>=i)&&Object.keys(t.O).every((r=>t.O[r](o[p])))?o.splice(p--,1):(l=!1,i<s&&(s=i));if(l){r.splice(c--,1);var a=n();void 0!==a&&(e=a)}}return e}i=i||0;for(var c=r.length;c>0&&r[c-1][2]>i;c--)r[c]=r[c-1];r[c]=[o,n,i]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={639:0,839:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var n,i,s=o[0],l=o[1],p=o[2],a=0;if(s.some((e=>0!==r[e]))){for(n in l)t.o(l,n)&&(t.m[n]=l[n]);if(p)var c=p(t)}for(e&&e(o);a<s.length;a++)i=s[a],t.o(r,i)&&r[i]&&r[i][0](),r[i]=0;return t.O(c)},o=self.webpackChunkwporg_5ftf_2024=self.webpackChunkwporg_5ftf_2024||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})();var n=t.O(void 0,[839],(()=>t(49)));n=t.O(n)})();
|
|
@ -0,0 +1 @@
|
|||
.edit-pledge-wrapper .wp-block-button__link[aria-expanded=true]{background-color:var(--wp--preset--color--charcoal-1)!important;color:var(--wp--preset--color--white)!important}.edit-pledge-wrapper .wp-block-button__link .dashicons{display:none}.pledge-dialog{background:#fff;border:1px solid var(--wp--preset--color--light-grey-1);margin-top:var(--wp--preset--spacing--10);padding:var(--wp--preset--spacing--20);position:absolute;width:25rem;z-index:252}.pledge-dialog[hidden]{display:none}.pledge-dialog .pledge-dialog__close{background:none;border:none;padding:var(--wp--preset--spacing--10);position:absolute;left:0;text-decoration:none;top:0}@media(max-width:889px){.pledge-dialog{right:var(--wp--preset--spacing--30)!important;position:fixed;left:var(--wp--preset--spacing--30)!important;top:80px!important;width:calc(100% - var(--wp--preset--spacing--30)*2);z-index:251}}@media(max-width:600px){.pledge-dialog{top:var(--wp--preset--spacing--30)!important}}.pledge-dialog__background{bottom:0;right:0;position:fixed;left:0;top:0;z-index:251}.pledge-dialog__background[hidden]{display:none}@media(max-width:889px){.pledge-dialog__background{background-color:rgba(0,0,0,.15)}}
|
|
@ -0,0 +1 @@
|
|||
.edit-pledge-wrapper .wp-block-button__link[aria-expanded=true]{background-color:var(--wp--preset--color--charcoal-1)!important;color:var(--wp--preset--color--white)!important}.edit-pledge-wrapper .wp-block-button__link .dashicons{display:none}.pledge-dialog{background:#fff;border:1px solid var(--wp--preset--color--light-grey-1);margin-top:var(--wp--preset--spacing--10);padding:var(--wp--preset--spacing--20);position:absolute;width:25rem;z-index:252}.pledge-dialog[hidden]{display:none}.pledge-dialog .pledge-dialog__close{background:none;border:none;padding:var(--wp--preset--spacing--10);position:absolute;right:0;text-decoration:none;top:0}@media(max-width:889px){.pledge-dialog{left:var(--wp--preset--spacing--30)!important;position:fixed;right:var(--wp--preset--spacing--30)!important;top:80px!important;width:calc(100% - var(--wp--preset--spacing--30)*2);z-index:251}}@media(max-width:600px){.pledge-dialog{top:var(--wp--preset--spacing--30)!important}}.pledge-dialog__background{bottom:0;left:0;position:fixed;right:0;top:0;z-index:251}.pledge-dialog__background[hidden]{display:none}@media(max-width:889px){.pledge-dialog__background{background-color:rgba(0,0,0,.15)}}
|
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
3
themes/wporg-5ftf-2024/build/style/block.json
Normal file
3
themes/wporg-5ftf-2024/build/style/block.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"script": "file:./index.js"
|
||||
}
|
1
themes/wporg-5ftf-2024/build/style/index.asset.php
Normal file
1
themes/wporg-5ftf-2024/build/style/index.asset.php
Normal file
|
@ -0,0 +1 @@
|
|||
<?php return array('dependencies' => array(), 'version' => 'e222032fd598e566b9da');
|
1
themes/wporg-5ftf-2024/build/style/index.js
Normal file
1
themes/wporg-5ftf-2024/build/style/index.js
Normal file
|
@ -0,0 +1 @@
|
|||
(()=>{"use strict";var r,e={587:()=>{}},o={};function t(r){var n=o[r];if(void 0!==n)return n.exports;var f=o[r]={exports:{}};return e[r](f,f.exports,t),f.exports}t.m=e,r=[],t.O=(e,o,n,f)=>{if(!o){var a=1/0;for(s=0;s<r.length;s++){o=r[s][0],n=r[s][1],f=r[s][2];for(var i=!0,v=0;v<o.length;v++)(!1&f||a>=f)&&Object.keys(t.O).every((r=>t.O[r](o[v])))?o.splice(v--,1):(i=!1,f<a&&(a=f));if(i){r.splice(s--,1);var p=n();void 0!==p&&(e=p)}}return e}f=f||0;for(var s=r.length;s>0&&r[s-1][2]>f;s--)r[s]=r[s-1];r[s]=[o,n,f]},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={571:0,835:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var n,f,a=o[0],i=o[1],v=o[2],p=0;if(a.some((e=>0!==r[e]))){for(n in i)t.o(i,n)&&(t.m[n]=i[n]);if(v)var s=v(t)}for(e&&e(o);p<a.length;p++)f=a[p],t.o(r,f)&&r[f]&&r[f][0](),r[f]=0;return t.O(s)},o=self.webpackChunkwporg_5ftf_2024=self.webpackChunkwporg_5ftf_2024||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})();var n=t.O(void 0,[835],(()=>t(587)));n=t.O(n)})();
|
1
themes/wporg-5ftf-2024/build/style/style-index-rtl.css
Normal file
1
themes/wporg-5ftf-2024/build/style/style-index-rtl.css
Normal file
File diff suppressed because one or more lines are too long
1
themes/wporg-5ftf-2024/build/style/style-index.css
Normal file
1
themes/wporg-5ftf-2024/build/style/style-index.css
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue