mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-21 02:23:43 +03:00

This updates the display of contributors into a table view, and adds the ability to add and remove contributors to existing pledges. The display has been refactored to use JS templates & JSON contributor data– the data is output onto the page when loaded from the server, and rendered when the page finishes loading. Adding & removing contributors now submits to an admin-ajax.php endpoint, which, if successful, return the new list of contributors. This ensures the display is always up to date. Fixes #3
53 lines
1.6 KiB
PHP
53 lines
1.6 KiB
PHP
<?php
|
||
|
||
namespace WordPressDotOrg\FiveForTheFuture\View;
|
||
use WP_Post;
|
||
|
||
/**
|
||
* @var array $data
|
||
* @var bool $readonly
|
||
* @var WP_Post $pledge
|
||
*/
|
||
|
||
?>
|
||
|
||
<div class="form-field">
|
||
<label for="5ftf-pledge-email">
|
||
<?php esc_html_e( 'Administrator Email Address', 'wordpressorg' ); ?>
|
||
</label>
|
||
<input
|
||
type="email"
|
||
id="5ftf-pledge-email"
|
||
name="org-pledge-email"
|
||
placeholder="wordpress-contributors@example.com"
|
||
value="<?php echo esc_attr( $data['org-pledge-email'] ); ?>"
|
||
required
|
||
aria-describedby="5ftf-pledge-email-help"
|
||
<?php echo $readonly ? 'readonly' : ''; ?>
|
||
/>
|
||
<p id="5ftf-pledge-email-help">
|
||
<?php esc_html_e( "This address will be used to confirm your organization’s contribution profile, and later manage any changes. Please make sure that it's a group address (e.g., wp-contributors@example.com) so that it persists across employee transitions.", 'wordpressorg' ); ?>
|
||
</p>
|
||
|
||
<?php if ( is_admin() ) : ?>
|
||
<?php if ( $data['pledge-email-confirmed'] ) : ?>
|
||
<p class="email-status is-confirmed">
|
||
<span class="dashicons dashicons-yes-alt" aria-hidden="true"></span>
|
||
<?php esc_html_e( 'Confirmed', 'wporg' ); ?>
|
||
</p>
|
||
<?php else : ?>
|
||
<p class="email-status is-unconfirmed">
|
||
<span class="dashicons dashicons-warning" aria-hidden="true"></span>
|
||
<?php esc_html_e( 'Unconfirmed', 'wporg' ); ?>
|
||
</p>
|
||
<?php submit_button(
|
||
'Resend Confirmation',
|
||
'secondary',
|
||
'resend-pledge-confirmation',
|
||
false,
|
||
array( 'formaction' => add_query_arg( 'resend-pledge-id', $pledge->ID ) )
|
||
); ?>
|
||
<?php endif; ?>
|
||
<?php endif; ?>
|
||
</div>
|