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:
Kelly Dwan 2019-10-30 13:14:42 -05:00
parent 2b7fb6cd21
commit 0b26fad482
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D
7 changed files with 310 additions and 123 deletions

View file

@ -253,20 +253,21 @@ function render_my_pledges() {
$pledge_url = get_permalink( get_page_by_path( 'for-organizations' ) );
$success_message = process_my_pledges_form();
$contributor_posts = get_posts( array(
$contributor_pending_posts = get_posts( array(
'title' => $user->user_login,
'post_type' => CPT_ID,
'post_status' => array( 'pending', 'publish' ),
'post_status' => array( 'pending' ),
'numberposts' => 100,
) );
$confirmed_pledge_ids = array_reduce( $contributor_posts, function( $carry, $post ) {
if ( 'publish' === $post->post_status ) {
$carry[] = $post->ID;
}
$contributor_publish_posts = get_posts( array(
'title' => $user->user_login,
'post_type' => CPT_ID,
'post_status' => array( 'publish' ),
'numberposts' => 100,
) );
return $carry;
}, array() );
$confirmed_pledge_ids = wp_list_pluck( $contributor_publish_posts, 'ID' );
ob_start();
require FiveForTheFuture\get_views_path() . 'list-my-pledges.php';