bookforge/templates/users/index.html

62 lines
2.3 KiB
HTML
Raw Normal View History

2026-01-23 13:56:30 +01:00
{% extends "base.html" %}
{% import "components/typography.html" as typography %}
2026-01-29 23:52:55 +01:00
{% import "components/dropdown.html" as dropdown %}
2026-01-28 00:38:24 +01:00
{% import "components/cards.html" as cards %}
2026-01-29 23:52:55 +01:00
{% import "components/inputs.html" as form_helpers %}
2026-01-23 13:56:30 +01:00
{% block main %}
2026-01-30 18:23:54 +01:00
{% call typography::heading(t!("user.index.title")) %}
<a class="btn-success btn" href="/users/new">{{ t!("user.index.button") }}</a>
2026-01-29 23:52:55 +01:00
{% endcall %}
2026-01-23 13:56:30 +01:00
2026-01-30 14:24:00 +01:00
{% call cards::card() %}
<form method="get">
<div class="row">
<div class="col-md-3">
2026-01-30 18:23:54 +01:00
<label for="name" class="form-label">{{ t!("user.attributes.name") }}</label>
2026-01-30 14:24:00 +01:00
{% match query.name %}
{% when Some with (value) %}
<input type="text" name="name" value="{{ value }}" class="form-control" placeholder="Ex: Koprotkine">
{% when None %}
<input type="text" name="name" class="form-control" placeholder="Ex: Koprotkine">
{% endmatch %}
</div>
<div class="col-md-1 d-flex align-items-end">
2026-01-30 18:23:54 +01:00
<input type="submit" value='{{ t!("common.search") }}' class="btn btn-info w-100">
2026-01-30 14:24:00 +01:00
</div>
<div class="col-md-1 d-flex align-items-end">
2026-01-30 18:23:54 +01:00
<a href="/users" class="btn btn-light">{{ t!("common.reset") }}</a>
2026-01-30 14:24:00 +01:00
</div>
</div>
</form>
{% endcall %}
2026-01-28 00:38:24 +01:00
{% call cards::card() %}
<table class="table table-hover">
<thead>
<tr>
<th scope="col">#</th>
2026-01-30 18:23:54 +01:00
<th scope="col">{{ t!("user.attributes.name") }}</th>
<th scope="col">{{ t!("user.attributes.owner_books") }}</th>
<th scope="col">{{ t!("user.attributes.borrowed_books") }}</th>
<th scope="col">{{ t!("common.actions") }}</th>
2026-01-28 00:38:24 +01:00
</tr>
</thead>
<tbody>
2026-01-29 23:52:55 +01:00
{% for user_information in user_with_books_number %}
2026-01-29 23:59:44 +01:00
<tr class="align-middle">
2026-01-29 23:52:55 +01:00
<th scope="row">{{ user_information.user.id }}</th>
<td>{{ user_information.user.name }}</td>
<td>{{ user_information.owner_book_number }}</td>
<td>{{ user_information.borrowed_book_number }}</td>
2026-01-28 00:38:24 +01:00
<td>
2026-01-30 18:23:54 +01:00
{{ dropdown::crud_dropdown_button(user_information.user, t!("common.actions"), "users", show = false) }}
2026-01-28 00:38:24 +01:00
</td>
</tr>
{% endfor %}
</tbody>
2026-01-29 23:52:55 +01:00
</table>
2026-01-28 00:38:24 +01:00
{% endcall %}
{% endblock %}