mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-06 02:45:43 +03:00
My Pledges: Update styles and format to match design
- Add a single-pledge view so we can separate out the pending from published - Update layout and styles of my pledges list - Adds link and danger button styles
This commit is contained in:
parent
2b7fb6cd21
commit
0b26fad482
7 changed files with 310 additions and 123 deletions
77
plugins/wporg-5ftf/views/single-my-pledge.php
Normal file
77
plugins/wporg-5ftf/views/single-my-pledge.php
Normal file
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
namespace WordPressDotOrg\FiveForTheFuture\View;
|
||||
|
||||
/**
|
||||
* @var WP_Post $contributor_post
|
||||
* @var WP_Post $pledge
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
<div class="my-pledges__pledge">
|
||||
<div class="entry-image">
|
||||
<?php if ( has_post_thumbnail( $pledge ) ) : ?>
|
||||
<div class="entry-image__logo">
|
||||
<?php echo get_the_post_thumbnail( $pledge->ID, 'pledge-logo' ); ?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="entry-image__placeholder"></div>
|
||||
<?php endif; ?>
|
||||
</div><!-- .entry-image -->
|
||||
|
||||
<div class="my-pledges__pledge-meta">
|
||||
<a class="my-pledges__pledge-title" href="<?php echo esc_url( get_permalink( $pledge->ID ) ); ?>">
|
||||
<?php echo esc_html( $pledge->post_title ); ?>
|
||||
</a>
|
||||
|
||||
<p class="my-pledges__pledge-date">
|
||||
<?php
|
||||
if ( 'publish' === $contributor_post->post_status ) {
|
||||
echo esc_html( sprintf(
|
||||
__( 'You confirmed this pledge on %s', 'wporg-5ftf' ),
|
||||
date( get_option( 'date_format' ), strtotime( $contributor_post->post_date ) )
|
||||
) );
|
||||
} else {
|
||||
echo esc_html_e( 'This organization would like to pledge your time', 'wporg-5ftf' );
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="my-pledges__pledge-actions">
|
||||
<form action="" method="post">
|
||||
<input type="hidden" name="contributor_post_id" value="<?php echo esc_attr( $contributor_post->ID ); ?>" />
|
||||
|
||||
<?php if ( 'pending' === $contributor_post->post_status ) : ?>
|
||||
<?php wp_nonce_field( 'join_decline_organization' ); ?>
|
||||
|
||||
<input
|
||||
type="submit"
|
||||
class="button button-default"
|
||||
name="join_organization"
|
||||
value="Join Organization"
|
||||
/>
|
||||
|
||||
<input
|
||||
type="submit"
|
||||
class="button button-danger button-link"
|
||||
name="decline_invitation"
|
||||
value="Decline Invitation"
|
||||
/>
|
||||
|
||||
<?php elseif ( 'publish' === $contributor_post->post_status ) : ?>
|
||||
<?php wp_nonce_field( 'leave_organization' ); ?>
|
||||
|
||||
<input
|
||||
type="submit"
|
||||
class="button button-danger"
|
||||
name="leave_organization"
|
||||
value="Leave Organization"
|
||||
/>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue