{% extends 'base.html.twig' %}
{% block title %}Livre{% endblock %}
{% block body %}
<div class="row">
<div class="main">
<div class="card" style="height: fit-content;">
<h1 class="card-title font-weight-bold">{{ livre.titre }}</h1>
<img alt="bichon" src="/uploads/{{ livre.photo }}" onerror="this.src='/img/book.avif'" style="width: 100%;max-height: 60vh; object-fit: contain;">
<h1 class="card-title font-weight-bold">{{ livre.titre }}</h1>
<div class="py-2">
{% trans %}Description{% endtrans %} : {{ livre.description }}
<br> {% trans %}Author{% endtrans %} :
<span class="new-secondary text-secondary small-text">
{{ livre.auteur }}
</span>
<br>{% trans %}Language{% endtrans %} : {{livre.language}}
</div>
<div class="par">{% trans %}by the library of{% endtrans %} <a href="{{ path('app_user_show', {'id': livre.user.id}) }}">{{ livre.user.nom }}</a></div>
{# <button type="button" class="btn btn-success"></button> #}
<a href="{{ path('create_demande',{'id': livre.id }) }}" class="btn btn-success reserve-book">{% trans %}Reserve this book{% endtrans %}</a>
</div>
</div>
<div class="side-bar card">
{# <span class="card-title price float-left" > {{ cour.prix }} Dhs / Séance</span> #}
<button type="button" class="btn btn-success">Reserve this book</button>
</div>
</div>
{# <h1>Livre</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ livre.id }}</td>
</tr>
<tr>
<th>Titre</th>
<td>{{ livre.titre }}</td>
</tr>
<tr>
<th>Description</th>
<td>{{ livre.description }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_livre_index') }}">back to list</a>
<a href="{{ path('app_livre_edit', {'id': livre.id}) }}">edit</a>
{{ include('livre/_delete_form.html.twig') }} #}
<script>
$(document).ready(function(){
$('.reserve-book').click(function(){
$(this).addClass('disabled').attr('disabled', 'disabled').text('Reservation in progress...');
});
});
</script>
{% endblock %}