Pledge Management: Allow pledge admins to remove the pledge (#123)

* Rename generic "frontend" file to dialog

* Add a "remove pledge" action

* Process pledge deactivation

* Trigger an email on user-initiated pledge deactivation

* Show an error when trying to manage a deactivated pledge

* Add a label for "deactivated" pledges
This commit is contained in:
Kelly Dwan 2019-12-10 14:07:48 -05:00 committed by GitHub
parent 619af97bd1
commit bdbf6d573e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 184 additions and 26 deletions

View file

@ -0,0 +1,31 @@
<?php
namespace WordPressDotOrg\FiveForTheFuture\View;
/**
* @var bool $can_view_form
* @var int $pledge_id
* @var string $auth_token
*/
?>
<hr />
<form class="pledge-form" id="5ftf-form-pledge-remove" action="" method="post">
<h2><?php esc_html_e( 'Remove Pledge', 'wporg-5ftf' ); ?></h2>
<p>
<?php esc_html_e( 'This will remove your pledge from the Five for the Future listing. You will not be able to reactivate it or submit a new pledge for this company.', 'wporg-5ftf' ); ?>
</p>
<p>
<?php wp_nonce_field( 'remove_pledge_' . $pledge_id ); ?>
<input type="hidden" name="action" value="remove-pledge" />
<input type="hidden" name="auth_token" value="<?php echo esc_attr( $auth_token ); ?>" />
<input type="hidden" name="pledge_id" value="<?php echo absint( $pledge_id ); ?>" />
<button type="submit" class="button button-danger" id="5ftf-pledge-remove">
<?php esc_html_e( 'Remove Pledge', 'wporg-5ftf' ); ?>
</button>
</p>
</form>