- Embeddable vanilla-JS chat widget (one script tag + tenant public key):
WebSocket, resumable sessions (24h localStorage token), honeypot + per-IP
and per-message rate limits, Bosnian UI (§7)
- Session auth (bcrypt + signed cookies), owner accounts + super-admins,
admin impersonation ('otvori kao salon', §11)
- Owner dashboard (§10, Bosnian): requests with same actions as email,
call/chat history with transcripts, usage bar; settings for profile,
working hours (manual + LLM paste-to-parse), services CRUD + 'Zalijepi
cjenovnik' LLM import with review step, scheduling (Google OAuth free/busy
read-only + calendar mappings + buffers, partner status), telephony
(forwarding MMI codes per operator, ring group, worker SIP creds + QR),
agent voice/price-mode/notes + widget snippet, notifications/SMS templates
- Super-admin panel (§11): tenant CRUD incl. plan/minutes/paid-until,
partner API config (encrypted secrets), number/SIM registry + assignment,
connectivity test (live availability + dry-run push), versioned prompt
template editor with publish/rollback, playground, usage overview, health
- Fixes: WAL + busy_timeout for sqlite tests, no awaits in WS disconnect
path (deadlock), template publish autoflush bug
- 76 tests green (incl. widget WS e2e booking flow); dashboard, widget and
admin verified live in a browser against Postgres
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
60 lines
2.8 KiB
HTML
60 lines
2.8 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Zahtjev — {{ req.client_name }}{% endblock %}
|
|
{% block nav %}{% include "dashboard/_nav.html" %}{% endblock %}
|
|
{% block content %}
|
|
<p><a href="/dash">← Svi zahtjevi</a></p>
|
|
<h1>Zahtjev — {{ req.client_name }}
|
|
<span class="badge {{ req.status }}">{{ status_labels[req.status] }}</span></h1>
|
|
|
|
<div class="grid2">
|
|
<div class="card">
|
|
<h2>Podaci</h2>
|
|
<table>
|
|
<tr><td class="muted">Klijent</td><td><b>{{ req.client_name }}</b></td></tr>
|
|
<tr><td class="muted">Telefon</td><td>{{ req.client_phone }}</td></tr>
|
|
<tr><td class="muted">Usluga</td><td>{{ service_name }}</td></tr>
|
|
<tr><td class="muted">Izvor</td><td>{{ 'telefonski poziv' if req.source=='voice' else 'web chat' }}</td></tr>
|
|
{% if req.home_visit %}<tr><td class="muted">Kućna posjeta</td><td>DA — {{ req.address or 'adresa nije navedena' }}</td></tr>{% endif %}
|
|
{% if req.time_preference_text %}<tr><td class="muted">Željeno vrijeme</td><td>{{ req.time_preference_text }}</td></tr>{% endif %}
|
|
<tr><td class="muted">Zaprimljen</td><td>{{ req.created_at.strftime('%d.%m.%Y. %H:%M') }}</td></tr>
|
|
{% if req.resolved_at %}<tr><td class="muted">Zatvoren</td><td>{{ req.resolved_at.strftime('%d.%m.%Y. %H:%M') }}</td></tr>{% endif %}
|
|
</table>
|
|
{% if req.summary %}<p><b>Sažetak:</b> {{ req.summary }}</p>{% endif %}
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h2>Akcije</h2>
|
|
{% if req.status == 'pending' %}
|
|
<form method="post" action="/dash/requests/{{ req.id }}/resolve">
|
|
<button class="green" style="width:100%">✓ Riješeno — kontaktirao/la sam klijenta</button>
|
|
</form>
|
|
<p class="muted">Klijentu se ne šalje SMS — dogovorili ste se direktno.</p>
|
|
{% for s in slots %}
|
|
<form method="post" action="/dash/requests/{{ req.id }}/confirm/{{ loop.index0 }}" style="margin-top:8px">
|
|
<button style="width:100%">Potvrdi {{ s }} + pošalji SMS</button>
|
|
</form>
|
|
{% endfor %}
|
|
<form method="post" action="/dash/requests/{{ req.id }}/reject" style="margin-top:8px">
|
|
<textarea name="sms_body" title="SMS koji će klijent dobiti">{{ rejection_sms }}</textarea>
|
|
<button class="red" style="width:100%;margin-top:8px">Odbij zahtjev i pošalji SMS</button>
|
|
</form>
|
|
{% else %}
|
|
<p class="muted">Zahtjev je zatvoren.
|
|
{% if req.confirmed_slot %}Potvrđen termin: {{ confirmed_label }}.{% endif %}</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
{% if transcript %}
|
|
<div class="card">
|
|
<h2>Razgovor</h2>
|
|
<div class="transcript">
|
|
{% for t in transcript %}
|
|
<div class="t {{ t.role }}">{{ t.text }}</div>
|
|
{% if t.tool_calls %}<div class="tools">⚙ {% for tc in t.tool_calls %}{{ tc.name }} {% endfor %}</div>{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|