Add loop filters on dates
This commit is contained in:
parent
4e02f23fde
commit
6e0b9e11e3
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
||||||
/node_modules
|
/node_modules
|
||||||
/.idea
|
/.idea
|
||||||
/.vscode
|
/.vscode
|
||||||
|
/hot
|
||||||
|
|
|
||||||
|
|
@ -604,9 +604,6 @@ video {
|
||||||
.h-1{
|
.h-1{
|
||||||
height: 0.25rem
|
height: 0.25rem
|
||||||
}
|
}
|
||||||
.h-12{
|
|
||||||
height: 3rem
|
|
||||||
}
|
|
||||||
.h-6{
|
.h-6{
|
||||||
height: 1.5rem
|
height: 1.5rem
|
||||||
}
|
}
|
||||||
|
|
@ -989,7 +986,6 @@ article > *:not(.entry-content),
|
||||||
#loginform-custom input[type="text"],
|
#loginform-custom input[type="text"],
|
||||||
#loginform-custom input[type="password"]{
|
#loginform-custom input[type="password"]{
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
height: 3rem;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 0.375rem;
|
border-radius: 0.375rem;
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
|
|
@ -997,7 +993,6 @@ article > *:not(.entry-content),
|
||||||
}
|
}
|
||||||
#loginform-custom input[type="submit"]{
|
#loginform-custom input[type="submit"]{
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
height: 3rem;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 0.375rem;
|
border-radius: 0.375rem;
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
|
|
@ -1006,6 +1001,10 @@ article > *:not(.entry-content),
|
||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(255 255 255 / var(--tw-text-opacity))
|
color: rgb(255 255 255 / var(--tw-text-opacity))
|
||||||
}
|
}
|
||||||
|
#loginform-custom input[type="checkbox"]{
|
||||||
|
min-height: -moz-fit-content;
|
||||||
|
min-height: fit-content
|
||||||
|
}
|
||||||
.form-add-event input, .form-add-event .acf-field input[type=text], .form-add-event .acf-field input[type=number]{
|
.form-add-event input, .form-add-event .acf-field input[type=text], .form-add-event .acf-field input[type=number]{
|
||||||
min-height: 3rem;
|
min-height: 3rem;
|
||||||
border-radius: 0.375rem;
|
border-radius: 0.375rem;
|
||||||
|
|
|
||||||
|
|
@ -74,15 +74,15 @@
|
||||||
.mb-8 {
|
.mb-8 {
|
||||||
margin-bottom: 2rem
|
margin-bottom: 2rem
|
||||||
}
|
}
|
||||||
|
.mr-3 {
|
||||||
|
margin-right: 0.75rem
|
||||||
|
}
|
||||||
.mt-4 {
|
.mt-4 {
|
||||||
margin-top: 1rem
|
margin-top: 1rem
|
||||||
}
|
}
|
||||||
.mt-8 {
|
.mt-8 {
|
||||||
margin-top: 2rem
|
margin-top: 2rem
|
||||||
}
|
}
|
||||||
.mr-3 {
|
|
||||||
margin-right: 0.75rem
|
|
||||||
}
|
|
||||||
.block {
|
.block {
|
||||||
display: block
|
display: block
|
||||||
}
|
}
|
||||||
|
|
@ -104,18 +104,12 @@
|
||||||
.h-1 {
|
.h-1 {
|
||||||
height: 0.25rem
|
height: 0.25rem
|
||||||
}
|
}
|
||||||
.h-12 {
|
|
||||||
height: 3rem
|
|
||||||
}
|
|
||||||
.h-6 {
|
.h-6 {
|
||||||
height: 1.5rem
|
height: 1.5rem
|
||||||
}
|
}
|
||||||
.h-full {
|
.h-full {
|
||||||
height: 100%
|
height: 100%
|
||||||
}
|
}
|
||||||
.h-5 {
|
|
||||||
height: 1.25rem
|
|
||||||
}
|
|
||||||
.min-h-12 {
|
.min-h-12 {
|
||||||
min-height: 3rem
|
min-height: 3rem
|
||||||
}
|
}
|
||||||
|
|
@ -134,9 +128,6 @@
|
||||||
.w-full {
|
.w-full {
|
||||||
width: 100%
|
width: 100%
|
||||||
}
|
}
|
||||||
.w-5 {
|
|
||||||
width: 1.25rem
|
|
||||||
}
|
|
||||||
.min-w-max {
|
.min-w-max {
|
||||||
min-width: -moz-max-content;
|
min-width: -moz-max-content;
|
||||||
min-width: max-content
|
min-width: max-content
|
||||||
|
|
@ -355,26 +346,14 @@
|
||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(17 24 39 / var(--tw-text-opacity))
|
color: rgb(17 24 39 / var(--tw-text-opacity))
|
||||||
}
|
}
|
||||||
.text-white {
|
|
||||||
--tw-text-opacity: 1;
|
|
||||||
color: rgb(255 255 255 / var(--tw-text-opacity))
|
|
||||||
}
|
|
||||||
.text-amber-500 {
|
|
||||||
--tw-text-opacity: 1;
|
|
||||||
color: rgb(245 158 11 / var(--tw-text-opacity))
|
|
||||||
}
|
|
||||||
.text-gray-300 {
|
|
||||||
--tw-text-opacity: 1;
|
|
||||||
color: rgb(209 213 219 / var(--tw-text-opacity))
|
|
||||||
}
|
|
||||||
.text-slate-200 {
|
|
||||||
--tw-text-opacity: 1;
|
|
||||||
color: rgb(226 232 240 / var(--tw-text-opacity))
|
|
||||||
}
|
|
||||||
.text-slate-400 {
|
.text-slate-400 {
|
||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(148 163 184 / var(--tw-text-opacity))
|
color: rgb(148 163 184 / var(--tw-text-opacity))
|
||||||
}
|
}
|
||||||
|
.text-white {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(255 255 255 / var(--tw-text-opacity))
|
||||||
|
}
|
||||||
.underline {
|
.underline {
|
||||||
text-decoration-line: underline
|
text-decoration-line: underline
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
<?php
|
<?php
|
||||||
else:
|
else:
|
||||||
?>
|
?>
|
||||||
<a href="<?php echo home_url(); ?>" class="bg-primary px-4 py-2 rounded-md text-white">Se connecter</a>
|
<a href="#" class="add-event bg-primary px-4 py-2 rounded-md text-white" disabled>Se connecter</a>
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
$today = date('Ymd');
|
||||||
$paged = $_GET['paged'];
|
$paged = $_GET['paged'];
|
||||||
//echo $paged;
|
//echo $paged;
|
||||||
// WP_Query arguments
|
// WP_Query arguments
|
||||||
|
|
@ -7,10 +7,27 @@ $args = array(
|
||||||
'post_type' => 'evenements',
|
'post_type' => 'evenements',
|
||||||
'posts_per_page' => 6,
|
'posts_per_page' => 6,
|
||||||
'paged' => $paged,
|
'paged' => $paged,
|
||||||
'meta_key' => 'date_debut', // Nom du champ ACF
|
//'meta_key' => 'date_debut', // Nom du champ ACF
|
||||||
'orderby' => 'meta_value', // Trier par la valeur du champ
|
'meta_query' => array(
|
||||||
'order' => 'ASC', // Ordre croissant ('DESC' pour décroissant)
|
'relation' => 'OR', // Inclure les événements avec ou sans date de fin
|
||||||
'meta_type' => 'DATE' // Préciser que c'est une date (important)
|
array(
|
||||||
|
'key' => 'date_debut', // Champ pour la date de début
|
||||||
|
'value' => $today, // Comparer avec aujourd'hui
|
||||||
|
'compare' => '>=', // Date de début aujourd'hui ou plus tard
|
||||||
|
'type' => 'DATE',
|
||||||
|
),
|
||||||
|
// Événements en cours (basé sur la date de fin)
|
||||||
|
array(
|
||||||
|
'key' => 'date_fin', // Champ pour la date de fin
|
||||||
|
'value' => $today, // Comparer avec aujourd'hui
|
||||||
|
'compare' => '>=', // Date de fin aujourd'hui ou plus tard
|
||||||
|
'type' => 'DATE',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'orderby' => array(
|
||||||
|
'date_debut' => 'ASC', // Trier par date de début
|
||||||
|
'date_fin' => 'ASC', // Puis par date de fin
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// The Query
|
// The Query
|
||||||
|
|
@ -22,6 +39,7 @@ $query = new WP_Query( $args );
|
||||||
$date_debut = get_field('date_debut');
|
$date_debut = get_field('date_debut');
|
||||||
$date_fin = get_field('date_fin');
|
$date_fin = get_field('date_fin');
|
||||||
$code_postal = get_field('code_postal');
|
$code_postal = get_field('code_postal');
|
||||||
|
$code_postal = empty($code_postal) ? '4800' : $code_postal;
|
||||||
$organisme = get_field('organisme');
|
$organisme = get_field('organisme');
|
||||||
$lien_de_levenement = get_field('lien_de_levenement');
|
$lien_de_levenement = get_field('lien_de_levenement');
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
81
htmx/past-events.php
Normal file
81
htmx/past-events.php
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?php
|
||||||
|
$today = date('Ymd');
|
||||||
|
$paged = $_GET['paged'];
|
||||||
|
//echo $paged;
|
||||||
|
// WP_Query arguments
|
||||||
|
$args = array(
|
||||||
|
'post_type' => 'evenements',
|
||||||
|
'posts_per_page' => 6,
|
||||||
|
'paged' => $paged,
|
||||||
|
//'meta_key' => 'date_debut', // Nom du champ ACF
|
||||||
|
'meta_query' => array(
|
||||||
|
'relation' => 'OR', // Inclure les événements avec ou sans date de fin
|
||||||
|
array(
|
||||||
|
'key' => 'date_debut', // Champ pour la date de début
|
||||||
|
'value' => $today, // Comparer avec aujourd'hui
|
||||||
|
'compare' => '<', // Date de début aujourd'hui ou plus tard
|
||||||
|
'type' => 'DATE',
|
||||||
|
),
|
||||||
|
// Événements en cours (basé sur la date de fin)
|
||||||
|
array(
|
||||||
|
'key' => 'date_fin', // Champ pour la date de fin
|
||||||
|
'value' => $today, // Comparer avec aujourd'hui
|
||||||
|
'compare' => '<', // Date de fin aujourd'hui ou plus tard
|
||||||
|
'type' => 'DATE',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'orderby' => array(
|
||||||
|
'date_debut' => 'DESC', // Trier par date de début
|
||||||
|
'date_fin' => 'DESC', // Puis par date de fin
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// The Query
|
||||||
|
$query = new WP_Query( $args );
|
||||||
|
?>
|
||||||
|
<tbody id="posts" hx-swap-oob="beforeend">
|
||||||
|
<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
|
||||||
|
<?php
|
||||||
|
$date_debut = get_field('date_debut');
|
||||||
|
$date_fin = get_field('date_fin');
|
||||||
|
$code_postal = get_field('code_postal');
|
||||||
|
$code_postal = empty($code_postal) ? '4800' : $code_postal;
|
||||||
|
$organisme = get_field('organisme');
|
||||||
|
$lien_de_levenement = get_field('lien_de_levenement');
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="p-4 border-b border-slate-300"><?php echo $date_debut; ?></td>
|
||||||
|
<td class="p-4 border-b border-slate-300"><?php echo $date_fin; ?></td>
|
||||||
|
<td class="p-4 border-b border-slate-300"><?php echo $code_postal; ?></td>
|
||||||
|
<td class="p-4 border-b border-slate-300"><?php echo $organisme; ?></td>
|
||||||
|
<td class="p-4 border-b border-slate-300"><a href="<?php echo $lien_de_levenement; ?>" target="_blank"><?php the_title(); ?></a></td>
|
||||||
|
</tr>
|
||||||
|
<?php endwhile; else : ?>
|
||||||
|
<p><?php esc_html_e( "Il n'y a plus d'événements à charger." ); ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if ( $query->have_posts() ) :
|
||||||
|
?>
|
||||||
|
<button
|
||||||
|
id="more"
|
||||||
|
hx-get="/wp-json/htmx/v1/past-events?paged=<?php echo $paged+1; ?>"
|
||||||
|
hx-trigger="revealed"
|
||||||
|
hx-swap-oob="true"
|
||||||
|
class="bg-secondary py-2 px-4 mt-8 rounded-md text-white cursor-pointer mx-auto">
|
||||||
|
<svg class="text-slate-400 animate-spin inline mr-3 htmx-indicator hidden" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="18" height="18">
|
||||||
|
<path
|
||||||
|
d="M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z"
|
||||||
|
stroke="currentColor" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||||
|
<path
|
||||||
|
d="M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762"
|
||||||
|
stroke="currentColor" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="text-white"></path>
|
||||||
|
</svg>
|
||||||
|
Plus d'événements
|
||||||
|
</button>
|
||||||
|
<?php
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
|
@ -6,6 +6,11 @@ add_action('rest_api_init', function () {
|
||||||
'callback' => 'load_custom_template',
|
'callback' => 'load_custom_template',
|
||||||
'permission_callback' => '__return_true', // Autorise l'accès à tous les utilisateurs
|
'permission_callback' => '__return_true', // Autorise l'accès à tous les utilisateurs
|
||||||
]);
|
]);
|
||||||
|
register_rest_route('htmx/v1', '/past-events', [
|
||||||
|
'methods' => 'GET',
|
||||||
|
'callback' => 'load_custom_template_past_events',
|
||||||
|
'permission_callback' => '__return_true', // Autorise l'accès à tous les utilisateurs
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
function load_custom_template($request) {
|
function load_custom_template($request) {
|
||||||
|
|
@ -29,12 +34,33 @@ function load_custom_template($request) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function load_custom_template_past_events($request) {
|
||||||
|
// Nom du fichier de template à inclure (ex. : 'custom-template.php' dans votre thème)
|
||||||
|
$template = locate_template('htmx/past-events.php');
|
||||||
|
|
||||||
|
if ($template) {
|
||||||
|
// Capture la sortie du template pour l'inclure dans la réponse
|
||||||
|
ob_start();
|
||||||
|
include $template;
|
||||||
|
$content = ob_get_clean();
|
||||||
|
|
||||||
|
header('Content-Type: text/html; charset=UTF-8');
|
||||||
|
echo $content;
|
||||||
|
exit; // Important pour éviter que WordPress ajoute des données JSON supplémentaires
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retourne une erreur si le fichier template est introuvable
|
||||||
|
header('Content-Type: text/html; charset=UTF-8', true, 404);
|
||||||
|
echo 'Template introuvable.';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ENQUEUE HTMX
|
// ENQUEUE HTMX
|
||||||
add_action('wp_enqueue_scripts', 'add_scripts');
|
add_action('wp_enqueue_scripts', 'add_scripts');
|
||||||
function add_scripts(){
|
function add_scripts(){
|
||||||
wp_register_script( 'htmx', 'https://unpkg.com/htmx.org@2.0.3', false, null, true);
|
wp_register_script( 'htmx', 'https://unpkg.com/htmx.org@2.0.3', false, null, true);
|
||||||
if(is_front_page()):
|
if(is_front_page() || is_page_template('template-passes.php')):
|
||||||
wp_enqueue_script( 'htmx' );
|
wp_enqueue_script( 'htmx' );
|
||||||
endif;
|
endif;
|
||||||
}
|
}
|
||||||
71
package-lock.json
generated
71
package-lock.json
generated
|
|
@ -12,6 +12,7 @@
|
||||||
"@jeffreyvr/tailwindcss-tailpress": "^2.0.0",
|
"@jeffreyvr/tailwindcss-tailpress": "^2.0.0",
|
||||||
"autoprefixer": "^10.4.0",
|
"autoprefixer": "^10.4.0",
|
||||||
"browser-sync": "^2.26.14",
|
"browser-sync": "^2.26.14",
|
||||||
|
"browser-sync-webpack-plugin": "^2.3.0",
|
||||||
"cross-env": "^6.0.3",
|
"cross-env": "^6.0.3",
|
||||||
"laravel-mix": "^6.0.29",
|
"laravel-mix": "^6.0.29",
|
||||||
"postcss": "^8.2.10",
|
"postcss": "^8.2.10",
|
||||||
|
|
@ -3405,6 +3406,19 @@
|
||||||
"stream-throttle": "^0.1.3"
|
"stream-throttle": "^0.1.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/browser-sync-webpack-plugin": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/browser-sync-webpack-plugin/-/browser-sync-webpack-plugin-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-MDvuRrTCtoL11dTdwMymo9CNJvYxJoW67gOO61cThfzHNX40S5WcBU+0bVQ86ll7r7aNpNgyzxF7RtnXMTDbyA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"lodash": "^4"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"browser-sync": "^2",
|
||||||
|
"webpack": "^1 || ^2 || ^3 || ^4 || ^5"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/browserify-aes": {
|
"node_modules/browserify-aes": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
|
||||||
|
|
@ -11817,8 +11831,7 @@
|
||||||
"version": "7.21.0-placeholder-for-preset-env.2",
|
"version": "7.21.0-placeholder-for-preset-env.2",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz",
|
||||||
"integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==",
|
"integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"@babel/plugin-syntax-async-generators": {
|
"@babel/plugin-syntax-async-generators": {
|
||||||
"version": "7.8.4",
|
"version": "7.8.4",
|
||||||
|
|
@ -13342,8 +13355,7 @@
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz",
|
||||||
"integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==",
|
"integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"@webpack-cli/info": {
|
"@webpack-cli/info": {
|
||||||
"version": "1.5.0",
|
"version": "1.5.0",
|
||||||
|
|
@ -13358,8 +13370,7 @@
|
||||||
"version": "1.7.0",
|
"version": "1.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz",
|
||||||
"integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==",
|
"integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"@xtuc/ieee754": {
|
"@xtuc/ieee754": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
|
|
@ -13393,8 +13404,7 @@
|
||||||
"version": "1.9.0",
|
"version": "1.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz",
|
||||||
"integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==",
|
"integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"adjust-sourcemap-loader": {
|
"adjust-sourcemap-loader": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
|
|
@ -13451,8 +13461,7 @@
|
||||||
"version": "3.5.2",
|
"version": "3.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
||||||
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
|
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"ansi-html-community": {
|
"ansi-html-community": {
|
||||||
"version": "0.0.8",
|
"version": "0.0.8",
|
||||||
|
|
@ -13862,6 +13871,15 @@
|
||||||
"stream-throttle": "^0.1.3"
|
"stream-throttle": "^0.1.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"browser-sync-webpack-plugin": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/browser-sync-webpack-plugin/-/browser-sync-webpack-plugin-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-MDvuRrTCtoL11dTdwMymo9CNJvYxJoW67gOO61cThfzHNX40S5WcBU+0bVQ86ll7r7aNpNgyzxF7RtnXMTDbyA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"lodash": "^4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"browserify-aes": {
|
"browserify-aes": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
|
||||||
|
|
@ -14475,8 +14493,7 @@
|
||||||
"version": "6.4.1",
|
"version": "6.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.4.1.tgz",
|
||||||
"integrity": "sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g==",
|
"integrity": "sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"css-loader": {
|
"css-loader": {
|
||||||
"version": "5.2.7",
|
"version": "5.2.7",
|
||||||
|
|
@ -14607,8 +14624,7 @@
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-3.1.0.tgz",
|
||||||
"integrity": "sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==",
|
"integrity": "sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"csso": {
|
"csso": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
|
|
@ -15932,8 +15948,7 @@
|
||||||
"version": "5.1.0",
|
"version": "5.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz",
|
||||||
"integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==",
|
"integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"ieee754": {
|
"ieee754": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
|
|
@ -17263,29 +17278,25 @@
|
||||||
"version": "5.1.2",
|
"version": "5.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.1.2.tgz",
|
||||||
"integrity": "sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ==",
|
"integrity": "sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"postcss-discard-duplicates": {
|
"postcss-discard-duplicates": {
|
||||||
"version": "5.1.0",
|
"version": "5.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.1.0.tgz",
|
||||||
"integrity": "sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==",
|
"integrity": "sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"postcss-discard-empty": {
|
"postcss-discard-empty": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.1.1.tgz",
|
||||||
"integrity": "sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A==",
|
"integrity": "sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"postcss-discard-overridden": {
|
"postcss-discard-overridden": {
|
||||||
"version": "5.1.0",
|
"version": "5.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz",
|
||||||
"integrity": "sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw==",
|
"integrity": "sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"postcss-import": {
|
"postcss-import": {
|
||||||
"version": "14.1.0",
|
"version": "14.1.0",
|
||||||
|
|
@ -17394,8 +17405,7 @@
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz",
|
||||||
"integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==",
|
"integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"postcss-modules-local-by-default": {
|
"postcss-modules-local-by-default": {
|
||||||
"version": "4.0.3",
|
"version": "4.0.3",
|
||||||
|
|
@ -17513,8 +17523,7 @@
|
||||||
"version": "5.1.0",
|
"version": "5.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.1.0.tgz",
|
||||||
"integrity": "sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==",
|
"integrity": "sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"postcss-normalize-display-values": {
|
"postcss-normalize-display-values": {
|
||||||
"version": "5.1.0",
|
"version": "5.1.0",
|
||||||
|
|
@ -19576,8 +19585,7 @@
|
||||||
"version": "8.15.1",
|
"version": "8.15.1",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.15.1.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.15.1.tgz",
|
||||||
"integrity": "sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==",
|
"integrity": "sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -19688,8 +19696,7 @@
|
||||||
"version": "8.11.0",
|
"version": "8.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz",
|
||||||
"integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==",
|
"integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {}
|
|
||||||
},
|
},
|
||||||
"xmlhttprequest-ssl": {
|
"xmlhttprequest-ssl": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
"@jeffreyvr/tailwindcss-tailpress": "^2.0.0",
|
"@jeffreyvr/tailwindcss-tailpress": "^2.0.0",
|
||||||
"autoprefixer": "^10.4.0",
|
"autoprefixer": "^10.4.0",
|
||||||
"browser-sync": "^2.26.14",
|
"browser-sync": "^2.26.14",
|
||||||
|
"browser-sync-webpack-plugin": "^2.3.0",
|
||||||
"cross-env": "^6.0.3",
|
"cross-env": "^6.0.3",
|
||||||
"laravel-mix": "^6.0.29",
|
"laravel-mix": "^6.0.29",
|
||||||
"postcss": "^8.2.10",
|
"postcss": "^8.2.10",
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,15 @@
|
||||||
|
|
||||||
input[type="text"],
|
input[type="text"],
|
||||||
input[type="password"]{
|
input[type="password"]{
|
||||||
@apply mb-4 h-12 w-full rounded-md px-4;
|
@apply mb-4 w-full rounded-md px-4;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="submit"]{
|
input[type="submit"]{
|
||||||
@apply mb-4 h-12 w-full rounded-md bg-primary text-center text-white;
|
@apply mb-4 w-full rounded-md bg-primary text-center text-white;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"]{
|
||||||
|
@apply min-h-fit;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -14,7 +14,7 @@ if (is_front_page() && is_user_logged_in()):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
?>
|
?>
|
||||||
<div class="form-connection w-4/6 mx-auto bg-light rounded-md">
|
<div class="form-connection form-add-event hidden opacity-0 transform scale-95 transition-all duration-500 w-4/6 mx-auto bg-light rounded-md mb-8">
|
||||||
<div class="w-4/6 mx-auto py-6">
|
<div class="w-4/6 mx-auto py-6">
|
||||||
<h2 class="text-xxl mb-4">Se connecter</h2>
|
<h2 class="text-xxl mb-4">Se connecter</h2>
|
||||||
<?php
|
<?php
|
||||||
|
|
@ -37,7 +37,11 @@ else:
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
//Les events
|
||||||
|
get_template_part(
|
||||||
|
'template-parts/events-display',
|
||||||
|
null
|
||||||
|
);
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,30 @@
|
||||||
<?php
|
<?php
|
||||||
|
$today = date('Ymd');
|
||||||
// WP_Query arguments
|
// WP_Query arguments
|
||||||
$args = array(
|
$args = array(
|
||||||
'post_type' => 'evenements',
|
'post_type' => 'evenements',
|
||||||
'posts_per_page' => 6,
|
'posts_per_page' => 6,
|
||||||
'meta_key' => 'date_debut', // Nom du champ ACF
|
//'meta_key' => 'date_debut', // Nom du champ ACF
|
||||||
'orderby' => 'meta_value', // Trier par la valeur du champ
|
'meta_query' => array(
|
||||||
'order' => 'ASC', // Ordre croissant ('DESC' pour décroissant)
|
'relation' => 'OR', // Inclure les événements avec ou sans date de fin
|
||||||
'meta_type' => 'DATE' // Préciser que c'est une date (important)
|
array(
|
||||||
|
'key' => 'date_debut', // Champ pour la date de début
|
||||||
|
'value' => $today, // Comparer avec aujourd'hui
|
||||||
|
'compare' => '>=', // Date de début aujourd'hui ou plus tard
|
||||||
|
'type' => 'DATE',
|
||||||
|
),
|
||||||
|
// Événements en cours (basé sur la date de fin)
|
||||||
|
array(
|
||||||
|
'key' => 'date_fin', // Champ pour la date de fin
|
||||||
|
'value' => $today, // Comparer avec aujourd'hui
|
||||||
|
'compare' => '>=', // Date de fin aujourd'hui ou plus tard
|
||||||
|
'type' => 'DATE',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'orderby' => array(
|
||||||
|
'date_debut' => 'ASC', // Trier par date de début
|
||||||
|
'date_fin' => 'ASC', // Puis par date de fin
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// The Query
|
// The Query
|
||||||
|
|
@ -34,6 +51,7 @@ $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
|
||||||
$date_debut = get_field('date_debut');
|
$date_debut = get_field('date_debut');
|
||||||
$date_fin = get_field('date_fin');
|
$date_fin = get_field('date_fin');
|
||||||
$code_postal = get_field('code_postal');
|
$code_postal = get_field('code_postal');
|
||||||
|
$code_postal = empty($code_postal) ? '4800' : $code_postal;
|
||||||
$organisme = get_field('organisme');
|
$organisme = get_field('organisme');
|
||||||
$lien_de_levenement = get_field('lien_de_levenement');
|
$lien_de_levenement = get_field('lien_de_levenement');
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
90
template-parts/past-events.php
Normal file
90
template-parts/past-events.php
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
<?php
|
||||||
|
$today = date('Ymd');
|
||||||
|
// WP_Query arguments
|
||||||
|
$args = array(
|
||||||
|
'post_type' => 'evenements',
|
||||||
|
'posts_per_page' => 6,
|
||||||
|
//'meta_key' => 'date_debut', // Nom du champ ACF
|
||||||
|
'meta_query' => array(
|
||||||
|
'relation' => 'OR', // Inclure les événements avec ou sans date de fin
|
||||||
|
array(
|
||||||
|
'key' => 'date_debut', // Champ pour la date de début
|
||||||
|
'value' => $today, // Comparer avec aujourd'hui
|
||||||
|
'compare' => '<', // Date de début aujourd'hui ou plus tard
|
||||||
|
'type' => 'DATE',
|
||||||
|
),
|
||||||
|
// Événements en cours (basé sur la date de fin)
|
||||||
|
array(
|
||||||
|
'key' => 'date_fin', // Champ pour la date de fin
|
||||||
|
'value' => $today, // Comparer avec aujourd'hui
|
||||||
|
'compare' => '<', // Date de fin aujourd'hui ou plus tard
|
||||||
|
'type' => 'DATE',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'orderby' => array(
|
||||||
|
'date_debut' => 'DESC', // Trier par date de début
|
||||||
|
'date_fin' => 'DESC', // Puis par date de fin
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// The Query
|
||||||
|
$query = new WP_Query( $args );
|
||||||
|
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<div class="relative flex flex-col w-full h-full overflow-scroll text-gray-700 bg-white shadow-md rounded-xl bg-clip-border">
|
||||||
|
<table class="w-full text-left table-auto min-w-max">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="p-4 border-b border-slate-300 bg-slate-200">Début</th>
|
||||||
|
<th class="p-4 border-b border-slate-300 bg-slate-200">Fin</th>
|
||||||
|
<th class="p-4 border-b border-slate-300 bg-slate-200">CP</th>
|
||||||
|
<th class="p-4 border-b border-slate-300 bg-slate-200">Organisme</th>
|
||||||
|
<th class="p-4 border-b border-slate-300 bg-slate-200">Titre</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="posts">
|
||||||
|
<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?>
|
||||||
|
<?php
|
||||||
|
$date_debut = get_field('date_debut');
|
||||||
|
$date_fin = get_field('date_fin');
|
||||||
|
$code_postal = get_field('code_postal');
|
||||||
|
$code_postal = empty($code_postal) ? '4800' : $code_postal;
|
||||||
|
$organisme = get_field('organisme');
|
||||||
|
$lien_de_levenement = get_field('lien_de_levenement');
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td class="p-4 border-b border-slate-300"><?php echo $date_debut; ?></td>
|
||||||
|
<td class="p-4 border-b border-slate-300"><?php echo $date_fin; ?></td>
|
||||||
|
<td class="p-4 border-b border-slate-300"><?php echo $code_postal; ?></td>
|
||||||
|
<td class="p-4 border-b border-slate-300"><?php echo $organisme; ?></td>
|
||||||
|
<td class="p-4 border-b border-slate-300"><a href="<?php echo $lien_de_levenement; ?>" target="_blank"><?php the_title(); ?></a></td>
|
||||||
|
</tr>
|
||||||
|
<?php endwhile; else : ?>
|
||||||
|
<p><?php esc_html_e( "Il n'y a plus d'événements à charger." ); ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="pagination flex flex-col items-center">
|
||||||
|
<button
|
||||||
|
id="more"
|
||||||
|
hx-get="/wp-json/htmx/v1/past-events?paged=<?php echo $paged+1; ?>"
|
||||||
|
hx-trigger="revealed"
|
||||||
|
class="bg-secondary py-2 px-4 mt-8 rounded-md text-white cursor-pointer mx-auto">
|
||||||
|
<svg class="text-slate-400 animate-spin inline mr-3 htmx-indicator hidden" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="18" height="18">
|
||||||
|
<path
|
||||||
|
d="M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z"
|
||||||
|
stroke="currentColor" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||||
|
<path
|
||||||
|
d="M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762"
|
||||||
|
stroke="currentColor" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
class="text-white"></path>
|
||||||
|
</svg>
|
||||||
|
Plus d'événements
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
23
template-passes.php
Normal file
23
template-passes.php
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php /* Template Name: Template événements passés */ ?>
|
||||||
|
<?php
|
||||||
|
get_header();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="container mx-auto my-8">
|
||||||
|
|
||||||
|
<?php if ( have_posts() ) : ?>
|
||||||
|
<?php
|
||||||
|
while ( have_posts() ) :
|
||||||
|
the_post();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php get_template_part( 'template-parts/past-events', get_post_format() ); ?>
|
||||||
|
|
||||||
|
<?php endwhile; ?>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
get_footer();
|
||||||
|
|
@ -18,13 +18,17 @@ mix.postCss("resources/css/app.css", "css");
|
||||||
|
|
||||||
mix.postCss("resources/css/editor-style.css", "css");
|
mix.postCss("resources/css/editor-style.css", "css");
|
||||||
|
|
||||||
// mix.browserSync({
|
mix.browserSync({
|
||||||
// proxy: 'http://tailpress.test',
|
proxy: 'http://culturel.local',
|
||||||
// host: 'tailpress.test',
|
host: 'culturel.local',
|
||||||
// open: 'external',
|
open: 'external',
|
||||||
// port: 8000
|
port: 8000,
|
||||||
// injectChanges: true
|
injectChanges: true,
|
||||||
// });
|
files: [
|
||||||
|
'resources/**/*', // Fichiers CSS/JS
|
||||||
|
'**/*.php', // Fichiers PHP
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
if (mix.inProduction()) {
|
if (mix.inProduction()) {
|
||||||
mix.version();
|
mix.version();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user