Add a label for "deactivated" pledges

This commit is contained in:
Kelly Dwan 2019-12-10 13:17:08 -05:00
parent 914b6d7292
commit 0ea187169e
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D
2 changed files with 13 additions and 0 deletions

View file

@ -31,6 +31,15 @@ body.single.single-5ftf_pledge {
margin-top: ms(2);
}
}
.pledge-status {
display: inline-block;
padding: 4px 12px;
font-size: ms(-1);
text-transform: uppercase;
background-color: $color-error-red;
color: white;
}
}
.entry-title {

View file

@ -6,6 +6,7 @@ use WordPressDotOrg\FiveForTheFuture\XProfile;
use WP_Post;
use const WordPressDotOrg\FiveForTheFuture\PledgeMeta\META_PREFIX;
use const WordPressDotOrg\FiveForTheFuture\Pledge\DEACTIVE_STATUS;
$contribution_data = XProfile\get_aggregate_contributor_data_for_pledge( get_the_ID() );
@ -30,6 +31,9 @@ get_header();
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<div>
<?php if ( DEACTIVE_STATUS === get_post_status() ) : ?>
<span class="pledge-status"><?php esc_html_e( 'deactivated', 'wporg-5ftf' ); ?></span>
<?php endif; ?>
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<span class="pledge-url">
<?php