Files
InviteMe/app/templates/admin/guests.html
T

85 lines
4.0 KiB
HTML

{% extends "base.html" %}
{% block title %}Гости — InviteMe{% endblock %}
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h1>Гости: {{ event.name }}</h1>
<a href="{{ url_for('main.admin_guest_add') }}" class="btn btn-primary">Добавить гостя</a>
</div>
<form method="GET" class="row g-3 mb-4">
<div class="col-auto">
<input type="text" name="q" class="form-control" placeholder="Поиск по ФИО, отделу, email..." value="{{ search }}">
</div>
<div class="col-auto">
<button type="submit" class="btn btn-outline-primary">Найти</button>
</div>
</form>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>ФИО</th>
<th>Отдел</th>
<th>Должность</th>
<th>Email</th>
<th>Телефон</th>
<th>Фото</th>
<th>QR</th>
<th>Статус</th>
<th>Действия</th>
</tr>
</thead>
<tbody>
{% for guest in guests %}
<tr class="{{ 'table-secondary' if not guest.is_active }}">
<td>{{ guest.build_full_name() }}</td>
<td>{{ guest.department }}</td>
<td>{{ guest.position or '-' }}</td>
<td>{{ guest.email }}</td>
<td>{{ guest.phone or '-' }}</td>
<td>
{% if guest.has_photo_file %}
<a href="{{ guest.photo_url }}" target="_blank" class="badge bg-success text-decoration-none">Есть</a>
{% else %}
<span class="badge bg-warning text-dark" title="{% if guest.photo_filename %}Имя файла указано, но файл не загружен{% else %}Не указано{% endif %}">Нет</span>
{% endif %}
</td>
<td>
{% if guest.qr_filename %}
<a href="{{ url_for('main.admin_guest_qr', guest_id=guest.id) }}" target="_blank" class="badge bg-success text-decoration-none">Да</a>
{% else %}
<a href="{{ url_for('main.admin_guest_qr', guest_id=guest.id) }}" target="_blank" class="badge bg-secondary text-decoration-none">Нет</a>
{% endif %}
</td>
<td>
{% if guest.is_checked_in %}
<span class="badge bg-success">Пришёл</span>
{% else %}
<span class="badge bg-secondary">Не пришёл</span>
{% endif %}
</td>
<td>
<a href="{{ url_for('main.admin_guest_edit', guest_id=guest.id) }}" class="btn btn-sm btn-outline-primary">Изменить</a>
<a href="{{ url_for('main.admin_guest_ticket', guest_id=guest.id) }}" target="_blank" class="btn btn-sm btn-outline-info">Билет</a>
<a href="{{ url_for('main.admin_guest_qr', guest_id=guest.id) }}" target="_blank" class="btn btn-sm btn-outline-success">QR</a>
<form action="{{ url_for('main.admin_guest_resend', guest_id=guest.id) }}" method="POST" class="d-inline" onsubmit="return confirm('Отправить приглашение повторно?')">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-sm btn-outline-warning">Пригласить</button>
</form>
<form action="{{ url_for('main.admin_guest_delete', guest_id=guest.id) }}" method="POST" class="d-inline" onsubmit="return confirm('Заблокировать гостя?')">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-sm btn-outline-danger">Блок</button>
</form>
</td>
</tr>
{% else %}
<tr>
<td colspan="9" class="text-center text-muted">Гости не найдены</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}