five-for-the-future/plugins/wporg-5ftf/views/inputs-pledge-contributors.php
Kelly Dwan 82192eea4c
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
2019-11-20 11:01:00 -05:00

25 lines
713 B
PHP

<?php
namespace WordPressDotOrg\FiveForTheFuture\View;
/** @var array $data */
/** @var bool $is_manage */
?>
<div class="form-field">
<label for="5ftf-pledge-contributors">
<?php esc_html_e( 'Contributor Usernames', 'wordpressorg' ); ?>
</label>
<input
type="text"
id="5ftf-pledge-contributors"
name="pledge-contributors"
placeholder="sanguine.zoe206, captain-mal, kayleefixesyou"
value="<?php echo esc_attr( $data['pledge-contributors'] ); ?>"
<?php echo $is_manage ? '' : 'required'; ?>
aria-describedby="5ftf-pledge-contributors-help"
/>
<p id="5ftf-pledge-contributors-help">
<?php esc_html_e( 'Separate each WordPress.org username with a comma.', 'wordpressorg' ); ?>
</p>
</div>