Manage a Pledge: Enable adding/removing contributors from wp-admin. (#99)

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
This commit is contained in:
Kelly Dwan 2019-11-20 11:01:00 -05:00 committed by GitHub
parent f32d26ef47
commit 82192eea4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 437 additions and 73 deletions

View file

@ -31,11 +31,15 @@ use WP_Post;
<?php if ( is_admin() ) : ?>
<?php if ( $data['pledge-email-confirmed'] ) : ?>
<span class="dashicons dashicons-yes-alt" aria-hidden="true"></span>
<?php esc_html_e( 'Confirmed', 'wporg' ); ?>
<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 : ?>
<span class="dashicons dashicons-warning" aria-hidden="true"></span>
<?php esc_html_e( 'Unconfirmed', 'wporg' ); ?>
<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',