five-for-the-future/plugins/wporg-5ftf/views/form-pledge-manage.php
Kelly Dwan 544fe39199 Manage Pledge: Enable pledge admins to edit contributors from manage form (#108)
* Add contributor management to manage form
* Check `pledge_id` to prevent returning all contributors
* Return a plain text error string – this is used in an alert box, so it can't contain HTML
* Hide confirmation when pledge is a draft
* Only enqueue script if the user is authorized
2019-11-26 13:08:42 -05:00

44 lines
1 KiB
PHP

<?php
namespace WordPressDotOrg\FiveForTheFuture\View;
use function WordPressDotOrg\FiveForTheFuture\get_views_path;
/**
* @var bool $can_view_form
* @var int $pledge_id
* @var string $auth_token
*/
require __DIR__ . '/partial-result-messages.php';
?>
<?php if ( true === $can_view_form ) : ?>
<form class="pledge-form" id="5ftf-form-pledge-manage" action="" method="post" enctype="multipart/form-data">
<input type="hidden" name="pledge_id" value="<?php echo absint( $pledge_id ); ?>" />
<input type="hidden" name="auth_token" value="<?php echo esc_attr( $auth_token ); ?>" />
<?php
wp_nonce_field( 'manage_pledge_' . $pledge_id );
require get_views_path() . 'inputs-pledge-org-info.php';
?>
<div>
<input
type="submit"
id="5ftf-pledge-submit"
name="action"
value="<?php esc_attr_e( 'Update Pledge', 'wporg-5ftf' ); ?>"
/>
</div>
<h2><?php esc_html_e( 'Contributors', 'wporg-5ftf' ); ?></h2>
<?php require get_views_path() . 'manage-contributors.php'; ?>
</form>
<?php endif; ?>