Files
project-managment/templates/pages/tickets/ticket_list.html
T
sankalp 0537ea5e5e feat(templates): enrichUI with Tailwind styling and messaging component improvements
- Add custom border, background, and spacing utilities to base template
- Enhance message notification styling and layout
- Update delete modal button appearance and behavior
- Refine comment card component with Tailwind classes and responsive behavior
- Adjust sidebar responsiveness for mobile view
2026-05-28 00:51:41 +05:45

73 lines
4.7 KiB
HTML

{% extends "base_authenticated.html" %}
{% block title %}Tickets{% endblock %}
{% block content_inner %}
<div class="flex items-center justify-between mb-6">
<div>
<h1 class="text-2xl font-bold text-primary">Tickets</h1>
<p class="text-tertiary mt-1">Client support and feature requests.</p>
</div>
<a href="{% url 'ticket_create' %}" class="px-3 py-1.5 rounded-lg text-sm font-medium bg-blue-600 text-white hover:bg-blue-700 transition-colors">
<svg class="w-4 h-4 mr-1 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
New Ticket
</a>
</div>
<div class="card-surface overflow-hidden">
<div class="overflow-x-auto">
<table class="w-full text-sm">
<thead>
<tr class="text-xs font-semibold text-muted uppercase tracking-wider bg-hover">
<th class="px-4 py-3 text-left">Title</th>
<th class="px-4 py-3 text-left">Type</th>
<th class="px-4 py-3 text-left">Status</th>
<th class="px-4 py-3 text-left">Priority</th>
<th class="px-4 py-3 text-left">Project</th>
<th class="px-4 py-3 text-left">Assignee</th>
<th class="px-4 py-3 text-left">Created</th>
{% if user.is_admin %}<th class="px-4 py-3 text-left">Actions</th>{% endif %}
</tr>
</thead>
<tbody>
{% for ticket in tickets %}
<tr class="hover:bg-hover transition-colors border-t border-subtle">
<td class="px-4 py-3"><a href="{% url 'ticket_detail' ticket.pk %}" class="font-medium text-primary hover:text-blue-600">{{ ticket.title }}</a></td>
<td class="px-4 py-3">
<span class="text-xs px-2 py-1 rounded-full font-medium border {% if ticket.ticket_type == 'bug' %}bg-red-50 text-red-700 border-red-200{% elif ticket.ticket_type == 'feature_request' %}bg-blue-50 text-blue-700 border-blue-200{% else %}bg-sky-50 text-sky-700 border-sky-200{% endif %}">
{{ ticket.get_ticket_type_display }}
</span>
</td>
<td class="px-4 py-3">
<span class="text-xs px-2 py-1 rounded-full font-medium border {% if ticket.status == 'new' %}bg-gray-50 text-gray-700 border-gray-200{% elif ticket.status == 'acknowledged' %}bg-blue-50 text-blue-700 border-blue-200{% elif ticket.status == 'in_progress' %}bg-amber-50 text-amber-700 border-amber-200{% elif ticket.status == 'done' %}bg-green-50 text-green-700 border-green-200{% else %}bg-red-50 text-red-700 border-red-200{% endif %}">
{{ ticket.get_status_display }}
</span>
</td>
<td class="px-4 py-3">
<span class="text-xs px-2 py-1 rounded-full font-medium border {% if ticket.priority == 'high' %}bg-red-50 text-red-700 border-red-200{% elif ticket.priority == 'medium' %}bg-amber-50 text-amber-700 border-amber-200{% else %}bg-blue-50 text-blue-700 border-blue-200{% endif %}">
{{ ticket.get_priority_display }}
</span>
</td>
<td class="px-4 py-3 text-secondary">{{ ticket.project.name|default:"-" }}</td>
<td class="px-4 py-3 text-secondary">{{ ticket.assignee.username|default:"-" }}</td>
<td class="px-4 py-3 text-tertiary">{{ ticket.created_at|date:"M d" }}</td>
{% if user.is_admin %}
<td class="px-4 py-3">
<label for="delete-ticket-{{ ticket.pk }}" class="px-3 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-700 hover:bg-red-100 border border-red-200 transition-colors cursor-pointer">Delete</label>
</td>
{% endif %}
</tr>
{% empty %}
<tr><td colspan="{% if user.is_admin %}8{% else %}7{% endif %}" class="text-center py-12 text-tertiary">No tickets found.</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% if user.is_admin %}
{% for ticket in tickets %}
{% with ticket_id=ticket.pk|stringformat:"s" %}
{% url 'ticket_delete' ticket.pk as delete_url %}
{% include "components/delete_modal.html" with modal_id="delete-ticket-"|add:ticket_id title="Delete Ticket" message="Are you sure you want to delete this ticket? This action cannot be undone." delete_url=delete_url %}
{% endwith %}
{% endfor %}
{% endif %}
{% endblock %}