sport_inventary/app/templates/partners.html

46 lines
1.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% block content %}
<h1>Партнёры</h1>
<!-- Форма поиска (по ТЗ) -->
<form method="get" action="{{ url_for('main.partners') }}" style="margin-bottom: 1rem; display: flex; gap: 0.5rem;">
<input type="text" name="search" placeholder="Поиск по наименованию или телефону" value="{{ request.args.get('search', '') }}" style="flex: 1; padding: 0.5rem;">
<button type="submit" class="btn">Найти</button>
{% if request.args.get('search') %}
<a href="{{ url_for('main.partners') }}" class="btn btn-secondary">Сбросить</a>
{% endif %}
</form>
<a href="{{ url_for('main.partner_new') }}" class="btn">➕ Добавить партнёра</a>
<table>
<thead>
<tr>
<th>ID</th>
<th>Наименование</th>
<th>Телефон</th>
<th>Email</th>
<th>Адрес</th>
<th>Действия</th>
</tr>
</thead>
<tbody>
{% for p in partners %}
<tr>
<td>{{ p.id }}</td>
<td><a href="{{ url_for('main.partner_detail', id=p.id) }}">{{ p.name }}</a></td>
<td>{{ p.phone }}</td>
<td>{{ p.email }}</td>
<td>{{ p.address }}</td>
<td>
<a href="{{ url_for('main.partner_edit', id=p.id) }}" class="btn btn-secondary">✏️</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="6">Партнёры не найдены</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}