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/views/profile/pet-card.twig

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