Upgrade contact form

'A request as a professional'
This commit is contained in:
Jérémy Munsch 2021-04-22 07:13:25 +02:00
parent 04e55a3475
commit 02fcc4e44e
3 changed files with 115 additions and 14 deletions

View file

@ -471,6 +471,23 @@ $(document).ready(function(){
let iframe = $(this).find('iframe')[0];
$(iframe).attr( 'src', function ( i, val ) { return val; });
});
$('.contact-index button.textblock__info-btn').on('click', function (e) {
e.preventDefault();
var $target = $('#' + $(this).data('target'));
$(this).toggleClass('toggle');
if ($target) {
if ($target.css('display') == 'flex') {
$target.slideUp();
} else {
$target.slideDown({
start: function () {
$(this).css({
display: "flex"
})
}
});
}
}
});
});

View file

@ -22,8 +22,16 @@ get_header();
<div class="contact-index">
<a class="textblock__info-btn btn" href="<?= get_permalink(6246) ?>" title="Nous rejoindre en tant que collaborateur"><?php _e('Join us as an employee', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<a class="textblock__info-btn btn" href="<?= get_permalink(6249) ?>" title="Nous rejoindre en tant qu'éleveur"><?php _e('Join us as a farmer', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<a class="textblock__info-btn btn" href="<?= get_permalink(6670) ?>" title="L'export"><?php _e('Export', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<a class="textblock__info-btn btn" href="<?= get_permalink(6672) ?>" title="Une demande en tant que client / détaillant / distributeur"><?php _e('A request as a customer / retailer / distributor', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<!-- TODO: deactiver formulaire Une demande en tant que client / détaillant / distributeur (6672,8640) ldc.fr -->
<button class="textblock__info-btn btn" rel="noindex,nofollow" data-target="askPro" title="Une demande en tant que professionnel"><?php _e('A request as a professional', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></button>
<div id="askPro" class="contacts-group-buttons">
<div>
<a class="textblock__info-btn btn" href="https://www.ldc-restauration.fr/nous-contacter/" rel="external" target="_blank" title=" Restaurations, Distributeur et DétaillantFrance"><?php _e('Restorations, Distributor and RetailerFrance ', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
</div>
<div>
<a class="textblock__info-btn btn" href="<?= get_permalink(6670) ?>" title="Autres Pays / Export"><?php _e('Other Countries / Export ', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
</div>
</div>
<a class="textblock__info-btn btn" href="<?= get_permalink(6674) ?>" title="La finance"><?php _e('Finance', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<a class="textblock__info-btn btn" href="<?= get_permalink(6676) ?>" title="Nos engagements"><?php _e('Our commitments', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<a class="textblock__info-btn btn" href="<?= get_permalink(6681) ?>" title="Une information produit"><?php _e('Product information', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
@ -35,8 +43,15 @@ get_header();
<div class="contact-index">
<a class="textblock__info-btn btn" href="<?= get_permalink(8625) ?>" title="Nous rejoindre en tant que collaborateur"><?php _e('Join us as an employee', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<a class="textblock__info-btn btn" href="<?= get_permalink(8596) ?>" title="Nous rejoindre en tant qu'éleveur"><?php _e('Join us as a farmer', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<a class="textblock__info-btn btn" href="<?= get_permalink(8571) ?>" title="L'export"><?php _e('Export', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<a class="textblock__info-btn btn" href="<?= get_permalink(8640) ?>" title="Une demande en tant que client / détaillant / distributeur"><?php _e('A request as a customer / retailer / distributor', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<button class="textblock__info-btn btn" rel="noindex,nofollow" data-target="askPro" title="Une demande en tant que professionnel"><?php _e('A request as a professional', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></button>
<div id="askPro" class="contacts-group-buttons">
<div>
<a class="textblock__info-btn btn" href="https://www.ldc-restauration.fr/nous-contacter/" rel="external" target="_blank" title=" Restaurations, Distributeur et DétaillantFrance"><?php _e('Restorations, Distributor and RetailerFrance ', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
</div>
<div>
<a class="textblock__info-btn btn" href="<?= get_permalink(8571) ?>" title="Autres Pays / Export"><?php _e('Other Countries / Export ', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
</div>
</div>
<a class="textblock__info-btn btn" href="<?= get_permalink(8586) ?>" title="La finance"><?php _e('Finance', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<a class="textblock__info-btn btn" href="<?= get_permalink(8592) ?>" title="Nos engagements"><?php _e('Our commitments', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
<a class="textblock__info-btn btn" href="<?= get_permalink(8647) ?>" title="Une information produit"><?php _e('Product information', 'LDC Custom string'); ?><i class="btn__icon btn__icon_arrow-right"></i></a>
@ -45,20 +60,28 @@ get_header();
</div>
<?php endif ?>
<!-- Nous rejoindre en tant que collaborateur -->
<?php if ($post->ID === 6246 || $post->ID === 8625) : require_once('contacts/6246_collaborateurs.php'); endif ?>
<?php if ($post->ID === 6246 || $post->ID === 8625) : require_once('contacts/6246_collaborateurs.php');
endif ?>
<!-- Nous rejoindre en tant qu'éleveur -->
<?php if ($post->ID === 6249 || $post->ID === 8596) : require_once('contacts/6249_eleveurs.php'); endif ?>
<?php if ($post->ID === 6249 || $post->ID === 8596) : require_once('contacts/6249_eleveurs.php');
endif ?>
<!-- L'export -->
<?php if ($post->ID === 6670 || $post->ID === 8571) : require_once('contacts/6670_export.php'); endif ?>
<?php if ($post->ID === 6670 || $post->ID === 8571) : require_once('contacts/6670_export.php');
endif ?>
<!-- Une demande en tant que client / détaillant / distributeur -->
<?php if ($post->ID === 6672 || $post->ID === 8640) : require_once('contacts/6672_demande.php'); endif ?>
<?php
//if ($post->ID === 6672 || $post->ID === 8640) require_once('contacts/6672_demande.php'); ?>
<!-- La finance -->
<?php if ($post->ID === 6674 || $post->ID === 8586) : require_once('contacts/6674_finance.php'); endif ?>
<?php if ($post->ID === 6674 || $post->ID === 8586) : require_once('contacts/6674_finance.php');
endif ?>
<!-- Nos engagements -->
<?php if ($post->ID === 6676 || $post->ID === 8592) : require_once('contacts/6676_engagements.php'); endif ?>
<?php if ($post->ID === 6676 || $post->ID === 8592) : require_once('contacts/6676_engagements.php');
endif ?>
<!-- Une autre information générale -->
<?php if ($post->ID === 6678 || $post->ID === 8634) : require_once('contacts/6678_information_generale.php'); endif ?>
<?php if ($post->ID === 6678 || $post->ID === 8634) : require_once('contacts/6678_information_generale.php');
endif ?>
<!-- Une information produit -->
<?php if ($post->ID === 6681 || $post->ID === 8647) : require_once('contacts/6681_information_produit.php'); endif ?>
<?php if ($post->ID === 6681 || $post->ID === 8647) : require_once('contacts/6681_information_produit.php');
endif ?>
</div>
<?php get_footer(); ?>
<?php get_footer(); ?>

View file

@ -4265,6 +4265,22 @@ body .pgntn-page-pagination-block .page-numbers.current {
.contacts-category-page .button-wrapper {
text-align: center;
}
.contacts-group-buttons {
display: none;
flex-direction: column;
align-items: center;
background: rgba(0, 0, 0, 0.05) none repeat scroll 0% 0%;
padding: 0px 2em 2em;
margin-top: 1em;
border-radius: 10px;
transform: rotate(90deg), translateY(-2px);
}
button.textblock__info-btn .btn__icon {
transition: all 0.4s;
}
button.textblock__info-btn.toggle .btn__icon {
transform: rotate(90deg) translateX(-10px);
}
.back-button-wrapper {
margin-bottom: 60px;
}
@ -4980,6 +4996,51 @@ textarea.form__input {
align-items: center;
}
.contact-index button {
display: inline;
border: none;
padding: 0.6rem 3rem;
text-decoration: none;
font-family: sans-serif;
font-size: 1rem;
cursor: pointer;
text-align: center;
transition: background 250ms ease-in-out,
transform 150ms ease;
-webkit-appearance: none;
-moz-appearance: none;
box-sizing: border-box;
width: auto;
display: inline-flex;
justify-content: center;
align-items: center;
height: 45px;
padding: 0 30px;
padding-bottom: 3px;
border-radius: 999px;
border: 1px solid #ff4e4e;
background: #ff4e4e;
font-weight: 500;
font-size: 18px;
color: #fff;
transition: all 0.3s;
}
.contact-index button:disabled,
.contact-index button[disabled] {
color: #AAA;
}
.contact-index button:hover,
.contact-index button:focus {
border-color: #B43534;
background: #B43534;
}
.contact-index button:focus {
outline: transparent;
}
.list-items.posts-container {
display: block;
margin: 0 auto;