{% extends 'content_base.html.twig' %}
{% block title %}Read: {{ person.name }}{% endblock %}
{% block content_body %}
<h1>
<a href="{{ path('persons_list') }}">
<i class="pr-3 fa fa-backward"></i>
</a>
</h1>
<div id="show-person" class="container">
{% if is_granted('ROLE_EDIT_ENTITY') %}
<div class="row">
<div class="col-12">
<a href="{{ path('person_edit', {id: person.id}) }}" class="btn btn-primary pull-right">
Edit <span class="fa fa-pencil-square"></span>
</a>
</div>
</div>
{% endif %}
<div class="row mt-2">
<div class="col-sm-12">
<div class="show-article-container p-3">
<div class="row">
<div class="col-12 col-sm-4 pb-2">
<img class="show-article-img" src="{{ person.image | imagine_filter('squared_thumbnail_tiny')}}">
</div>
<div class="col-12 col-sm-8 show-article-title-container d-inline-block align-middle">
<span class="show-article-title ">{{ person.name }}
{% if person.alternateNames is defined and person.alternateNames is not null%}
 ({{ person.alternateNames }})
{% endif %}
{% if person.hasVersions %}
<i></i>
{% endif %}
</span>
<div class="article-text pb-2"> {{ not person.born ? person.born(true, true) ~'(?)': person.born(true) }} to {{ not person.died ? person.died(true, true) ~ '(?)' : person.died(true)}}</div>
{% if person.father.id is defined %}
<div class="align-left article-details pb-2">
<a href="{{ path('person_show', {id: person.father.id}) }}">
<img class="article-author-img rounded-circle" src="{{ person.father.image| imagine_filter('squared_thumbnail_tiny') }}">
{{person.father.name}}
</a>
</div>
{% endif %}
{% if person.mother.id is defined %}
<div class="align-left article-details pb-2">
<a href="{{ path('person_show', {id: person.mother.id}) }}">
<img class="article-author-img rounded-circle pr-2" src="{{ person.mother.image| imagine_filter('squared_thumbnail_tiny') }}">
{{ person.mother.name}}
</a>
</div>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-sm-12 table-responsive">
<h3><i class="pr-3 fa fa-comment"></i>{{ person.children|length }} Children</h3>
<table class="table table-striped">
<thead>
<tr>
<th scope="col" class="col-2 mx-2"></th>
<th scope="col" class="col-10 mx-2">Name</th>
</tr>
</thead>
<tbody>
{% for child in person.children %}
<tr>
<td>
<a href="{{ path('person_show', {id: child.id}) }}">
<img class="comment-img rounded-circle" src="{{ asset( child.image | imagine_filter('squared_thumbnail_tiny') ) }}">
</a>
</td>
<td>
<a href="{{ path('person_show', {id: child.id}) }}">
<div class="comment-container d-inline-block align-top">
<span class="comment"> {{ child.name }} {{ child.alternateNames }}</span>
<!--p><a href="#">Reply</a></p-->
</div>
</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="2">
Keine Kinder
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div id="references" class="row mr-1">
<hr>
<div id="references-person" class="col-sm-12">
{{ include('person/_references.twig', {
}) }}
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script src="{{ asset('js/article_show.js') }}"></script>
{% endblock %}