FEATURE handling fonds archives
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4fc13822a8
commit
24c4dadbca
36
archive-fonds-archives.php
Normal file
36
archive-fonds-archives.php
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php get_header(); ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$current_post_type = get_post_type();
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<main id="content" class="site-content flex-grow">
|
||||||
|
<?php get_template_part('template-parts/post-types/fonds-archives/archive-header'); ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- #### ARCHIVE POST GRID #### -->
|
||||||
|
<?php get_template_part('template-parts/post-types/fonds-archives/archive-post-grid', null, array(
|
||||||
|
'current_post_type' => 'fonds-archives',
|
||||||
|
'post_amount' => -1,
|
||||||
|
'grid_title' => 'Trouver un fonds d\'archives',
|
||||||
|
)); ?>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- #### ACCES CONSULTATION #### -->
|
||||||
|
<?php get_template_part('template-parts/compositions/acces-consultation'); ?>
|
||||||
|
|
||||||
|
<!-- #### COLLECTIVE ACCES #### -->
|
||||||
|
<?php get_template_part('template-parts/compositions/collective-acess'); ?>
|
||||||
|
|
||||||
|
<!-- #### SOUTENIR #### -->
|
||||||
|
<?php get_template_part('template-parts/compositions/soutenir'); ?>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- #### INFOLETTRE #### -->
|
||||||
|
<?php get_template_part('template-parts/compositions/infolettre'); ?>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
get_footer();
|
||||||
15
template-parts/post-types/fonds-archives/archive-header.php
Normal file
15
template-parts/post-types/fonds-archives/archive-header.php
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?php get_template_part('template-parts/page-header', null, array(
|
||||||
|
'title' => 'Fonds d\'archives',
|
||||||
|
'subtitle' => 'Explorer les fonds conservés au CARHOP',
|
||||||
|
'description' => 'Vous trouverez ci-dessous la liste des fonds d’archives conservés au CARHOP. Les inventaires disponibles sont accessibles via notre base de données, qui permet des recherches multicritères et, pour certaines pièces, une prévisualisation de documents numérisés.',
|
||||||
|
'cover' => array(
|
||||||
|
'url' => get_stylesheet_directory_uri() . '/resources/img/covers/carhop-page-fonds-archives-cover.svg',
|
||||||
|
'alt' => 'Revues'
|
||||||
|
),
|
||||||
|
'has_overlap' => false,
|
||||||
|
'background_style' => 'sliced',
|
||||||
|
'cta' => array(
|
||||||
|
'title' => __('Consulter notre politique de collecte', 'carhop'),
|
||||||
|
'url' => '#prochaines-expositions',
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
<?php
|
||||||
|
$post_amount = $args['post_amount'] ?? -1;
|
||||||
|
$grid_title = $args['grid_title'] ?? 'Trouver un fonds d\'archives';
|
||||||
|
$current_post_type = 'fonds-archives';
|
||||||
|
|
||||||
|
|
||||||
|
// Construire les arguments de la query
|
||||||
|
$query_args = array(
|
||||||
|
'post_type' => $current_post_type,
|
||||||
|
'posts_per_page' => $post_amount,
|
||||||
|
'post_status' => 'publish',
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$posts_query = new WP_Query($query_args);
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<section class="post-grid content-section fonds-archives-grid <?php echo !empty($etiquette_slug) ? 'has-initial-filter' : '' ?>">
|
||||||
|
<h2 class="find-publication__title title-small"><?php echo $grid_title; ?></h2>
|
||||||
|
<div class="content-section__inner">
|
||||||
|
|
||||||
|
<?php get_template_part('template-parts/post-types/fonds-archives/fonds-archives-grid-toolbar', null, array(
|
||||||
|
'posts_query' => $posts_query,
|
||||||
|
'current_post_type' => $current_post_type,
|
||||||
|
'etiquette_active_filter_slug' => $etiquette_slug,
|
||||||
|
)); ?>
|
||||||
|
|
||||||
|
<ul class="post-grid__list">
|
||||||
|
<?php if (isset($posts_query) && $posts_query->have_posts()) : ?>
|
||||||
|
<?php while ($posts_query->have_posts()) : $posts_query->the_post(); ?>
|
||||||
|
<?php get_template_part('template-parts/components/cards/post-card', null, array(
|
||||||
|
'ID' => get_the_ID(),
|
||||||
|
)); ?>
|
||||||
|
<?php endwhile; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
$current_post_type = $args['current_post_type'] ?? get_post_type();
|
||||||
|
$posts_query = $args['posts_query'] ?? null;
|
||||||
|
$post_count = $posts_query->post_count;
|
||||||
|
$current_post_type_obj = get_post_type_object($current_post_type);
|
||||||
|
|
||||||
|
$etiquette_active_filter_slug = $args['etiquette_active_filter_slug'] ?? null;
|
||||||
|
|
||||||
|
$post_ids = wp_list_pluck($posts_query->posts, 'ID');
|
||||||
|
|
||||||
|
$types = get_terms(array(
|
||||||
|
'taxonomy' => 'type',
|
||||||
|
'hide_empty' => true,
|
||||||
|
));
|
||||||
|
|
||||||
|
$authors = get_authors_linked_to_posts($post_ids);
|
||||||
|
$tags = get_terms(array(
|
||||||
|
'taxonomy' => 'etiquettes',
|
||||||
|
'hide_empty' => true,
|
||||||
|
'object_ids' => $post_ids,
|
||||||
|
));
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="post-grid__toolbar fonds-archives-grid__toolbar">
|
||||||
|
|
||||||
|
<h2 class="post-count">
|
||||||
|
<span class="post-count__count">
|
||||||
|
<?php echo $post_count; ?>
|
||||||
|
</span>
|
||||||
|
<?php if ($post_amount > 1) : ?>
|
||||||
|
<span class="post-count__text">
|
||||||
|
<?php echo $current_post_type_obj->labels->name; ?>
|
||||||
|
</span>
|
||||||
|
<?php else : ?>
|
||||||
|
<span class="post-count__text">
|
||||||
|
<?php echo $current_post_type_obj->labels->singular_name; ?>
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</h2>
|
||||||
|
<select name="sort_by">
|
||||||
|
<option value="date_desc" selected><?php _e('Numéros récents en premier', 'dynamiques'); ?></option>
|
||||||
|
<option value="date_asc"><?php _e('Numéros anciens en premier', 'dynamiques'); ?></option>
|
||||||
|
<option value="title_asc"><?php _e('Par ordre alphabétique', 'dynamiques'); ?></option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<div class="alphabetical-order-select">
|
||||||
|
<?php $letters = range('A', 'Z'); ?>
|
||||||
|
<h3 class="alphabetical-order-select__title">Rechercher par ordre alphabétique</h3>
|
||||||
|
<div class="alphabetical-order-select__list">
|
||||||
|
<?php foreach ($letters as $letter) : ?>
|
||||||
|
<button class="alphabetical-order-select__button">
|
||||||
|
<?php echo $letter; ?>
|
||||||
|
</button>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Loading…
Reference in New Issue
Block a user