Add migration and books

This commit is contained in:
gabatxo1312
2026-01-28 00:38:24 +01:00
parent 30be91390b
commit 4cd32831c1
19 changed files with 805 additions and 231 deletions
+7
View File
@@ -0,0 +1,7 @@
{% macro card() %}
<div class="card my-3">
<div class="card-body">
{{ caller() }}
</div>
</div>
{% endmacro %}
+21 -2
View File
@@ -5,8 +5,27 @@
</button>
<ul class="dropdown-menu">
{% for item in items %}
<li><a class="dropdown-item" href="{{ item.1 }}">{{ item.0 }}</a></li>
<li><a class="dropdown-item" href="{{ item.1 }}">{{ item.0 }}</a></li>
{% endfor %}
</ul>
</div>
{% endmacro %}
{% endmacro %}
{% macro book_dropdown_button(book, show = true) %}
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Actions
</button>
<ul class="dropdown-menu">
{% if show %}
<li><a class="dropdown-item" href="/books/{{ book.id }}">Voir</a></li>
{% endif %}
<li><a class="dropdown-item" href="/books/{{ book.id }}/edit">Edit</a></li>
<li>
<form method="post" action="/books/{{ book.id }}/delete">
<input class="dropdown-item" type="submit" value="Delete">
</form>
</li>
</ul>
</div>
{% endmacro %}
+12 -12
View File
@@ -1,14 +1,14 @@
{% macro field(name, value) %}
<div class="row mt-4">
<div class="col-md-3">
<p class="mb-0 fw-regular">
{{ name }}:
</p>
<div class="row mt-4">
<div class="col-md-3">
<p class="mb-0 fw-regular">
{{ name }}:
</p>
</div>
<div class="col-md-9">
<p class="mb-0">
{{ value }}
</p>
</div>
</div>
<div class="col-md-9">
<p class="mb-0">
{{ value }}
</p>
</div>
</div>
{% endmacro %}
{% endmacro %}
+25 -11
View File
@@ -1,13 +1,27 @@
{% macro heading(title) %}
<div class="d-flex justify-content-between align-items-center">
<h1 class="mb-4">
{{ title }}
</h1>
{% import "components/dropdown.html" as dropdown %}
{% if caller is defined %}
<div>
{{ caller() }}
{% macro heading(title) %}
<div class="d-flex justify-content-between align-items-center">
<h1 class="mb-4">
{{ title }}
</h1>
{% if caller is defined %}
<div>
{{ caller() }}
</div>
{% endif %}
</div>
{% endif %}
</div>
{% endmacro %}
{% endmacro %}
{% macro book_heading(title, book, show = false) %}
<div class="d-flex justify-content-between align-items-center">
<h1 class="mb-4">
{{ title }}
</h1>
<div>
{{ dropdown::book_dropdown_button(book, show) }}
</div>
</div>
{% endmacro %}