mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-20 10:03:43 +03:00
Add the "Add Contributors" input to the form
This commit is contained in:
parent
eacd2bf3f2
commit
aa79c8147e
|
@ -155,7 +155,8 @@ function render_form_manage() {
|
|||
$updated = false;
|
||||
|
||||
// @todo Get pledge ID from somewhere.
|
||||
$data = PledgeMeta\get_pledge_meta();
|
||||
$data = PledgeMeta\get_pledge_meta();
|
||||
$is_manage = true;
|
||||
|
||||
if ( 'Update Pledge' === $action ) {
|
||||
$processed = process_form_manage();
|
||||
|
|
|
@ -203,6 +203,7 @@ function add_meta_boxes() {
|
|||
*/
|
||||
function render_meta_boxes( $pledge, $box ) {
|
||||
$readonly = ! current_user_can( 'edit_page', $pledge->ID );
|
||||
$is_manage = true;
|
||||
|
||||
$data = array();
|
||||
foreach ( get_pledge_meta_config() as $key => $config ) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
namespace WordPressDotOrg\FiveForTheFuture\View;
|
||||
|
||||
/** @var array $data */
|
||||
/** @var bool $readonly */
|
||||
/** @var bool $is_manage */
|
||||
?>
|
||||
|
||||
<div class="form-field">
|
||||
|
@ -15,7 +15,7 @@ namespace WordPressDotOrg\FiveForTheFuture\View;
|
|||
name="pledge-contributors"
|
||||
placeholder="sanguine.zoe206, captain-mal, kayleefixesyou"
|
||||
value="<?php echo esc_attr( $data['pledge-contributors'] ); ?>"
|
||||
required
|
||||
<?php echo $is_manage ? '' : 'required'; ?>
|
||||
aria-describedby="5ftf-pledge-contributors-help"
|
||||
/>
|
||||
<p id="5ftf-pledge-contributors-help">
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
namespace WordPressDotOrg\FiveForTheFuture\View;
|
||||
|
||||
use function WordPressDotOrg\FiveForTheFuture\get_views_path;
|
||||
|
||||
/** @var array $contributors */
|
||||
/** @var array $data */
|
||||
/** @var bool $readonly */
|
||||
|
@ -64,9 +66,20 @@ namespace WordPressDotOrg\FiveForTheFuture\View;
|
|||
<p><?php esc_html_e( 'There are no contributors added to this pledge yet.', 'wporg' ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- TODO This button doesn't do anything yet.
|
||||
<button class="button-primary" data-action="add-contributor">
|
||||
<hr />
|
||||
|
||||
<?php
|
||||
$data = [ 'pledge-contributors' => '' ];
|
||||
require get_views_path() . 'inputs-pledge-contributors.php';
|
||||
?>
|
||||
|
||||
<div id="add-contrib-message"></div>
|
||||
|
||||
<button
|
||||
class="button-primary"
|
||||
data-action="add-contributor"
|
||||
data-pledge-post="<?php the_ID(); ?>"
|
||||
>
|
||||
<?php esc_html_e( 'Add new contributor', 'wporg' ); ?>
|
||||
</button>
|
||||
-->
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue