152 lines
8.8 KiB
PHP
152 lines
8.8 KiB
PHP
<?php
|
|
global $tp;
|
|
global $mob;
|
|
|
|
if(empty($score_card)) {
|
|
$score_card = get_field('score_card');
|
|
}
|
|
|
|
?>
|
|
|
|
<?php if(!empty($score_card)) : ?>
|
|
<div class="store-card fw fw-container">
|
|
<div class="store-card__wrapper wrapper wrapper_small">
|
|
<?php if(!empty($score_card['title']) || !empty($score_card['subtitle']['text'])) : ?>
|
|
<h2 class="score-card__title textblock__title title">
|
|
<?php if(!empty($score_card['title'])) : ?>
|
|
<span class="title-text"><?php echo $score_card['title']; ?></span>
|
|
<?php endif; ?>
|
|
|
|
<?php if(!empty($score_card['subtitle'])) : ?>
|
|
<span class="score-card__subtitle subtitle-text textblock__subtitle subtitle subtitle_paint"><?php echo $score_card['subtitle']; ?></span>
|
|
<?php endif; ?>
|
|
</h2>
|
|
<?php endif; ?>
|
|
|
|
<?php if(!empty($score_card['text'])) : ?>
|
|
<div class="store-card__text description"><?php echo $score_card['text']; ?></div>
|
|
<?php endif; ?>
|
|
|
|
<?php if(!empty($score_card['brands'])) : ?>
|
|
<?php if(!$mob) : ?>
|
|
<div class="store-card__brands brands-icons__list brands-icons__list_scorecard" data-slides-count="5" data-slides-margin="70">
|
|
<div class="brands-icons__list-arrow brands-icons__list-arrow_prev"><i></i></div>
|
|
<div class="brands-icons__list-slider-wrap">
|
|
<div class="brands-icons__list-slider swiper-container">
|
|
<div class="swiper-wrapper">
|
|
<?php foreach($score_card['brands'] as $b) : ?>
|
|
<div class="swiper-slide">
|
|
<div class="brands-icons__list-item"><img src="<?php echo $b['url']; ?>" alt="Marque" /></div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="brands-icons__list__arrow brands-icons__list__arrow_next"><i></i></div>
|
|
</div>
|
|
<?php else : ?>
|
|
<div class="store-card__brands brands-icons__list brands-icons__list_scorecard brands-icons__list_mobile">
|
|
<?php foreach($score_card['brands'] as $b) : ?>
|
|
<div class="brands-icons__list-item"><img src="<?php echo $b['url']; ?>" alt="Marque" /></div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
|
|
<?php if(!empty($score_card['list'])) : ?>
|
|
<div class="store-card-list store-card-list">
|
|
<?php $num = 1; ?>
|
|
<?php foreach ($score_card['list'] as $l) : ?>
|
|
<?php if (!$mob): ?>
|
|
<div class="store-card-list__item store-card-item">
|
|
<div class="store-card-item__goal store-card-item__block">
|
|
<div class="store-card-item__tip">Objectif <?php echo $num; ?></div>
|
|
<div class="store-card-item__title subtitle"><?php echo $l['title']; ?></div>
|
|
</div>
|
|
<div class="store-card-item__characteristics">
|
|
<div class="store-card-item__indicator store-card-item__block">
|
|
<div class="store-card-item__tip left-column">Indicateurs</div>
|
|
<div class="store-card-item__years right-column">
|
|
<?php if(!empty($l['years'])) : ?>
|
|
<?php foreach ($l['years'] as $y) : ?>
|
|
<div class="store-card-item__year"><?php echo $y['year']; ?></div>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php if(!empty($l['characteristics_list'])) : ?>
|
|
<?php foreach ($l['characteristics_list'] as $item) : ?>
|
|
<div class="characteristic-row">
|
|
<div class="left-column">
|
|
<p class="characteristic-text"><?= $item['text']; ?></p>
|
|
</div>
|
|
<div class="right-column">
|
|
<div class="percents-wrapper"
|
|
style="background-image: url(<?= $item['image']; ?>);">
|
|
<?php foreach ($item['percent'] as $percent): ?>
|
|
<div class="store-card-item__percent"><?= $percent['text']; ?></div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="store-card-list__item store-card-item store-card-list__item-mobile">
|
|
<div class="store-card-item__goal store-card-item__block store-card-item__goal-mobile">
|
|
<div class="store-card-item__tip">Objectif <?php echo $num; ?></div>
|
|
<div class="store-card-item__title subtitle"><?php echo $l['title']; ?></div>
|
|
</div>
|
|
<div class="store-card-item__characteristics store-card-item__characteristics-mobile">
|
|
<?php if(!empty($l['characteristics_list'])) : ?>
|
|
<?php foreach ($l['characteristics_list'] as $k => $item) : ?>
|
|
<div class="characteristic-row">
|
|
<div class="characteristic-text-block">
|
|
<p class="characteristic-text">
|
|
<span>Indicateur <?= $k + 1; ?> : </span>
|
|
<?= $item['text']; ?>
|
|
</p>
|
|
</div>
|
|
<div class="characteristic-years-block">
|
|
<?php if(!empty($l['years'])) : ?>
|
|
<?php foreach ($l['years'] as $y) : ?>
|
|
<div class="store-card-item__year"><?php echo $y['year']; ?></div>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
<div class="characteristic-percent-block">
|
|
<div class="percents-wrapper"
|
|
style="background-image: url(<?= $item['image']; ?>);">
|
|
<?php foreach ($item['percent'] as $percent): ?>
|
|
<div class="store-card-item__percent"><?= $percent['text']; ?></div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php endif;?>
|
|
<?php $num++; ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
<style>
|
|
<?php for ($i = 0; $i < count($score_card["list"]); $i++)
|
|
{
|
|
if ($score_card["list"][$i]["image"]["url"] != NULL) {
|
|
?>
|
|
.store-card-item:nth-of-type(<?php echo $i + 1; ?>) .store-card-item__percents {
|
|
background: url('<?php echo $score_card["list"][$i]["image"]["url"]; ?>');
|
|
}
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</style>
|