templates/front/animal/single.html.twig line 62
{% extends 'layout/base.html.twig' %}
{% block title %}Adopciaki.pl - Profil - {{ animal.name }}{% endblock %}
{% block og_title %}Cześć jestem {{ animal.name }}{% endblock %}
{% set shortDesc = 'Adopciaki.pl to program wspierający odpowiedzialne adopcje psów i kotów. Pomagamy dobrać zwierzaka do stylu życia opiekuna i zapewniamy pomoc specjalistów.' %}
{% if(animal.shortDescription is empty) %}
{% set shortDesc = animal.description|striptags %}
{% else %}
{% set shortDesc = animal.shortDescription %}
{% endif %}
{# Animal Age #}
{% set difference = date("now"|date("Y-m-d")).diff(date(animal.bornDate|date('Y-m-d'))) %}
{% set diffYears = difference.days / 365 %}
{% set months = 0 %}
{% if difference.days < 365 %}
{% set months = 1 %}
{% set diffYears = difference.days / 30 %}
{% endif %}
{% if diffYears|round(0, 'floor') == 0 %}
{% set animalAge = 1 %}
{% else %}
{% set animalAge = diffYears|round(0, 'floor') %}
{% endif %}
{% if months == 1 %}
{% if animalAge == 1 %}
{% set yearsMonths = 'miesiąc' %}
{% elseif (animalAge % 10 ) >= 2 and (animalAge % 10) <= 4 %}
{% if (animalAge % 100) >= 10 and (animalAge % 100) <= 20 %}
{% set yearsMonths = 'miesięcy' %}
{% else %}
{% set yearsMonths = 'miesiące' %}
{% endif %}
{% else %}
{% set yearsMonths = 'miesięcy' %}
{% endif %}
{% else %}
{% if animalAge == 1 %}
{% set yearsMonths = 'rok' %}
{% elseif (animalAge % 10 ) >= 2 and (animalAge % 10) <= 4 %}
{% if (animalAge % 100) >= 10 and (animalAge % 100) <= 20 %}
{% set yearsMonths = 'lat' %}
{% else %}
{% set yearsMonths = 'lata' %}
{% endif %}
{% else %}
{% set yearsMonths = 'lat' %}
{% endif %}
{% endif %}
{% set fullDesc = shortDesc %}
{% set shortDesc = 'Cześć jestem '~ animal.name ~'. Mam około '~animalAge~' '~yearsMonths~'. '~shortDesc %}
{% block description %}{{ shortDesc }}{% endblock %}
{% block og_description %}{{ shortDesc }}{% endblock %}
{% if animal.featuredImage.id is not empty %}
{# {% block og_image %}#}
{# {{ asset(animalImage(animal.featuredImage.path)) | imagine_filter('animal_og_image') }}#}
{# {% endblock %}#}
{% endif %}
{% block content %}
{% set pollStatus = 'default' %}
{# {% if poll is not empty %}#}
{# {% set pollStatus = poll %}#}
{# {% endif %}#}
{% if animal.adoptionDate %}
{% set animalAdopted = 'adopted' %}
{% else %}
{% set animalAdopted = 'not-adopted' %}
{% endif %}
{% set isWatched = false %}
{% if app.user.watchedAnimals is defined %}
{% for watchAnimal in app.user.watchedAnimals%}
{% if watchAnimal.id == animal.id %}
{% set isWatched = true %}
{% endif %}
{% endfor %}
{% endif %}
{% set kidAccept05 = true %}
{% set kidAccept510 = true %}
{% set kidAccept10plus = true %}
{% set kidAcceptName = 'Czuje się niepewnie w towarzystwie dzieci, polecamy raczej do domu bez dzieci' %}
{% for acceptance in animal.kidAcceptances | sort %}
{% set kidAcceptName = acceptance.name %}
{% endfor %}
{% set mainImage = '' %}
{% set gallery = [] %}
{% for key,picture in animal.pictures %}
{% if key == 0 %}
{% set mainImage = asset(animalImage(animal.featuredImage.path)) | imagine_filter('animal_listing_thumb') %}
{% elseif key > 0 and picture.id != animal.fbSqImageId and picture.id != animal.fbLargeImageId %}
{% set gallery = gallery|merge([asset(animalImage(picture.path)) | imagine_filter('animal_gallery_thumb')]) %}
{% endif %}
{% endfor %}
{# {% set noteItemGallery = [] %}#}
{# {% for key,note in notes %}#}
{# {% if note.pictures %}#}
{# {% for key,picture in note.pictures %}#}
{# {% set noteItemGallery = noteItemGallery|merge([asset(animalImage(picture.path)) | imagine_filter('animal_gallery_image')]) %}#}
{# {% endfor %}#}
{# {% endif %}#}
{# {% endfor %}#}
{% set prepSimilarAnimals = [] %}
{% for key,animalItem in similarAnimals %}
{% if animalItem.id is not same as(animal.id) %}
{% set prepSimilarAnimals = prepSimilarAnimals|merge([{
'url' : path('base_front_animal_single', {'id':animalItem.id, 'name': animalItem.name}),
'image' : asset(animalImage(animalItem.featuredImage.path)) | imagine_filter('animal_gallery_thumb')
}]) %}
{% endif %}
{% endfor %}
{% set isLogged = 'false' %}
{% if is_granted('IS_AUTHENTICATED') %}
{% set isLogged = 'true' %}
{% endif %}
<section id="animal-profile">
<div class="container-fluid pt-0 animal-header {% if(animalAdopted == 'adopted') %}animal-adopted{% endif %} mb-4">
<div class="container">
<div class="row d-flex justify-content-center pt-0 pb-5">
<div class="col-12">
<h1 class="animal-heading-title mt-4 mb-5">Cześć, jestem <b>{{ animal.name }}</b> {% if(animalAdopted == 'adopted') %}- mam dom{% endif %}</h1>
</div>
<div class="row">
<div class="col-12 col-lg-6 mb-5 mb-lg-0">
<div class="row">
<div class="col-12 col-sm-6">
<img class="img-fluid" src="{{ mainImage }}" />
</div>
<div class="col-12 col-sm-6">
<div class="row">
<div class="col-12 pt-lg-3">
<p class="animal-heading-info"><b>Zwierzak:</b> {{ animal.species.name }}</p>
</div>
<div class="col-12">
<p class="animal-heading-info"><b>Płeć:</b> {{ animal.sex.name }}</p>
</div>
<div class="col-12">
<p class="animal-heading-info"><b>Wiek:</b> {% if animal.isAgeInMonths == true %}do 1 roku{% else %}{{ animal.age }} {{ yearsMonths }}{% endif %}</p>
</div>
<div class="col-12">
<p class="animal-heading-info"><b>Waga:</b> {{ animal.weight }} kg</p>
</div>
<div class="col-12">
<p class="animal-heading-info"><b>Rozmiar:</b> {{ animal.size }}</p>
</div>
<div class="col-12">
<p class="animal-heading-info"><b>Aktywność:</b> {{ animal.lifeStyle.name }}</p>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 mb-5 mb-lg-0">
<div class="row">
<div class="col-12 col-md-6">
<div class="row pb-4 mini-gallery">
{% for key,picture in animal.pictures %}
{% if key == 1 or key == 2 %}
{% if picture.id != animal.fbSqImageId and picture.id != animal.fbLargeImageId %}
<div class="col-6">
<div class="image" data-image="{{ asset(animalImage(picture.path)) | imagine_filter('animal_gallery_thumb') }}">
<img src="{{ asset(animalImage(picture.path)) | imagine_filter('animal_gallery_thumb') }}" class="img-fluid">
</div>
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>
<div class="row mini-gallery">
{% for key,picture in animal.pictures %}
{% if key == 3 or key == 4 %}
{% if picture.id != animal.fbSqImageId and picture.id != animal.fbLargeImageId %}
<div class="col-6">
<div class="image" data-image="{{ asset(animalImage(picture.path)) | imagine_filter('animal_gallery_thumb') }}">
<img src="{{ asset(animalImage(picture.path)) | imagine_filter('animal_gallery_thumb') }}" class="img-fluid">
</div>
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
<div class="col-12 col-md-6">
<div class="row">
{% if animal.kidAcceptances %}
<div class="col-12 pt-lg-4">
<p class="animal-heading-info2"><b>Czy może mieszkać z dziećmi?</b><br/>
{% for kidAcceptance in animal.kidAcceptances %}
{{ kidAcceptance.name }}<br/>
{% endfor %}
</p>
</div>
{% endif %}
{% if animal.notAcceptings is iterable %}
<div class="col-12">
<p class="animal-heading-info2"><b>Czy może mieszkać z innymi zwierzętami?</b>
{% if animal.notAcceptings is iterable %}
{% for key,notAccepting in animal.notAcceptings %}
<span class="d-block">{{ notAccepting }}</span>
{% endfor %}
{% else %}
<br>
{{ animal.notAcceptings }}
{% endif %}
</p>
</div>
{% endif %}
{% if animal.timeCareNeeded is iterable %}
<div class="col-12">
<p class="animal-heading-info2"><b>Czy może zostawać sam w domu?</b><br/>
{% for key,timeCare in animal.timeCareNeeded %}
<span class="d-block">{{ timeCare }}</span>
{% endfor %}
</p>
</div>
{% endif %}
{% if animal.city2 %}
<div class="col-12">
<p class="animal-heading-info2"><b>Miejsce tymczasowego pobytu:</b> {{ animal.city2 }}
</p>
</div>
{% endif %}
{% if animal.possibility %}
<div class="col-12">
<p class="animal-heading-info2"><b>Możliwość adopcji:</b> {{ animal.possibility.name }}</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid pt-0 pt-md-5">
<div class="container">
<div class="row d-flex justify-content-center pt-0">
<div class="col-12">
<p class="animal-sub-info">{{ animal.description|striptags }}</p>
</div>
<div class="col-12 mt-4 mb-5">
<div class="gallery gallery-not-adopted">
<div class="row">
<gallery :images="{{ gallery | json_encode }}"></gallery>
</div>
</div>
</div>
</div>
</div>
</div>
{% if(animalAdopted == 'not-adopted') %}
<div class="mb-md-5">
<animal-poll
is-logged="{{ isLogged }}"
animal-path="{{ path('animal_poll_step', {animal : animal.id}) }}"
animal-specie-type="{{ animal.species.name }}"
image="{{ mainImage }}"
></animal-poll>
</div>
{% endif %}
<div class="container-fluid pt-4 pb-5">
<div class="container">
<div class="row d-flex justify-content-center pt-0">
<div class="col-12 col-md-12 col-lg-12">
<div class="row">
<div class="col-12 col-md-4">
<div class="col-12">
<a href="{{ path('animals_all') }}" class="btn btn-primary btn-lg mb-2 mt-2 w-100">Poznaj wszystkie
nasze
Adopciaki</a>
</div>
<div class="col-12">
<a href="{{ path('app_adoption_process') }}" class="btn btn-primary btn-lg mb-2 mt-2 w-100">Sprawdź, jak adoptować</a>
</div>
</div>
<div class="col-12 col-md-4">
<div class="col-12">
<a href="{{ path('app_about_us') }}" class="btn btn-secondary btn-lg mb-2 mt-2 w-100">Zobacz, jak działamy</a>
</div>
<div class="col-12">
<a href="{{ path('app_support_us') }}" class="btn btn-secondary btn-lg mb-2 mt-2 w-100">Sprawdź, jak możesz pomóc</a>
</div>
</div>
<div class="col-12 col-md-4">
<div class="col-12">
<a href="{{ path('animals_all') }}" class="btn btn-secondary btn-lg mb-2 mt-2 w-100">Mogą do Ciebie pasować również</a>
</div>
<div class="col-12">
<div class="similar-animals">
<similar-animals :similar-animals="{{ prepSimilarAnimals | json_encode }}"></similar-animals>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% if notes %}
<div class="container-fluid pt-4 pb-5">
<div class="container">
<div class="row d-flex justify-content-center pt-0">
<div class="col-12 col-md-12 col-lg-12">
<div class="adopt-news">
<h3>Z dzienniczka <span>Adopciaka</span></h3>
<div class="block-wrapper">
{% for noteItem in notes %}
<div class="note-item">
<div class="row">
<div class="col-auto">
<p class="date">{{ noteItem.publishedDate|date("d.m.Y") }}</p>
</div>
<div class="col">
{% if(noteItem.title | length is not same as(0)) %}
<p class="title">{{ noteItem.title }}</p>
{% endif %}
<div class="text">{{ noteItem.content | replace({'<p></p>': ""}) | raw }}</div>
{% if(noteItem.pictures | length is not same as(0)) %}
<div class="image">
<img src="{{ asset(animalImage(noteItem.pictures[0].path)) | imagine_filter('animal_gallery_thumb') }}" alt="">
</div>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
</section>
{% endblock %}