mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-15 06:45:47 +03:00
Single Pledge: Add intro message to pledges for clarity.
This commit is contained in:
parent
325a6d71e2
commit
7174ae2fb6
16 changed files with 222 additions and 166 deletions
|
@ -30,7 +30,27 @@ get_header();
|
|||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<header class="entry-header">
|
||||
<div>
|
||||
<div class="pledge-introduction alignfull">
|
||||
<p>
|
||||
<?php esc_html_e( 'This organization contributes 5% of their resources to the WordPress project.', 'wporg-5ftf' ); ?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="<?php echo esc_url( home_url() ); ?>">
|
||||
<?php esc_html_e( 'More about Five for the Future', 'wporg-5ftf' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="pledge-company-summary">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<div class="entry-image">
|
||||
<div class="entry-image__logo">
|
||||
<?php the_post_thumbnail( 'pledge-logo' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( DEACTIVE_STATUS === get_post_status() ) : ?>
|
||||
<span class="pledge-status"><?php esc_html_e( 'deactivated', 'wporg-5ftf' ); ?></span>
|
||||
<?php endif; ?>
|
||||
|
@ -44,21 +64,13 @@ get_header();
|
|||
?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="entry-image">
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<div class="entry-image__logo">
|
||||
<?php the_post_thumbnail( 'pledge-logo' ); ?>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="entry-image__placeholder"></div>
|
||||
<?php endif; ?>
|
||||
</div><!-- .entry-image -->
|
||||
|
||||
</header>
|
||||
|
||||
<div class="entry-content">
|
||||
<h2><?php esc_html_e( 'About', 'wporg-5ftf' ); ?></h2>
|
||||
|
||||
<div class="pledge-company-description">
|
||||
<h2><?php esc_html_e( 'About', 'wporg-5ftf' ); ?></h2>
|
||||
|
||||
<?php
|
||||
// phpcs:ignore WordPress.Security.EscapeOutput -- wp_kses_data escapes the content.
|
||||
echo wpautop( wp_kses_data( $post->{ META_PREFIX . 'org-description' } ) );
|
||||
|
@ -66,68 +78,56 @@ get_header();
|
|||
</div>
|
||||
|
||||
<?php if ( ! empty( $contributors ) ) : ?>
|
||||
<h2><?php esc_html_e( 'Contributions', 'wporg-5ftf' ); ?></h2>
|
||||
<div class="pledge-company-contributions">
|
||||
<h2><?php esc_html_e( 'Contributions', 'wporg-5ftf' ); ?></h2>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses_post( sprintf(
|
||||
__( '%1$s sponsors %2$s for a total of <strong>%3$s</strong> hours per week.', 'wporg-5ftf' ),
|
||||
get_the_title(),
|
||||
sprintf(
|
||||
_n( '<strong>%d</strong> contributor', '<strong>%d</strong> contributors', $contribution_data['contributors'], 'wporg-5ftf' ),
|
||||
number_format_i18n( absint( $contribution_data['contributors'] ) )
|
||||
),
|
||||
number_format_i18n( absint( $contribution_data['hours'] ) )
|
||||
) );
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses_post( sprintf(
|
||||
__( 'Contributors from %s work on the following teams:', 'wporg-5ftf' ),
|
||||
get_the_title()
|
||||
) );
|
||||
?>
|
||||
</p>
|
||||
<ul class="team-grid">
|
||||
<?php foreach ( $contribution_data['teams'] as $team ) :
|
||||
$badge_classes = get_badge_classes( $team );
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses_post( sprintf(
|
||||
__( '%1$s sponsors %2$s for a total of <strong>%3$s hours</strong> per week across <strong>%4$d teams</strong>.', 'wporg-5ftf' ),
|
||||
get_the_title(),
|
||||
sprintf(
|
||||
_n( '<strong>%d contributor</strong>', '<strong>%d contributors</strong>', $contribution_data['contributors'], 'wporg-5ftf' ),
|
||||
number_format_i18n( absint( $contribution_data['contributors'] ) )
|
||||
),
|
||||
number_format_i18n( absint( $contribution_data['hours'] ) ),
|
||||
count( $contribution_data['teams'] )
|
||||
) );
|
||||
?>
|
||||
<li>
|
||||
<div class="badge item dashicons <?php echo esc_attr( implode( ' ', $badge_classes ) ); ?>"></div>
|
||||
<span class="badge-label"><?php echo esc_html( $team ); ?></span>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
<h2><?php esc_html_e( 'Contributors', 'wporg-5ftf' ); ?></h2>
|
||||
|
||||
<?php if ( ! empty( $contributors ) ) : ?>
|
||||
<ul class="pledge-contributors has-contrib-names">
|
||||
<?php foreach ( $contributors as $contributor ) : ?>
|
||||
<li class="pledge-contributor">
|
||||
<span class="pledge-contributor__avatar">
|
||||
<a href="<?php echo esc_url( 'https://profiles.wordpress.org/' . $contributor->user_nicename ); ?> ">
|
||||
<?php echo get_avatar( $contributor->user_email, 280 ); ?>
|
||||
</a>
|
||||
</span>
|
||||
<?php
|
||||
printf(
|
||||
'<a class="pledge-contributor__name" href="%1$s">%2$s</a>',
|
||||
sprintf(
|
||||
'https://profiles.wordpress.org/%s/',
|
||||
sanitize_key( $contributor->user_nicename ) // phpcs:ignore WordPress.Security.EscapeOutput -- sanitize_key will catch any security issues.
|
||||
),
|
||||
esc_html( $contributor->display_name )
|
||||
);
|
||||
<ul class="team-grid">
|
||||
<?php foreach ( $contribution_data['teams'] as $team ) :
|
||||
$badge_classes = get_badge_classes( $team );
|
||||
?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php else : ?>
|
||||
<p><?php esc_html_e( 'No confirmed contributors yet.', 'wporg-5ftf' ); ?></p>
|
||||
<li>
|
||||
<div class="badge item dashicons <?php echo esc_attr( implode( ' ', $badge_classes ) ); ?>"></div>
|
||||
<span class="badge-label"><?php echo esc_html( $team ); ?></span>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="pledge-company-contributors">
|
||||
<h2><?php esc_html_e( 'Contributors', 'wporg-5ftf' ); ?></h2>
|
||||
|
||||
<?php if ( ! empty( $contributors ) ) : ?>
|
||||
<ul class="pledge-contributors">
|
||||
<?php foreach ( $contributors as $contributor ) : ?>
|
||||
<li class="pledge-contributor">
|
||||
<span class="pledge-contributor__avatar">
|
||||
<a href="<?php echo esc_url( 'https://profiles.wordpress.org/' . $contributor->user_nicename ); ?> ">
|
||||
<?php echo get_avatar( $contributor->user_email, 280, 'mystery', $contributor->display_name ); ?>
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php else : ?>
|
||||
<p><?php esc_html_e( 'No confirmed contributors yet.', 'wporg-5ftf' ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="entry-footer">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue