80 lines
2.7 KiB
HTML
80 lines
2.7 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}Клиенты Intradesk — Support Admin{% endblock %}
|
||
{% block content %}
|
||
<h1>🏢 Клиенты Intradesk</h1>
|
||
|
||
{% if error %}
|
||
<div style="background:#fce8e6;color:#d93025;padding:10px 14px;border-radius:6px;margin-bottom:14px">
|
||
{{ error }}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<div class="card">
|
||
<div class="filter-bar">
|
||
<form method="get" action="/admin/intradesk/clients" style="display:flex;gap:8px;flex-wrap:wrap">
|
||
<input type="text" name="search" value="{{ search }}" placeholder="Поиск по названию…" style="width:280px">
|
||
<button type="submit" class="btn btn-primary">Найти</button>
|
||
{% if search %}
|
||
<a href="/admin/intradesk/clients" class="btn btn-secondary">Сбросить</a>
|
||
{% endif %}
|
||
</form>
|
||
<a href="/admin/sync" class="btn btn-secondary" style="margin-left:auto">🔄 Синхронизация</a>
|
||
</div>
|
||
|
||
{% if clients %}
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>ID</th>
|
||
<th>Название</th>
|
||
<th>Тип</th>
|
||
<th>Email</th>
|
||
<th>Адрес</th>
|
||
<th>Обновлён</th>
|
||
<th></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for c in clients %}
|
||
<tr>
|
||
<td style="color:#999;font-size:.8rem">{{ c.id }}</td>
|
||
<td><strong>{{ c.name }}</strong></td>
|
||
<td>
|
||
{% if c.client_type == 10 %}
|
||
<span class="badge badge-auth">Компания</span>
|
||
{% elif c.client_type == 20 %}
|
||
<span class="badge badge-pending">Физлицо</span>
|
||
{% else %}
|
||
<span class="badge badge-pending">—</span>
|
||
{% endif %}
|
||
</td>
|
||
<td style="font-size:.85rem">{{ c.email or '—' }}</td>
|
||
<td style="font-size:.8rem;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"
|
||
title="{{ c.address or '' }}">
|
||
{{ c.address or '—' }}
|
||
</td>
|
||
<td style="font-size:.8rem;color:#666;white-space:nowrap">
|
||
{{ (c.updated_at or '')[:10] or '—' }}
|
||
</td>
|
||
<td>
|
||
<a href="/admin/intradesk/clients/{{ c.id }}/tasks" class="btn btn-primary"
|
||
style="font-size:.8rem;padding:5px 10px">
|
||
📋 Заявки
|
||
</a>
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
<p style="color:#666;font-size:.8rem;margin-top:10px">
|
||
Всего: {{ clients | length }}
|
||
{% if search %}(по фильтру){% endif %}
|
||
</p>
|
||
{% else %}
|
||
<p style="color:#999">
|
||
{% if search %}Нет клиентов, соответствующих «{{ search }}».{% else %}
|
||
Нет данных. <a href="/admin/sync">Запустите синхронизацию</a>.{% endif %}
|
||
</p>
|
||
{% endif %}
|
||
</div>
|
||
{% endblock %}
|