You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
cosmopet-architecture/wp-content/themes/cosmopet/templates/pet-card.twig

81 lines
4.1 KiB

<div class="cabinet-card cabinet-card--green">
<div class="cabinet-card__content">
<div class="cabinet-card__pet">
<div class="cabinet-card-pet__icon">
<div class="cabinet-card-pet-icon__content">
<img src="{{ function('get_template_directory_uri') }}/static/img/pet/mini-{{ function('get_field', 'type', pet_id) }}.png" alt="">
</div>
</div>
<p class="cabinet-card-pet__name">{{ function('get_the_title', pet_id) }}</p>
</div>
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Breed') }}:</p>
<p class="cabinet-card__text">{{ function('get_field', 'breed', pet_id) }}</p>
</div>
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Weight') }}:</p>
<p class="cabinet-card__text">
{% set weight_key = function('get_field', 'weight', pet_id) %}
{% if weight_key == 'below_1_5' %}{{ pll_e('from 0,5 kg to 1,5 kg') }}
{% elseif weight_key == '1_5-3' %}{{ pll_e('from 1.5 to 3 kg') }}
{% elseif weight_key == '3-5' %}{{ pll_e('from 3 to 5 kg') }}
{% elseif weight_key == '5-8' %}{{ pll_e('from 5 to 8 kg') }}
{% elseif weight_key == '8-11' %}{{ pll_e('from 8 to 11 kg') }}
{% elseif weight_key == '11-15' %}{{ pll_e('from 11 to 15 kg') }}
{% elseif weight_key == '15-20' %}{{ pll_e('from 15 to 20 kg') }}
{% elseif weight_key == '20-25' %}{{ pll_e('from 20 to 25 kg') }}
{% elseif weight_key == '25-35' %}{{ pll_e('from 25 to 35 kg') }}
{% elseif weight_key == 'more_35' %}{{ pll_e('More than 35 kg') }}
{% endif %}
</p>
</div>
{% if function('get_field', 'old', pet_id) %}
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Age') }}:</p>
<p class="cabinet-card__text">
{% set age_key = function('get_field', 'old', pet_id) %}
{% if age_key == 'normal' %}{{ pll_e('Adult (from 1 year to 7 years)') }}
{% elseif age_key == 'old' %}{{ pll_e('Elderly (from 7 to 12 years)') }}
{% elseif age_key == 'very_old' %}{{ pll_e('Aging (12 years and older)') }}
{% elseif age_key == 'baby' %}{{ pll_e('Baby (from 0 to 1 year)') }}
{% endif %}
</p>
</div>
{% else %}
{% set month = function('get_field', 'month', pet_id) %}
{% set zero = month < 10 ? '0' : '' %}
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Birthday') }}:</p>
<p class="cabinet-card__text">
{{ function('get_field', 'day', pet_id) }}.{{ zero }}{{ month }}.{{ function('get_field', 'year', pet_id) }}
</p>
</div>
{% endif %}
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Activity') }}:</p>
<p class="cabinet-card__text">
{% set activity_key = function('get_field', 'activity', pet_id) %}
{% if activity_key == 'low' %}{{ pll_e('Low') }}
{% elseif activity_key == 'moderate' %}{{ pll_e('Moderate') }}
{% elseif activity_key == 'high' %}{{ pll_e('High') }}
{% endif %}
</p>
</div>
{% if function('get_field', 'type', pet_id) == 'cat' and function('get_field', 'sterilized', pet_id) %}
<div class="cabinet-card__element">
<p class="cabinet-card__label">{{ pll_e('Sterilized') }}</p>
</div>
{% endif %}
<div class="cabinet-card__element">
<button class="cabinet-card__button" data-edit="{{ pet_id }}">
{{ pll_e('Edit') }}
</button>
</div>
</div>
</div>