272 lines
11 KiB
PHP
272 lines
11 KiB
PHP
<?php
|
|
/**
|
|
* Gabarit de la Page d'Accueil — 7 sections verticales fidèles à la maquette.
|
|
*
|
|
* @package CGT_FHA
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
get_header();
|
|
$opts = cgt_fha_get_options();
|
|
?>
|
|
|
|
<!-- =========================================================================
|
|
SECTION 1 : BANNIÈRE HERO PLEIN ÉCRAN
|
|
========================================================================= -->
|
|
<section class="cgt-hero" aria-label="<?php esc_attr_e( 'Présentation de l\'Union Locale CGT Foix Haute-Ariège', 'cgt-fha' ); ?>">
|
|
<img
|
|
src="<?php echo esc_url( (string) $opts['hero_bg_url'] ); ?>"
|
|
alt=""
|
|
class="cgt-hero__bg"
|
|
fetchpriority="high"
|
|
decoding="async"
|
|
/>
|
|
<div class="cgt-hero__overlay" aria-hidden="true"></div>
|
|
|
|
<div class="cgt-hero__content">
|
|
<h1 class="cgt-hero__title">
|
|
<span><?php echo esc_html( (string) $opts['hero_title_line1'] ); ?></span>
|
|
<?php if ( '' !== trim( (string) $opts['hero_title_line2'] ) ) : ?>
|
|
<span><?php echo esc_html( (string) $opts['hero_title_line2'] ); ?></span>
|
|
<?php endif; ?>
|
|
</h1>
|
|
|
|
<?php if ( '' !== trim( (string) $opts['hero_quote'] ) ) : ?>
|
|
<p class="cgt-hero__quote"><?php echo esc_html( (string) $opts['hero_quote'] ); ?></p>
|
|
<?php endif; ?>
|
|
|
|
<div class="cgt-hero__actions">
|
|
<a href="<?php echo esc_url( (string) $opts['hero_btn1_url'] ); ?>" class="cgt-btn cgt-btn--white">
|
|
<?php echo esc_html( (string) $opts['hero_btn1_label'] ); ?>
|
|
</a>
|
|
<a href="<?php echo esc_url( (string) $opts['hero_btn2_url'] ); ?>" class="cgt-btn cgt-btn--hero-dark">
|
|
<?php echo esc_html( (string) $opts['hero_btn2_label'] ); ?>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- =========================================================================
|
|
SECTION 2 : À QUOI NOUS SERVONS ? (3 Cartes de Mission)
|
|
========================================================================= -->
|
|
<section class="cgt-section cgt-section--white cgt-missions-section" aria-labelledby="cgt-missions-heading">
|
|
<div class="cgt-container">
|
|
<h2 id="cgt-missions-heading" class="cgt-section__title"><?php echo esc_html( (string) $opts['missions_title'] ); ?></h2>
|
|
<?php if ( ! empty( $opts['missions_subtitle'] ) ) : ?>
|
|
<p class="cgt-section__subtitle"><?php echo esc_html( (string) $opts['missions_subtitle'] ); ?></p>
|
|
<?php endif; ?>
|
|
|
|
<div class="cgt-missions-grid">
|
|
<?php for ( $i = 1; $i <= 3; $i++ ) : ?>
|
|
<article class="cgt-mission-card">
|
|
<div class="cgt-mission-card__icon" aria-hidden="true">
|
|
<?php echo cgt_fha_render_icon( (string) $opts[ 'mission_' . $i . '_icon' ], 40 ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
|
</div>
|
|
<h3 class="cgt-mission-card__title"><?php echo esc_html( (string) $opts[ 'mission_' . $i . '_title' ] ); ?></h3>
|
|
<p class="cgt-mission-card__text"><?php echo esc_html( (string) $opts[ 'mission_' . $i . '_text' ] ); ?></p>
|
|
</article>
|
|
<?php endfor; ?>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- =========================================================================
|
|
SECTION 3 : SUR LE TERRAIN EN HAUTE-ARIÈGE (3 derniers articles locaux)
|
|
========================================================================= -->
|
|
<section class="cgt-section cgt-section--white cgt-local-section" aria-labelledby="cgt-local-news-heading">
|
|
<div class="cgt-container">
|
|
<h2 id="cgt-local-news-heading" class="cgt-section__title"><?php echo esc_html( (string) $opts['local_news_title'] ); ?></h2>
|
|
|
|
<?php
|
|
$local_query = new WP_Query(
|
|
array(
|
|
'post_type' => 'post',
|
|
'post_status' => 'publish',
|
|
'posts_per_page' => 3,
|
|
'ignore_sticky_posts' => true,
|
|
'no_found_rows' => true,
|
|
'update_post_meta_cache' => false,
|
|
)
|
|
);
|
|
?>
|
|
|
|
<?php if ( $local_query->have_posts() ) : ?>
|
|
<div class="cgt-news-grid">
|
|
<?php
|
|
while ( $local_query->have_posts() ) :
|
|
$local_query->the_post();
|
|
cgt_fha_render_local_post_card();
|
|
endwhile;
|
|
wp_reset_postdata();
|
|
?>
|
|
</div>
|
|
<?php else : ?>
|
|
<p class="cgt-section__subtitle">
|
|
<?php esc_html_e( 'Les prochaines actualités locales et comptes-rendus de luttes à Foix et en Haute-Ariège seront publiés ici très prochainement.', 'cgt-fha' ); ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
|
|
<div class="cgt-section__footer">
|
|
<a href="<?php echo esc_url( cgt_fha_get_local_news_archive_url() ); ?>" class="cgt-btn cgt-btn--subtle">
|
|
<?php echo esc_html( (string) $opts['local_news_more'] ); ?>
|
|
</a>
|
|
</div>
|
|
|
|
<?php
|
|
// Hook pour injecter les prochains rendez-vous de l'extension cgt-wp-calendar.
|
|
do_action( 'cgt_fha_after_local_news' );
|
|
?>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- =========================================================================
|
|
SECTION 4 : ACTUALITÉ CONFÉDÉRALE (cgt.fr)
|
|
========================================================================= -->
|
|
<?php CGT_FHA_Confederal_Feed::render_section( (string) $opts['confederal_title'] ); ?>
|
|
|
|
<!-- =========================================================================
|
|
SECTION 5 : SALARIÉS ISOLÉS & TPE : VOUS N'ÊTES PAS SEULS
|
|
========================================================================= -->
|
|
<?php if ( ! empty( $opts['tpe_enabled'] ) ) : ?>
|
|
<section class="cgt-section cgt-section--white" aria-labelledby="cgt-tpe-heading">
|
|
<div class="cgt-container">
|
|
<div class="cgt-tpe-box">
|
|
<div>
|
|
<?php if ( ! empty( $opts['tpe_badge'] ) ) : ?>
|
|
<span class="cgt-tpe-box__badge"><?php echo esc_html( (string) $opts['tpe_badge'] ); ?></span>
|
|
<?php endif; ?>
|
|
<h2 id="cgt-tpe-heading" class="cgt-tpe-box__title"><?php echo esc_html( (string) $opts['tpe_title'] ); ?></h2>
|
|
<p class="cgt-tpe-box__text"><?php echo esc_html( (string) $opts['tpe_text'] ); ?></p>
|
|
<a href="<?php echo esc_url( (string) $opts['tpe_btn_url'] ); ?>" class="cgt-btn cgt-btn--primary">
|
|
<?php echo esc_html( (string) $opts['tpe_btn_label'] ); ?>
|
|
</a>
|
|
</div>
|
|
|
|
<ul class="cgt-tpe-points">
|
|
<?php for ( $p = 1; $p <= 3; $p++ ) : ?>
|
|
<?php if ( ! empty( $opts[ 'tpe_point_' . $p ] ) ) : ?>
|
|
<li>
|
|
<span class="cgt-tpe-points__icon">
|
|
<?php echo cgt_fha_render_icon( 'check', 18 ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
|
</span>
|
|
<span><?php echo esc_html( (string) $opts[ 'tpe_point_' . $p ] ); ?></span>
|
|
</li>
|
|
<?php endif; ?>
|
|
<?php endfor; ?>
|
|
</ul>
|
|
</div>
|
|
<?php do_action( 'cgt_fha_tpe_section_after' ); ?>
|
|
</div>
|
|
</section>
|
|
<?php endif; ?>
|
|
|
|
<!-- =========================================================================
|
|
SECTION 6 : FORMATION SYNDICALE (CFESES) & APPLICATION MOBILE
|
|
========================================================================= -->
|
|
<?php
|
|
$split_count = ( ! empty( $opts['cfeses_enabled'] ) ? 1 : 0 ) + ( ! empty( $opts['app_enabled'] ) ? 1 : 0 );
|
|
if ( $split_count > 0 ) :
|
|
$split_class = 1 === $split_count ? 'cgt-split-grid cgt-split-grid--single' : 'cgt-split-grid';
|
|
?>
|
|
<section class="cgt-section cgt-section--soft" aria-label="<?php esc_attr_e( 'Formation syndicale et application mobile', 'cgt-fha' ); ?>">
|
|
<div class="cgt-container">
|
|
<div class="<?php echo esc_attr( $split_class ); ?>">
|
|
<?php if ( ! empty( $opts['cfeses_enabled'] ) ) : ?>
|
|
<article class="cgt-feature-card">
|
|
<span class="cgt-feature-card__eyebrow"><?php echo esc_html( (string) $opts['cfeses_eyebrow'] ); ?></span>
|
|
<h2 class="cgt-feature-card__title"><?php echo esc_html( (string) $opts['cfeses_title'] ); ?></h2>
|
|
<p class="cgt-feature-card__text"><?php echo esc_html( (string) $opts['cfeses_text'] ); ?></p>
|
|
<div class="cgt-feature-card__footer">
|
|
<a href="<?php echo esc_url( (string) $opts['cfeses_btn_url'] ); ?>" class="cgt-btn cgt-btn--primary">
|
|
<?php echo esc_html( (string) $opts['cfeses_btn_label'] ); ?>
|
|
</a>
|
|
</div>
|
|
</article>
|
|
<?php endif; ?>
|
|
|
|
<?php if ( ! empty( $opts['app_enabled'] ) ) : ?>
|
|
<article class="cgt-feature-card">
|
|
<span class="cgt-feature-card__eyebrow"><?php echo esc_html( (string) $opts['app_eyebrow'] ); ?></span>
|
|
<h2 class="cgt-feature-card__title"><?php echo esc_html( (string) $opts['app_title'] ); ?></h2>
|
|
<div class="cgt-app-layout">
|
|
<div>
|
|
<p class="cgt-feature-card__text"><?php echo esc_html( (string) $opts['app_text'] ); ?></p>
|
|
</div>
|
|
<?php if ( ! empty( $opts['app_qr_url'] ) ) : ?>
|
|
<img
|
|
src="<?php echo esc_url( (string) $opts['app_qr_url'] ); ?>"
|
|
alt="<?php esc_attr_e( 'QR Code pour télécharger l\'application mobile UL CGT Foix Haute-Ariège', 'cgt-fha' ); ?>"
|
|
class="cgt-app-qr"
|
|
loading="lazy"
|
|
decoding="async"
|
|
/>
|
|
<?php endif; ?>
|
|
</div>
|
|
<div class="cgt-feature-card__footer">
|
|
<a href="<?php echo esc_url( (string) $opts['app_download_url'] ); ?>" class="cgt-btn cgt-btn--outline-dark" target="_blank" rel="noopener noreferrer">
|
|
<?php echo esc_html( (string) $opts['app_btn_label'] ); ?>
|
|
</a>
|
|
</div>
|
|
</article>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<?php endif; ?>
|
|
|
|
<!-- =========================================================================
|
|
SECTION 7 : RÉSEAU SYNDICAL CGT
|
|
========================================================================= -->
|
|
<?php if ( ! empty( $opts['network_enabled'] ) ) : ?>
|
|
<section class="cgt-section cgt-section--white" aria-labelledby="cgt-network-heading">
|
|
<div class="cgt-container">
|
|
<h2 id="cgt-network-heading" class="cgt-section__title"><?php echo esc_html( (string) $opts['network_title'] ); ?></h2>
|
|
<div class="cgt-network-grid">
|
|
<?php for ( $n = 1; $n <= 5; $n++ ) : ?>
|
|
<?php
|
|
if ( empty( $opts[ 'network_' . $n . '_enabled' ] ) ) {
|
|
continue;
|
|
}
|
|
$n_logo = (string) ( $opts[ 'network_' . $n . '_logo' ] ?? '' );
|
|
$n_label = (string) ( $opts[ 'network_' . $n . '_label' ] ?? '' );
|
|
$n_desc = (string) ( $opts[ 'network_' . $n . '_desc' ] ?? '' );
|
|
$n_btn = (string) ( $opts[ 'network_' . $n . '_btn' ] ?? 'Visiter le site ↗' );
|
|
$n_url = (string) ( $opts[ 'network_' . $n . '_url' ] ?? '' );
|
|
if ( '' === $n_label || '' === $n_url ) {
|
|
continue;
|
|
}
|
|
?>
|
|
<article class="cgt-network-card">
|
|
<?php if ( '' !== $n_logo ) : ?>
|
|
<div class="cgt-network-card__logo-wrap">
|
|
<img
|
|
src="<?php echo esc_url( $n_logo ); ?>"
|
|
alt="<?php echo esc_attr( $n_label ); ?>"
|
|
class="cgt-network-card__logo"
|
|
loading="lazy"
|
|
decoding="async"
|
|
/>
|
|
</div>
|
|
<?php endif; ?>
|
|
<h3 class="cgt-network-card__title"><?php echo esc_html( $n_label ); ?></h3>
|
|
<?php if ( '' !== $n_desc ) : ?>
|
|
<p class="cgt-network-card__desc"><?php echo esc_html( $n_desc ); ?></p>
|
|
<?php endif; ?>
|
|
<div class="cgt-network-card__cta">
|
|
<a href="<?php echo esc_url( $n_url ); ?>" class="cgt-network-card__btn" target="_blank" rel="noopener noreferrer">
|
|
<?php echo esc_html( $n_btn ); ?>
|
|
</a>
|
|
</div>
|
|
</article>
|
|
<?php endfor; ?>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
get_footer();
|