From cfd53e815fff5bfb82bcce744174f4f7cc770327 Mon Sep 17 00:00:00 2001 From: maksim Date: Fri, 20 Jun 2025 10:54:55 +0300 Subject: [PATCH] =?UTF-8?q?Task=206811=20|=20=D0=B2=D0=BE=D1=81=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=BE=D1=81=D0=BF=D0=BE=D1=81=D0=BE?= =?UTF-8?q?=D0=B1=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D1=84=D1=83=D0=BD=D0=BA?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=B8=D1=82?= =?UTF-8?q?=D0=BE=D0=BC=D1=86=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/{ => profile}/pet-card.twig | 22 +- .../templates/profile/pet-edit-card.twig | 223 ++++++++++++++++++ .../templates/profile/profile-base.twig | 8 +- 3 files changed, 241 insertions(+), 12 deletions(-) rename wp-content/themes/cosmopet/templates/{ => profile}/pet-card.twig (84%) create mode 100644 wp-content/themes/cosmopet/templates/profile/pet-edit-card.twig diff --git a/wp-content/themes/cosmopet/templates/pet-card.twig b/wp-content/themes/cosmopet/templates/profile/pet-card.twig similarity index 84% rename from wp-content/themes/cosmopet/templates/pet-card.twig rename to wp-content/themes/cosmopet/templates/profile/pet-card.twig index b0c76fc..5ad0646 100644 --- a/wp-content/themes/cosmopet/templates/pet-card.twig +++ b/wp-content/themes/cosmopet/templates/profile/pet-card.twig @@ -3,21 +3,21 @@
- +
-

{{ function('get_the_title', pet_id) }}

+

{{ function('get_the_title', item.id) }}

{{ fn('pll_e', 'Breed') }}:

-

{{ function('get_field', 'breed', pet_id) }}

+

{{ function('get_field', 'breed', item.id) }}

{{ fn('pll_e','Weight') }}:

- {% set weight_key = function('get_field', 'weight', pet_id) %} + {% 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') }} @@ -32,11 +32,11 @@

- {% if function('get_field', 'old', pet_id) %} + {% if function('get_field', 'old', item.id) %}

{{ fn('pll_e', 'Age') }}:

- {% set age_key = function('get_field', 'old', pet_id) %} + {% 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)') }} @@ -45,12 +45,12 @@

{% else %} - {% set month = function('get_field', 'month', pet_id) %} + {% set month = function('get_field', 'month', item.id) %} {% set zero = month < 10 ? '0' : '' %}

{{ fn('pll_e', 'Birthday') }}:

- {{ function('get_field', 'day', pet_id) }}.{{ zero }}{{ month }}.{{ function('get_field', 'year', pet_id) }} + {{ function('get_field', 'day', item.id) }}.{{ zero }}{{ month }}.{{ function('get_field', 'year', item.id) }}

{% endif %} @@ -58,7 +58,7 @@

{{ fn('pll_e', 'Activity') }}:

- {% set activity_key = function('get_field', 'activity', pet_id) %} + {% 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') }} @@ -66,14 +66,14 @@

- {% if function('get_field', 'type', pet_id) == 'cat' and function('get_field', 'sterilized', pet_id) %} + {% if function('get_field', 'type', item.id) == 'cat' and function('get_field', 'sterilized', item.id) %}

{{ fn('pll_e', 'Sterilized') }}

{% endif %}
-
diff --git a/wp-content/themes/cosmopet/templates/profile/pet-edit-card.twig b/wp-content/themes/cosmopet/templates/profile/pet-edit-card.twig new file mode 100644 index 0000000..81b9ad5 --- /dev/null +++ b/wp-content/themes/cosmopet/templates/profile/pet-edit-card.twig @@ -0,0 +1,223 @@ +
+ +
diff --git a/wp-content/themes/cosmopet/templates/profile/profile-base.twig b/wp-content/themes/cosmopet/templates/profile/profile-base.twig index 47d7ae6..c6e0162 100644 --- a/wp-content/themes/cosmopet/templates/profile/profile-base.twig +++ b/wp-content/themes/cosmopet/templates/profile/profile-base.twig @@ -127,7 +127,7 @@ {% if pets %} {% for pet in pets %} - {% include 'pet-card.twig' with { 'item': pet } %} + {% include 'profile/pet-card.twig' with { 'item': pet } %} {% endfor %} {% endif %} @@ -612,4 +612,10 @@ +{% if pets %} + {% for pet in pets %} + {% include 'profile/pet-edit-card.twig' with { 'item': pet } %} + {% endfor %} +{% endif %} + {% endblock %} \ No newline at end of file