devicehub-django/lot/templates/lots.html

70 lines
2.1 KiB
HTML

{% extends "base.html" %}
{% load i18n paginacion %}
{% load render_table from django_tables2 %}
{% block content %}
<a href="{% url 'lot:add' %}" type="button" class="btn btn-green-admin">
<i class="bi bi-plus"></i>
{% trans 'Add new lot' %}
</a>
<h3>{{ subtitle }}</h3>
<!-- Search and Filter Section -->
<div class="row mb-4">
<!-- Search Input -->
<div class="col-md-6">
<form method="get" class="d-flex">
<input
type="text"
name="q"
class="form-control me-2"
placeholder="{% trans 'Search lots...' %}"
value="{{ search_query }}">
<button type="submit" class="btn btn-outline-secondary">
<i class="bi bi-search"></i>
</button>
</form>
</div>
<div class="col-md-6 text-md-end">
<div class="dropdown">
<button class="btn btn-outline-secondary dropdown-toggle" type="button" id="filterDropdown" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-filter me-2"></i>
{% trans 'Filter' %}
</button>
<ul class="dropdown-menu" aria-labelledby="filterDropdown">
<li>
<a class="dropdown-item" href="?{% if search_query %}q={{ search_query }}&{% endif %}show_closed=false">
{% trans 'Open Lots' %}
{% if show_closed == 'false' %}<i class="bi bi-check"></i>{% endif %}
</a>
</li>
<li>
<a class="dropdown-item" href="?{% if search_query %}q={{ search_query }}&{% endif %}show_closed=true">
{% trans 'Closed Lots' %}
{% if show_closed == 'true' %}<i class="bi bi-check"></i>{% endif %}
</a>
</li>
<li>
<a class="dropdown-item" href="?{% if search_query %}q={{ search_query }}&{% endif %}show_closed=both">
{% trans 'All Lots' %}
{% if show_closed == 'both' %}<i class="bi bi-check"></i>{% endif %}
</a>
</li>
</ul>
</div>
</div>
{% render_table table %}
<div class="mt-5 d-flex align-items-center justify-content-center">
{% if table.page and table.paginator.num_pages > 1 %}
{% include "django_tables2/pagination.html" %}
{% endif %}
</div>{% endblock %}