Jul 10 - Update codes to catch up with the single tenant project (Medium)
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}AI Chat Conversations{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<div>
|
||||
<h4 class="mb-0"><i class="bi bi-chat-dots me-2 text-primary"></i>AI Chat Conversations</h4>
|
||||
<small class="text-muted">{{ sessions.total }} conversation{{ 's' if sessions.total != 1 }}</small>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{{ url_for('support.admin_tickets') }}" class="btn btn-outline-secondary btn-sm me-1">
|
||||
<i class="bi bi-inbox me-1"></i>Tickets
|
||||
</a>
|
||||
<a href="{{ url_for('support.admin_knowledge') }}" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-book me-1"></i>Knowledge Base
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if sessions.items %}
|
||||
<div class="card shadow-sm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0 align-middle">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Customer</th>
|
||||
<th>Topic</th>
|
||||
<th>Messages</th>
|
||||
<th>Last Activity</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for s in sessions.items %}
|
||||
<tr>
|
||||
<td class="text-muted small">{{ s.id }}</td>
|
||||
<td>{{ s.customer.display_name if s.customer else '<em class="text-muted">deleted</em>' | safe }}</td>
|
||||
<td>{{ (s.title or '—')[:80] }}</td>
|
||||
<td class="text-muted small">{{ s.messages | length }}</td>
|
||||
<td class="text-muted small text-nowrap">{{ s.last_msg_at.strftime('%b %d, %Y %I:%M %p') }}</td>
|
||||
<td>
|
||||
<a href="{{ url_for('support.admin_conversation_detail', session_id=s.id) }}"
|
||||
class="btn btn-sm btn-outline-primary">
|
||||
<i class="bi bi-eye me-1"></i>View
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if sessions.pages > 1 %}
|
||||
<nav class="mt-3">
|
||||
<ul class="pagination justify-content-center mb-0">
|
||||
<li class="page-item {% if not sessions.has_prev %}disabled{% endif %}">
|
||||
<a class="page-link" href="{{ url_for('support.admin_conversations', page=sessions.prev_num) }}">« Prev</a>
|
||||
</li>
|
||||
{% for p in sessions.iter_pages(left_edge=1, right_edge=1, left_current=2, right_current=2) %}
|
||||
{% if p %}
|
||||
<li class="page-item {% if p == sessions.page %}active{% endif %}">
|
||||
<a class="page-link" href="{{ url_for('support.admin_conversations', page=p) }}">{{ p }}</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item disabled"><span class="page-link">…</span></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<li class="page-item {% if not sessions.has_next %}disabled{% endif %}">
|
||||
<a class="page-link" href="{{ url_for('support.admin_conversations', page=sessions.next_num) }}">Next »</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<div class="text-center text-muted py-5">
|
||||
<i class="bi bi-chat-dots fs-1 d-block mb-2"></i>
|
||||
No AI chat conversations yet.
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user