05/22 Enhance codes and fix bugs 2
This commit is contained in:
@@ -52,28 +52,64 @@
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
{% if my_tickets %}
|
||||
<div class="table-responsive">
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Ticket #</th>
|
||||
<th>Title</th>
|
||||
<th>Status</th>
|
||||
<th>Progress</th>
|
||||
<th>Priority</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for t in my_tickets %}
|
||||
{% set is_done = t.status in ('resolved', 'closed') %}
|
||||
{% set is_overdue = t.due_date and not is_done and t.due_date < now %}
|
||||
{% set stage = 0 %}
|
||||
{% if t.status == 'in_progress' %}{% set stage = 1 %}{% endif %}
|
||||
{% if t.status == 'pending' %}{% set stage = 2 %}{% endif %}
|
||||
{% if is_done %}{% set stage = 3 %}{% endif %}
|
||||
<tr style="cursor:pointer;" onclick="window.location='/tickets/{{ t.id }}'">
|
||||
<td><span class="mono" style="font-size:12px;color:var(--accent3);">{{ t.ticket_number }}</span></td>
|
||||
<td>{{ t.title[:45] }}{% if t.title|length > 45 %}…{% endif %}</td>
|
||||
<td><span class="badge badge-{{ t.status }}">{{ t.status.replace('_',' ').upper() }}</span></td>
|
||||
<td style="white-space:nowrap;">
|
||||
<span class="mono" style="font-size:12px;color:var(--accent3);">{{ t.ticket_number }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-size:13px;">
|
||||
{{ t.title[:40] }}{% if t.title|length > 40 %}…{% endif %}
|
||||
</div>
|
||||
<div style="margin-top:3px;display:flex;gap:4px;flex-wrap:wrap;">
|
||||
{% if is_overdue %}
|
||||
<span style="font-size:10px;padding:1px 6px;border-radius:4px;background:rgba(220,38,38,.12);color:var(--danger);font-weight:600;">
|
||||
<i class="bi bi-exclamation-triangle-fill" style="font-size:9px;"></i> Overdue
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if t.priority == 'critical' %}
|
||||
<span style="font-size:10px;padding:1px 6px;border-radius:4px;background:rgba(220,38,38,.12);color:var(--danger);font-weight:600;">Critical</span>
|
||||
{% elif t.priority == 'high' %}
|
||||
<span style="font-size:10px;padding:1px 6px;border-radius:4px;background:rgba(217,119,6,.12);color:var(--warning);font-weight:600;">High</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td style="min-width:110px;">
|
||||
<div style="font-size:10px;color:var(--muted);margin-bottom:4px;">
|
||||
{{ t.status.replace('_',' ').title() }}
|
||||
</div>
|
||||
<div style="display:flex;gap:2px;">
|
||||
{% for i in range(4) %}
|
||||
<div style="height:4px;flex:1;border-radius:2px;
|
||||
background:{% if i <= stage %}{% if is_overdue %}var(--danger){% elif is_done %}var(--success){% else %}var(--accent){% endif %}{% else %}var(--border2){% endif %};"></div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</td>
|
||||
<td><span class="badge badge-{{ t.priority }}">{{ t.priority.upper() }}</span></td>
|
||||
<td style="font-size:12px;color:var(--muted);">{{ t.created_at | localtime("%b %d") }}</td>
|
||||
<td style="font-size:12px;color:var(--muted);white-space:nowrap;">{{ t.created_at | localtime("%b %d") }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="p-5 text-center" style="color:var(--muted);">
|
||||
<i class="bi bi-inbox" style="font-size:36px;display:block;margin-bottom:12px;"></i>
|
||||
|
||||
Reference in New Issue
Block a user