mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-14 22:35:45 +03:00
Contributors: Add Contributors CPT and related admin UI
This commit is contained in:
parent
aaf8b1a712
commit
75428a3c95
4 changed files with 158 additions and 36 deletions
|
@ -28,7 +28,49 @@ namespace WordPressDotOrg\FiveForTheFuture\View;
|
|||
<?php else : ?>
|
||||
|
||||
<div class="5ftf-contributors">
|
||||
<?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>
|
||||
|
||||
<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>
|
||||
-->
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue