2019-10-04 22:35:02 +03:00
|
|
|
<?php
|
|
|
|
namespace WordPressDotOrg\FiveForTheFuture\View;
|
|
|
|
|
|
|
|
/** @var array $contributors */
|
2019-10-09 01:29:35 +03:00
|
|
|
/** @var array $data */
|
|
|
|
/** @var bool $readonly */
|
2019-10-04 22:35:02 +03:00
|
|
|
?>
|
|
|
|
|
|
|
|
<?php if ( empty( $contributors ) ) : ?>
|
|
|
|
|
|
|
|
<div class="form-field">
|
|
|
|
<label for="5ftf-pledge-contributors">
|
|
|
|
<?php esc_html_e( 'Contributors', 'wordpressorg' ); ?>
|
|
|
|
</label>
|
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
id="5ftf-pledge-contributors"
|
2019-10-22 01:43:20 +03:00
|
|
|
name="pledge-contributors"
|
|
|
|
value="<?php echo esc_attr( $data['pledge-contributors'] ); ?>"
|
2019-10-04 22:35:02 +03:00
|
|
|
required
|
2019-10-09 01:29:35 +03:00
|
|
|
aria-describedby="5ftf-pledge-contributors-help"
|
2019-10-04 22:35:02 +03:00
|
|
|
/>
|
2019-10-09 01:29:35 +03:00
|
|
|
<p id="5ftf-pledge-contributors-help">
|
|
|
|
<?php esc_html_e( 'Separate each username with a comma.', 'wordpressorg' ); ?>
|
2019-10-04 22:35:02 +03:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php else : ?>
|
|
|
|
|
|
|
|
<div class="5ftf-contributors">
|
2019-10-22 01:43:20 +03:00
|
|
|
<?php foreach ( $contributors as $status => $group ) : ?>
|
|
|
|
<?php if ( ! empty( $group ) ) : ?>
|
|
|
|
<h3 class="contributor-list-heading">
|
|
|
|
<?php
|
|
|
|
switch ( $status ) {
|
|
|
|
case 'pending':
|
|
|
|
esc_html_e( 'Unconfirmed', 'wporg' );
|
|
|
|
break;
|
|
|
|
case 'publish':
|
|
|
|
esc_html_e( 'Confirmed', 'wporg' );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</h3>
|
2019-10-04 22:35:02 +03:00
|
|
|
|
2019-10-22 01:43:20 +03:00
|
|
|
<ul class="contributor-list <?php echo esc_attr( $status ); ?>">
|
|
|
|
<?php foreach ( $group as $contributor_post ) :
|
|
|
|
$contributor = get_user_by( 'login', $contributor_post->post_title );
|
|
|
|
?>
|
|
|
|
<li>
|
|
|
|
<?php echo get_avatar( $contributor->user_email, 32 ); ?>
|
|
|
|
<?php echo $contributor_post->post_title; ?>
|
|
|
|
<!-- TODO These buttons don't do anything yet.
|
|
|
|
<button class="button-primary" data-action="remove" data-contributor-post="<?php echo esc_attr( $contributor_post->ID ); ?>">
|
|
|
|
<?php esc_html_e( 'Remove', 'wporg' ); ?>
|
|
|
|
</button>
|
|
|
|
<?php if ( 'pending' === $contributor_post->post_status ) : ?>
|
|
|
|
<button class="button-secondary" data-action="resend-confirmation" data-contributor-post="<?php echo esc_attr( $contributor_post->ID ); ?>">
|
|
|
|
<?php esc_html_e( 'Resend confirmation', 'wporg' ); ?>
|
|
|
|
</button>
|
|
|
|
<?php endif; ?>
|
|
|
|
-->
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
|
|
<!-- TODO This button doesn't do anything yet.
|
|
|
|
<button class="button-primary" data-action="add-contributor">
|
|
|
|
<?php esc_html_e( 'Add new contributor', 'wporg' ); ?>
|
|
|
|
</button>
|
|
|
|
-->
|
2019-10-04 22:35:02 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php endif; ?>
|