Сделал 1. Сделать пункты в "ТЗ Статья" 2. Сделать пункты в "ТЗ Хабовая страница" 3. Добавить микроразметку для статьи и блога https://docs.google.com/document/d/1ouFTKIXGk44hKONDDNWFGXBVqG06LWb7Jt28yFxklME/edit?tab=t.f4g9ytbmj2o8#heading=h.91km96rm8vln Reviewed-on: #1 Co-authored-by: WEB № 55 - Кирилл | Верстка <web_55@good-production.xyz>
123 lines
6.1 KiB
PHP
123 lines
6.1 KiB
PHP
<?php
|
|
$is_driver = (is_singular('driver') || is_page(76)) ? true : false;
|
|
$is_courier = (is_singular('courier') || is_page(78)) ? true : false;
|
|
$is_cargo = is_page(630) ? true : false;
|
|
if ($is_driver) {
|
|
$page_id = 76;
|
|
} elseif ($is_courier) {
|
|
$page_id = 78;
|
|
} elseif ($is_cargo) {
|
|
$page_id = 630;
|
|
} else {
|
|
$page_id = 'option';
|
|
}
|
|
|
|
$this_page_id = get_the_ID();
|
|
|
|
$calculator_title = get_field('calculator_title', $this_page_id);
|
|
$income_title = $calculator_title
|
|
? 'Калькулятор дохода ' . esc_html($calculator_title)
|
|
: get_field('income_title', $page_id);
|
|
$income_descr = get_field('income_descr', $page_id);
|
|
if ($income_title && ($calculator_title || $income_descr)) :
|
|
?>
|
|
<section class="income">
|
|
<div class="container">
|
|
<h2 class="income-title section-title"><?php echo $income_title; ?></h2>
|
|
<?php if (!$calculator_title && $income_descr) : ?>
|
|
<div class="income-descr section-descr"><?php echo $income_descr; ?></div>
|
|
<?php endif; ?>
|
|
<form class="income-calc<?php if ($is_driver || $is_courier || $is_cargo) echo ' income-calc--single'; ?>">
|
|
<div class="income-calc__top">
|
|
<fieldset class="income-calc__types">
|
|
<legend class="visually-hidden">Тип занятости</legend>
|
|
<label class="income-calc__type income-calc__type--taxi">
|
|
<input class="income-calc__type-input js-calc-type" type="radio" name="work_type" value="taxi"<?php if (!$is_courier && !$is_cargo) echo ' checked'; ?>>
|
|
<span class="income-calc__type-label">Такси</span>
|
|
</label>
|
|
<label class="income-calc__type income-calc__type--courier">
|
|
<input class="income-calc__type-input js-calc-type" type="radio" name="work_type" value="courier"<?php if ($is_courier) echo ' checked'; ?>>
|
|
<span class="income-calc__type-label">Курьер</span>
|
|
</label>
|
|
<label class="income-calc__type income-calc__type--cargo">
|
|
<input class="income-calc__type-input js-calc-type" type="radio" name="work_type" value="cargo"<?php if ($is_cargo) echo ' checked'; ?>>
|
|
<span class="income-calc__type-label">Грузоперевозки</span>
|
|
</label>
|
|
</fieldset>
|
|
</div>
|
|
<div class="income-calc__controls">
|
|
<fieldset class="income-calc__ranges">
|
|
<legend class="visually-hidden">График работы</legend>
|
|
<div class="income-calc__range js-range-field">
|
|
<div class="income-calc__range-top">
|
|
<label class="income-calc__range-label" for="hours-per-day">Часов в день</label>
|
|
<output class="income-calc__range-value" for="hours-per-day">
|
|
<span class="income-calc__range-number js-range-number">8</span>
|
|
<span class="income-calc__range-unit">ч</span>
|
|
</output>
|
|
</div>
|
|
<input class="income-calc__range-input js-range" id="hours-per-day" type="range" name="hours_per_day" min="1" max="12" step="1" value="8">
|
|
</div>
|
|
<div class="income-calc__range js-range-field">
|
|
<div class="income-calc__range-top">
|
|
<label class="income-calc__range-label" for="days-per-week">Дней в неделю</label>
|
|
<output class="income-calc__range-value" for="days-per-week">
|
|
<span class="income-calc__range-number js-range-number">5</span>
|
|
<span class="income-calc__range-unit">дн</span>
|
|
</output>
|
|
</div>
|
|
<input class="income-calc__range-input js-range" id="days-per-week" type="range" name="days_per_week" min="1" max="7" step="1" value="5">
|
|
</div>
|
|
</fieldset>
|
|
<fieldset class="income-calc__radios">
|
|
<legend class="income-calc__radios-label">Город</legend>
|
|
<div class="income-calc__radios-wrapper">
|
|
<div class="income-calc__radios-inner">
|
|
<label class="income-calc__radio">
|
|
<input class="income-calc__radio-input js-calc-city" type="radio" name="city" value="small">
|
|
<span class="income-calc__radio-label">Небольшой</span>
|
|
</label>
|
|
<label class="income-calc__radio">
|
|
<input class="income-calc__radio-input js-calc-city" type="radio" name="city" value="medium">
|
|
<span class="income-calc__radio-label">Средний</span>
|
|
</label>
|
|
<label class="income-calc__radio">
|
|
<input class="income-calc__radio-input js-calc-city" type="radio" name="city" value="large" checked>
|
|
<span class="income-calc__radio-label">Крупный</span>
|
|
</label>
|
|
<label class="income-calc__radio">
|
|
<input class="income-calc__radio-input js-calc-city" type="radio" name="city" value="moscow">
|
|
<span class="income-calc__radio-label">Москва/СПб</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
<div class="income-calc__result income-result">
|
|
<div class="income-result__main">
|
|
<div class="income-result__label">Твой доход месяц</div>
|
|
<output class="income-result__total js-income-month" name="income_month">80 000 ₽</output>
|
|
<div class="income-result__note">при выбранном графике</div>
|
|
</div>
|
|
<div class="income-result__stats">
|
|
<div class="income-result__stat">
|
|
<span class="income-result__stat-label">За день</span>
|
|
<output class="income-result__stat-value js-income-day">4 000 ₽</output>
|
|
</div>
|
|
<div class="income-result__stat">
|
|
<span class="income-result__stat-label">За неделю</span>
|
|
<output class="income-result__stat-value js-income-week">20 000 ₽</output>
|
|
</div>
|
|
<div class="income-result__stat">
|
|
<span class="income-result__stat-label">За час</span>
|
|
<output class="income-result__stat-value js-income-hour">500 ₽</output>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<?php if (!$is_driver && !$is_courier && !$is_cargo) : ?>
|
|
<div class="income-footnote">Расчёт примерный. Реальный доход зависит от сезона, <span class="js-footnote-text">класса авто, района, активности водителя</span></div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</section>
|
|
<?php endif; ?>
|