{% extends('base.html.twig') %}
{% block title %}Bio Information for {{ type }}, {{ authcomp.Fullname|trim }}!{% endblock %}
{% block pageId %}authcomp_info{% endblock %}
{% block body %}
<div class="card">
<h2 class="card-header">
<span class="col-6">{{ type }} Bio Information</span>
<span class="col-6">
<label for="myInput"></label><input class="float-right" id="myInput" type="text" placeholder="Search..">
</span>
</h2>
<article class="card-body">
<div class="authcomp-info">
<h3 class="font-weight-bold text-center">{{ authcomp.Fullname|trim }}'s bio information</h3>
{% set bdate = authcomp.Birthdate|length > 0 ? authcomp.Birthdate : 'Date Unknown' %}
{% set ddate = authcomp.Deathdate|length > 0 ? authcomp.Deathdate : 'Date Unknown' %}
<h4 class="text-center font-italic">{{ bdate }} - {{ ddate }}</h4>
{% if is_granted('ROLE_ADMIN') %}
<hr/>
<h4 class="ml-3">
<a href="{{ path('app_admin_authcomp_edit', {'id': authcomp.id}) }}" target="_blank">Edit this {{ type|lower }}</a>
</h4>
<hr/>
{% endif %}
{% set notes = authcomp.Notes|length > 0 ? authcomp.Notes :
"<div class='text-center'>Sorry, we have no information for this " ~ type|lower ~ "</div>" %}
<div class="authcomp">{{ notes|raw|nl2br }}</div>
</div>
{% if(authHymns|length > 0) %}
<div class="hymns-authored">
<h4 class="card-header text-center font-weight-bold">Hymns Authored ({{ authHymns|length }})</h4>
{% for hymn in authHymns|sort((a, b) => a.title <=> b.title) %}
<a class="hymn-info-link" href="{{ path('hymnInfo', {'slug': hymn.slug} ) }}" target="_blank">
{{ hymn.title }}
<span class="float-right">{{ hymn.type.title }}</span>
</a>
{% endfor %}
</div>
{% endif %}
{% if(compHymns|length > 0) %}
<div class="hymns-composed">
<h4 class="card-header text-center font-weight-bold">Hymns Composed ({{ compHymns|length }})</h4>
{% for hymn in compHymns|sort((a, b) => a.title <=> b.title) %}
<a class="hymn-info-link" href="{{ path('hymnInfo', {'slug': hymn.slug} ) }}" target="_blank">
{{ hymn.title }}
<span class="float-right">{{ hymn.type.title }}</span>
</a>
{% endfor %}
</div>
{% endif %}
{% if(arrHymns|length > 0) %}
<div class="hymns-arranged">
<h4 class="card-header text-center font-weight-bold">Hymns Arranged ({{ arrHymns|length }})</h4>
{% for hymn in arrHymns|sort((a, b) => a.title <=> b.title) %}
<a class="hymn-info-link" href="{{ path('hymnInfo', {'slug': hymn.slug} ) }}" target="_blank">
{{ hymn.title }}
<span class="float-right">{{ hymn.type.title }}</span>
</a>
{% endfor %}
</div>
{% endif %}
</article>
</div>
{% endblock %}