{% block fossildb_item %}
<div style="background-color: #90B116; border-radius: 25px;">
<br>
<div class="row">
<div class="col-sm-12">
<div class="row" style="margin-left: 5px;">
<div class="col-sm-1">
{% if item.taxanomy %}
<a href="{{ path('glossary_by_title', {title: item.taxanomy.namescientific|lower}) }}"><img src="/images/icons/fossil/has_{{ item.taxanomy.namescientific|lower }}{{ item.taxanomy.namescientificclarification }}.png" class="img-responsive" style="max-width: 50px;"></a>
{% endif %}
</div>
<div class="col-sm-9">
<span style="color: #FCFCFC; font-weight: bold; font-size: 18px !important;">{% if item.genus is null or item.genus is empty %}{{ '[Ongedetermineerd]'|trans }}{% else %}<i>{{ item.genus }}</i>{% endif %}<i> {{ item.species }}</i>
{%if item.publication != ""%}
<div class="d-sm-block d-md-none"></div>
{{ item.publication }}
{% endif %}
</span>
</div>
<div class="col-sm-2 text-right">
{% if app.user is not null and item.userid == app.user.id %}
<a href="{{ path('fossildb_edit', {item: item.id}) }}" title="{{ 'Bewerken'|trans }}"><button class="btn btn-paleontica"><span class="feather-18" data-feather="edit"></span></button></a>
{% endif %}
{% if is_granted('ROLE_MOD_FOSSILDB') %}
<a href="{{ path('fossildb_moderate_edit', {item: item.id}) }}" title="{{ 'Bewerken'|trans }} ({{'als beheerder'|trans }})"><button class="btn btn-warning"><span class="feather-18" data-feather="edit"></span></button></a>
{% endif %}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
{% if item.era %}
<picture>
<source media="(min-width: 1200px)" srcset="/images/bar/era/{{ item.era.nameen|lower }}.png">
<source media="(min-width: 992px)" srcset="/images/bar/era/{{ item.era.nameen|lower }}.png">
<source media="(min-width: 768px)" srcset="/images/bar/era/{{ item.era.nameen|lower }}.png">
<source media="(min-width: 576px)" srcset="/images/bar/era/{{ item.era.nameen|lower }}_small.png">
<source media="(max-width: 575px)" srcset="/images/bar/era/{{ item.era.nameen|lower }}_small.png">
<img src="/images/default.png" alt="Era" style="width:auto;" >
</picture>
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<p>
{% for photo in item.FossildbPhotos %}
{% if photo.isprimary == '1' and photo.approved == '1' %}
{% set thumbnail = '/uploads/fossildb/' ~ photo.filename|slice(0, 2) ~ "/" ~ photo.filename %}
<a href="/uploads/fossildb/{{photo.filename|slice(0, 2)}}/{{photo.filename}}" data-toggle="lightbox" data-gallery="fossildb-gallery-{{ item.id }}"><img src="{{ thumbnail|imagine_filter('fossildb_thumb_small') }}" class="img-fluid img-thumbnail"></a><br>
{% endif %}
{% endfor %}
</p>
<p>
{% for photo in item.FossildbPhotos %}
{% if photo.isprimary == '0' and photo.approved == '1' %}
{% set thumbnail = '/uploads/fossildb/' ~ photo.filename|slice(0, 2) ~ "/" ~ photo.filename %}
<a href="/uploads/fossildb/{{photo.filename|slice(0, 2)}}/{{photo.filename}}" data-toggle="lightbox" data-gallery="fossildb-gallery-{{ item.id }}"><img src="{{ thumbnail|imagine_filter('fossildb_thumb_tiny') }}" class="img-fluid img-thumbnail"></a>
{% endif %}
{% endfor %}
{% if item.FossildbPhotos|length == 0 and item.literature is not null %}
<img src="/images/literature.png" class="img-fluid img-thumbnail">
{# ToDo-Ante: make adding photo by other user when no photo exists a thing <img src="/images/photo_add_mini.png" class="img-fluid img-thumbnail">#}
{% endif %}
</p>
</div>
<div class="col-sm-8">
<p>
<b>{{ 'PaleonticaID'|trans }}:</b> <a href="{{ path('fossildb_item', {id: item.id}) }}">#{{ item.id }}</a><br>
<b>{{ 'Door'|trans }}:</b> <a href="{{ path('user_profile_public', {username: item.username}) }}"> <a href="{{ path('user_profile_public', {username: item.username}) }}">{{ item.username }}</a></a><br>
{% if app.user.id is defined and app.user.id == item.userid %}<b>{{ 'Eigen referentie'|trans }}:</b> {{ item.usernumber }}<br>{% endif %}
<b>{{ 'Locatie'|trans }}:</b> <a href="{{ path('locations_fossil', {id : item.locationfossil.id}) }}">{% if app.request.locale == 'nl' %}{{ item.locationfossil.namenl }}, {{ item.locationfossil.country.namenl }}{% else %}{{ item.locationfossil.nameen }}, {{ item.locationfossil.country.nameen }}{% endif %}</a> <a href="{{ path('specieslist_item',{ 'type' : "location", 'id' : item.locationfossil.id }) }}"><button type="button" class="btn btn-sm btn-paleontica">{{ 'Soortenlijst'|trans }}</button></a> <br>
<b>{{ 'Datum'|trans }}:</b> {{ item.added|date("d-m-Y") }}
</p>
{% if item.taxanomytree %}
<b>{{ 'Taxonomie'|trans }}</b><br>
{% set i = 0 %}
{% for taxanomy_item in item.taxanomytree %}
{% set i = i + 1 %}
{% if item.taxanomytree|length >= 2 and i == 3 %}
<button type="button" class="btn btn-sm btn-paleontica" data-toggle="collapse" href="#collapseTaxanomy{{item.id}}" role="button" aria-expanded="false" aria-controls="collapseTaxanomy">{{ 'Toon volledige taxnomie'|trans }}</button>
<div class="collapse" id="collapseTaxanomy{{item.id}}">{% endif %}
{% if app.request.locale == 'nl' %}{{ taxanomy_item.taxanomyrank.namenl }}{% else %}{{ taxanomy_item.taxanomyrank.nameen }}{% endif %} (<a href="/glossary/{{ taxanomy_item.taxanomyrank.namescientific }}">{{ taxanomy_item.taxanomyrank.namescientific }}</a>):
{% if taxanomy_item.glossary %}<a href="/glossary/{{ taxanomy_item.glossary.id }}/{{ taxanomy_item.glossary.url }}">{% endif %}
{{ taxanomy_item.namescientific }} {{ taxanomy_item.namescientificclarification }}
{% if taxanomy_item.glossary %}</a>{% endif %}
{% if taxanomy_item.author %}({{ taxanomy_item.author }}{% if taxanomy_item.authoryear %}, {{ taxanomy_item.authoryear }}{% endif %}){% endif %}
<br>
{% if item.taxanomytree|length > 2 and i == item.taxanomytree|length %}</div>{% endif %}
{% endfor %}
{% endif %}
<br><br>
<p>
{% if item.era is not null or item.epoch is not null or item.stage is not null or item.formation is not null or item.member is not null %}
<b>{{ 'Stratigrafie'|trans }}</b><br>
{% if item.era is not null and item.era is not empty %}{{ 'Tijdperk'|trans }}: <a href="/glossary/{{ item.era.glossary.id }}/{{ item.era.glossary.url }}">{% if app.request.locale == 'nl' %}{{ item.era.namenl }}{% else %}{{ item.era.nameen }}{% endif %}</a> <a href="{{ path('specieslist_item',{ 'type' : "era", 'id' : item.era.id }) }}"><button type="button" class="btn btn-sm btn-paleontica">{{ 'Soortenlijst'|trans }}</button></a><br>{% endif %}
{% if item.epoch is not null and item.epoch is not empty %}{{ 'Epoch'|trans }}: {% if app.request.locale == 'nl' %}{{ item.epoch.namenl }}{% else %}{{ item.epoch.nameen }}{% endif %} <a href="{{ path('specieslist_item',{ 'type' : "epoch", 'id' : item.epoch.id }) }}"><button type="button" class="btn btn-sm btn-paleontica">{{ 'Soortenlijst'|trans }}</button></a><br>{% endif %}
{% if item.stage is not null and item.stage is not empty %}{{ 'Etage'|trans }}: {% if app.request.locale == 'nl' %}{{ item.stage.namenl }}{% else %}{{ item.stage.nameen }}{% endif %} <a href="{{ path('specieslist_item',{ 'type' : "stage", 'id' : item.stage.id }) }}"><button type="button" class="btn btn-sm btn-paleontica">{{ 'Soortenlijst'|trans }}</button></a><br>{% endif %}
{% if item.formation is not null and item.formation is not empty %}{{ 'Formatie'|trans }}: {% if app.request.locale == 'nl' %}{{ item.formation.namenl }}{% else %}{{ item.formation.nameen }}{% endif %} <a href="{{ path('specieslist_item',{ 'type' : "formation", 'id' : item.formation.id }) }}"><button type="button" class="btn btn-paleontica btn-sm">{{ 'Soortenlijst'|trans }}</button></a><br>{% endif %}
{% if item.member is not null and item.member is not empty %}{{ 'Member'|trans }}: {% if app.request.locale == 'nl' %}{{ item.member.namenl }}{% else %}{{ item.member.nameen }}{% endif %} <a href="{{ path('specieslist_item',{ 'type' : "member", 'id' : item.member.id }) }}"><button type="button" class="btn btn-paleontica btn-sm">{{ 'Soortenlijst'|trans }}</button></a><br>{% endif %}
</p>
{% endif %}
<p>{% if item.literature %}
<b>{{ 'Literatuur'|trans }} </b><br> {{ item.literature.author }} ({{ item.literature.year }}) - {{ item.literature.title }}
{% endif %}</p>
{% if item.commentnl or item.commenten %}
<b>{{ 'Opmerkingen'|trans }} </b><br>{% if app.request.locale == 'nl' %}{{ item.commentnl }}{% else %}{{ item.commenten }}{% endif %}
{% endif %}
</div>
</div>
{% endblock %}