Add score card legends
This commit is contained in:
parent
04e55a3475
commit
785aa8341e
2 changed files with 42 additions and 30 deletions
|
|
@ -2,39 +2,39 @@
|
|||
global $tp;
|
||||
global $mob;
|
||||
|
||||
if(empty($score_card)) {
|
||||
if (empty($score_card)) {
|
||||
$score_card = get_field('score_card');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php if(!empty($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'])) : ?>
|
||||
<?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'])) : ?>
|
||||
<?php if (!empty($score_card['title'])) : ?>
|
||||
<span class="title-text"><?php echo $score_card['title']; ?></span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if(!empty($score_card['subtitle'])) : ?>
|
||||
<?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'])) : ?>
|
||||
<?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) : ?>
|
||||
<?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) : ?>
|
||||
<?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>
|
||||
|
|
@ -46,18 +46,18 @@ if(empty($score_card)) {
|
|||
</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) : ?>
|
||||
<?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'])) : ?>
|
||||
<?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): ?>
|
||||
<?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"><?php _e('Objective', 'LDC Custom string'); ?> <?php echo $num; ?></div>
|
||||
|
|
@ -67,23 +67,22 @@ if(empty($score_card)) {
|
|||
<div class="store-card-item__indicator store-card-item__block">
|
||||
<div class="store-card-item__tip left-column"><?php _e('Indicator', 'LDC Custom string'); ?></div>
|
||||
<div class="store-card-item__years right-column">
|
||||
<?php if(!empty($l['years'])) : ?>
|
||||
<?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 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="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>
|
||||
|
|
@ -91,16 +90,21 @@ if(empty($score_card)) {
|
|||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($l['characteristics_list_desc'])) : ?>
|
||||
<div class="characteristic-row characteristic-desc">
|
||||
<?php print_r($l['characteristics_list_desc']); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?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"><?php _e('Objective', 'LDC Custom string') ?> <?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 if (!empty($l['characteristics_list'])) : ?>
|
||||
<?php foreach ($l['characteristics_list'] as $k => $item) : ?>
|
||||
<div class="characteristic-row">
|
||||
<div class="characteristic-text-block">
|
||||
|
|
@ -110,16 +114,15 @@ if(empty($score_card)) {
|
|||
</p>
|
||||
</div>
|
||||
<div class="characteristic-years-block">
|
||||
<?php if(!empty($l['years'])) : ?>
|
||||
<?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="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>
|
||||
|
|
@ -127,9 +130,14 @@ if(empty($score_card)) {
|
|||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($l['characteristics_list_desc'])) : ?>
|
||||
<div class="characteristic-row characteristic-desc">
|
||||
<?php print_r($l['characteristics_list_desc']); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php endif; ?>
|
||||
<?php $num++; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
|
@ -138,11 +146,9 @@ if(empty($score_card)) {
|
|||
</div>
|
||||
<?php endif; ?>
|
||||
<style>
|
||||
<?php for ($i = 0; $i < count($score_card["list"]); $i++): ?>
|
||||
<?php if (isset($score_card["list"][$i]["image"]["url"])): ?>
|
||||
.store-card-item:nth-of-type(<?php echo $i + 1; ?>) .store-card-item__percents {
|
||||
<?php for ($i = 0; $i < count($score_card["list"]); $i++) : ?><?php if (isset($score_card["list"][$i]["image"]["url"])) : ?>.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 endif; ?>
|
||||
<?php endfor; ?>
|
||||
</style>
|
||||
|
||||
<?php endif; ?><?php endfor; ?>
|
||||
</style>
|
||||
|
|
@ -3186,6 +3186,12 @@ body .pgntn-page-pagination-block .page-numbers.current {
|
|||
align-items: center;
|
||||
padding: 10px 30px 0;
|
||||
}
|
||||
|
||||
.characteristic-row.characteristic-desc {
|
||||
font-style: italic;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.store-card-item__characteristics .percents-wrapper {
|
||||
display: flex;
|
||||
background-size: 100% 100%;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue