updating paper publications order form
This commit is contained in:
parent
c0e204310e
commit
0ae5436c80
|
|
@ -17,11 +17,23 @@ if (class_exists('GF_Field')) {
|
||||||
'post_type' => 'brochures',
|
'post_type' => 'brochures',
|
||||||
'posts_per_page' => -1,
|
'posts_per_page' => -1,
|
||||||
'post_status' => 'publish',
|
'post_status' => 'publish',
|
||||||
|
'order' => 'DESC',
|
||||||
|
'orderby' => 'date',
|
||||||
|
'meta_key' => 'brochure_pdf',
|
||||||
|
'meta_value' => false,
|
||||||
|
'meta_compare' => '!=',
|
||||||
));
|
));
|
||||||
$choices = [];
|
$choices = [];
|
||||||
|
|
||||||
foreach ($brochures_query->posts as $key => $post) {
|
|
||||||
array_push($choices, ['text' => $post->post_title, 'slug' => $post->post_name]);
|
|
||||||
|
|
||||||
|
$sortedBrochuresPosts = sort_posts_per_thematiques_priority($brochures_query);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($sortedBrochuresPosts->posts as $key => $post) {
|
||||||
|
array_push($choices, ['text' => $post->post_title, 'slug' => $post->post_name, 'ID' => $post->ID]);
|
||||||
}
|
}
|
||||||
$this->choices = $choices;
|
$this->choices = $choices;
|
||||||
}
|
}
|
||||||
|
|
@ -70,6 +82,7 @@ if (class_exists('GF_Field')) {
|
||||||
$this->buildChoices();
|
$this->buildChoices();
|
||||||
$form_id = $form['id'];
|
$form_id = $form['id'];
|
||||||
$id = $this->id;
|
$id = $this->id;
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
include 'template-form-order-paper.php';
|
include 'template-form-order-paper.php';
|
||||||
$table = ob_get_clean();
|
$table = ob_get_clean();
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,36 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<fieldset class="field-order-paper-publications">
|
<fieldset class="field-order-paper-publications">
|
||||||
<?php
|
<?php
|
||||||
?>
|
?>
|
||||||
<?php foreach ($this->choices as $index => $brochurePost) : ?>
|
<?php foreach ($this->choices as $index => $brochurePost) : ?>
|
||||||
|
<?php
|
||||||
|
$thematique = getPostMainThematique($brochurePost['ID']);
|
||||||
|
$thematiqueCover = get_field('taxonomy_pictures', "thematiques_" . $thematique->term_id);
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
<div class=" gchoice brochure-order-field">
|
<div class=" gchoice brochure-order-field">
|
||||||
|
<div class="thematique-tag thematique-tag--<?php echo $thematique->slug ?>">
|
||||||
|
<?php if ($thematiqueCover && $thematiqueCover['icon']) : ?>
|
||||||
|
<img class="thematique-icon" src="<?php echo $thematiqueCover['icon']['url'] ?>" alt="">
|
||||||
|
<?php endif; ?>
|
||||||
|
<p>
|
||||||
|
<?php echo $thematique->name ?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
<legend class="brochure-legend gform-field-label gform-field-label--type-inline"><?php echo $brochurePost['text'] ?></legend>
|
<legend class="brochure-legend gform-field-label gform-field-label--type-inline"><?php echo $brochurePost['text'] ?></legend>
|
||||||
|
<a class="preview-brochure" href="<?php echo get_the_permalink($brochurePost['ID']) ?>" target="_blank">voir la brochure</a>
|
||||||
<div class="publications-amount-fr">
|
<div class="publications-amount-fr">
|
||||||
<label id="publications-amount__label-fr" for="<?php echo 'input_' . $id . '[]' ?>" title="<?php echo __("Quantité désiré de brochures en Français", "homegrade-theme__texte-fonctionnel") ?>">fr</label>
|
<label id="publications-amount__label-fr" for="<?php echo 'input_' . $id . '[]' ?>" title="<?php echo __("Quantité désiré de brochures en Français", "homegrade-theme__texte-fonctionnel") ?>">fr</label>
|
||||||
<input type="number" size="1" name="<?php echo 'input_' . $id . '[]' ?>" />
|
<input type="number" size="1" min="0" name="<?php echo 'input_' . $id . '[]' ?>" />
|
||||||
</div>
|
</div>
|
||||||
<div class="publications-amount publications-amount-nl">
|
<div class="publications-amount publications-amount-nl">
|
||||||
<label id="publications-amount__label-nl" for="<?php echo 'input_' . $id . '[]' ?>" title="<?php echo __("Quantité désiré de brochures en Néerlandais", "homegrade-theme__texte-fonctionnel") ?>">nl</label>
|
<label id="publications-amount__label-nl" for="<?php echo 'input_' . $id . '[]' ?>" title="<?php echo __("Quantité désiré de brochures en Néerlandais", "homegrade-theme__texte-fonctionnel") ?>">nl</label>
|
||||||
<input type="number" size="1" name="<?php echo 'input_' . $id . '[]' ?>" />
|
<input type="number" size="1" min="0" name="<?php echo 'input_' . $id . '[]' ?>" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
|
||||||
|
|
@ -182,14 +182,33 @@ form:not(.metabox-location-side):not(.metabox-location-normal):not(
|
||||||
} */
|
} */
|
||||||
|
|
||||||
.field-order-paper-publications {
|
.field-order-paper-publications {
|
||||||
@apply !grid md:grid-cols-2 gap-x-12 gap-y-2;
|
@apply !grid gap-x-12 gap-y-2;
|
||||||
|
|
||||||
.brochure-order-field {
|
.brochure-order-field {
|
||||||
@apply flex justify-end gap-3 items-center;
|
@apply flex justify-end gap-3 items-center max-w-screen-md;
|
||||||
|
.thematique-tag,
|
||||||
legend {
|
legend {
|
||||||
@apply block ml-0 pt-6 !mr-auto !font-normal;
|
@apply mt-6;
|
||||||
|
}
|
||||||
|
.thematique-tag {
|
||||||
|
@apply !py-1 !px-4 !rounded-lg mr-4 flex items-center shrink-0;
|
||||||
|
line-height: 1.7;
|
||||||
|
}
|
||||||
|
.thematique-icon {
|
||||||
|
@apply w-8 mr-3 my-2;
|
||||||
|
}
|
||||||
|
legend {
|
||||||
|
@apply block ml-0 !mr-auto !font-normal;
|
||||||
font-weight: revert !important;
|
font-weight: revert !important;
|
||||||
}
|
}
|
||||||
|
.preview-brochure {
|
||||||
|
@apply !text-neutral-700 flex justify-center items-center;
|
||||||
|
&:after {
|
||||||
|
content: ' ';
|
||||||
|
@apply w-4 h-4 block ml-3 bg-no-repeat bg-center bg-contain;
|
||||||
|
background-image: url('../resources/img/graphic-assets/icone-external-link.svg');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.publications-amount-fr,
|
.publications-amount-fr,
|
||||||
.publications-amount-nl {
|
.publications-amount-nl {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user