1. добавил в админку сортировку игроков и Фото (если галочка стоит, то путь к фото генерируется автоматически)
2. фото обновляются прям в json
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
}
|
||||
|
||||
.page {
|
||||
max-width: 1400px;
|
||||
max-width: 1500px;
|
||||
margin: 0 auto;
|
||||
padding: 24px;
|
||||
}
|
||||
@@ -62,7 +62,7 @@
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
min-width: 280px;
|
||||
min-width: 320px;
|
||||
min-height: 42px;
|
||||
padding: 0 12px;
|
||||
border-radius: 10px;
|
||||
@@ -94,11 +94,16 @@
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.table-wrap {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
background: var(--panel-2);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -107,6 +112,7 @@
|
||||
border-bottom: 1px solid var(--border);
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
th {
|
||||
@@ -118,10 +124,47 @@
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.sort-link {
|
||||
color: var(--muted);
|
||||
text-decoration: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.sort-link:hover {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.sort-indicator {
|
||||
color: var(--accent);
|
||||
min-width: 12px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.id-col {
|
||||
width: 70px;
|
||||
}
|
||||
|
||||
.photo-col {
|
||||
width: 80px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.photo-check {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
accent-color: var(--accent);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.photo-toggle-form {
|
||||
margin: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.action-col {
|
||||
width: 140px;
|
||||
text-align: right;
|
||||
@@ -143,45 +186,68 @@
|
||||
<div class="title">Игроки</div>
|
||||
|
||||
<form method="get" action="/admin/db/players" class="search-form">
|
||||
<input type="text" name="q" value="{{ q }}" placeholder="Поиск по ФИО или external_id">
|
||||
<input type="hidden" name="sort" value="{{ sort }}">
|
||||
<input type="hidden" name="direction" value="{{ direction }}">
|
||||
<input type="text" name="q" value="{{ q }}" placeholder="Поиск по ФИО, external_id или команде">
|
||||
<button type="submit" class="btn btn-primary">Найти</button>
|
||||
<a href="/admin/db" class="btn btn-secondary">Назад</a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% if players %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="id-col">ID</th>
|
||||
<th>ФИО</th>
|
||||
<th>Имя</th>
|
||||
<th>Фамилия</th>
|
||||
<th>External ID</th>
|
||||
<th>Амплуа</th>
|
||||
<th class="action-col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for p in players %}
|
||||
<tr>
|
||||
<td>{{ p.id }}</td>
|
||||
<td>{{ p.full_name }}</td>
|
||||
<td>{{ p.first_name }}</td>
|
||||
<td>{{ p.last_name }}</td>
|
||||
<td>{{ p.external_id }}</td>
|
||||
<td>{{ p.position }}</td>
|
||||
<td class="action-col">
|
||||
<a href="/admin/db/players/{{ p.id }}/edit" class="btn btn-secondary">Редактировать</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="table-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="id-col"><a class="sort-link" href="{{ sort_links.id.url }}">ID <span class="sort-indicator">{{ sort_links.id.indicator }}</span></a></th>
|
||||
<th><a class="sort-link" href="{{ sort_links.full_name.url }}">ФИО <span class="sort-indicator">{{ sort_links.full_name.indicator }}</span></a></th>
|
||||
<th><a class="sort-link" href="{{ sort_links.first_name.url }}">Имя <span class="sort-indicator">{{ sort_links.first_name.indicator }}</span></a></th>
|
||||
<th><a class="sort-link" href="{{ sort_links.last_name.url }}">Фамилия <span class="sort-indicator">{{ sort_links.last_name.indicator }}</span></a></th>
|
||||
<th><a class="sort-link" href="{{ sort_links.external_id.url }}">External ID <span class="sort-indicator">{{ sort_links.external_id.indicator }}</span></a></th>
|
||||
<th><a class="sort-link" href="{{ sort_links.position.url }}">Амплуа <span class="sort-indicator">{{ sort_links.position.indicator }}</span></a></th>
|
||||
<th><a class="sort-link" href="{{ sort_links.team_name.url }}">Название команды <span class="sort-indicator">{{ sort_links.team_name.indicator }}</span></a></th>
|
||||
<th class="photo-col"><a class="sort-link" href="{{ sort_links.photo.url }}">Фото <span class="sort-indicator">{{ sort_links.photo.indicator }}</span></a></th>
|
||||
<th class="action-col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for p in players %}
|
||||
<tr>
|
||||
<td>{{ p.id }}</td>
|
||||
<td>{{ p.full_name }}</td>
|
||||
<td>{{ p.first_name }}</td>
|
||||
<td>{{ p.last_name }}</td>
|
||||
<td>{{ p.external_id }}</td>
|
||||
<td>{{ p.position }}</td>
|
||||
<td>{{ p.team_name }}</td>
|
||||
<td class="photo-col">
|
||||
<form method="post" action="/admin/db/players/{{ p.id }}/photo-enabled" class="photo-toggle-form">
|
||||
<input type="hidden" name="q" value="{{ q }}">
|
||||
<input type="hidden" name="sort" value="{{ sort }}">
|
||||
<input type="hidden" name="direction" value="{{ direction }}">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="photo_enabled"
|
||||
value="true"
|
||||
class="photo-check"
|
||||
title="Использовать фото игрока в JSON/vMix"
|
||||
onchange="this.form.submit()"
|
||||
{% if p.photo_enabled %}checked{% endif %}
|
||||
>
|
||||
</form>
|
||||
</td>
|
||||
<td class="action-col">
|
||||
<a href="/admin/db/players/{{ p.id }}/edit" class="btn btn-secondary">Редактировать</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-box">Игроки не найдены.</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user