Files
project-managment/templates/pages/projects/project_detail.html
T
sankalp 057031ed1b feat(templates/pages): add admin delete actions and UI refinements
- New Features
  - Add delete buttons with confirmation modals for users, expenses, invoices, and tickets
  - Introduce a priority column with styled badges in the ticket list
  - Refactor form fields to a shared partial for cleaner markup
- Enhancements
  - Rename “Creator” to “Assignee” and improve status/priority badge rendering
  - Fix empty‑state colspan and correct broken delete‑modal label closing tag
  - Initialize Quill editor on the ticket detail page
- Bug Fixes
  - Resolve typo in button class name and mismatched table header count
2026-05-28 00:26:59 +05:45

94 lines
6.9 KiB
HTML

{% extends "base_authenticated.html" %}
{% block title %}{{ project.name }}{% endblock %}
{% block content_inner %}
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden mb-6">
<div class="bg-blue-600 px-6 py-8">
<div class="flex items-start justify-between">
<div>
<h1 class="text-2xl font-bold text-white">{{ project.name }}</h1>
<div class="flex items-center gap-3 mt-2">
<span class="text-xs px-2.5 py-1 rounded-full font-medium bg-white/20 text-white">{{ project.get_status_display }}</span>
<span class="text-white/80 text-sm">Client: {{ project.client.username }}</span>
</div>
</div>
{% if user.is_admin %}
<div class="flex gap-2">
<a href="{% url 'project_edit' project.pk %}" class="btn btn-sm bg-white/20 text-white hover:bg-white/30 border-0">Edit</a>
<label for="delete-modal-project" class="btn btn-sm bg-red-500/20 text-white hover:bg-red-500/30 border-0 cursor-pointer">Delete</label>
</div>
{% endif %}
</div>
</div>
<div class="p-6">
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
<div class="p-4 bg-gray-50 rounded-xl">
<p class="text-xs text-gray-500 uppercase tracking-wider font-medium">Open Issues</p>
<p class="text-2xl font-bold text-gray-900 mt-1">{{ open_issues }}</p>
</div>
<div class="p-4 bg-gray-50 rounded-xl">
<p class="text-xs text-gray-500 uppercase tracking-wider font-medium">Members</p>
<p class="text-2xl font-bold text-gray-900 mt-1">{{ project.members.count }}</p>
</div>
<div class="p-4 bg-gray-50 rounded-xl">
<p class="text-xs text-gray-500 uppercase tracking-wider font-medium">Created</p>
<p class="text-2xl font-bold text-gray-900 mt-1">{{ project.created_at|date:"M Y" }}</p>
</div>
</div>
<div class="mb-6">
<h3 class="font-semibold text-gray-900 mb-3">Team Members</h3>
<div class="flex flex-wrap gap-2">
{% for member in project.members.all %}
<div class="flex items-center gap-2 px-3 py-1.5 bg-gray-50 rounded-full">
<div class="w-6 h-6 rounded-full bg-blue-600 flex items-center justify-center text-white text-xs font-bold">{{ member.username|first|upper }}</div>
<span class="text-sm text-gray-700">{{ member.username }}</span>
<span class="text-xs text-gray-400">({{ member.get_role_display }})</span>
</div>
{% endfor %}
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
<a href="{% url 'issue_list' %}?project={{ project.pk }}" class="p-4 bg-white rounded-xl border border-gray-200 hover:border-blue-300 hover:shadow-sm transition-all">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-amber-100 flex items-center justify-center"><svg class="w-5 h-5 text-amber-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v3m0 0v3m0-3h3m-3 0H9"/></svg></div>
<div><p class="font-semibold text-gray-900">Issues</p><p class="text-sm text-gray-500">{{ issues.count }} total</p></div>
</div>
</a>
<a href="{% url 'ticket_list' %}?project={{ project.pk }}" class="p-4 bg-white rounded-xl border border-gray-200 hover:border-blue-300 hover:shadow-sm transition-all">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-blue-100 flex items-center justify-center"><svg class="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"/></svg></div>
<div><p class="font-semibold text-gray-900">Tickets</p><p class="text-sm text-gray-500">{{ tickets.count }} recent</p></div>
</div>
</a>
<a href="{% url 'invoice_list' %}?project={{ project.pk }}" class="p-4 bg-white rounded-xl border border-gray-200 hover:border-blue-300 hover:shadow-sm transition-all">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-green-100 flex items-center justify-center"><svg class="w-5 h-5 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg></div>
<div><p class="font-semibold text-gray-900">Invoices</p><p class="text-sm text-gray-500">View finance</p></div>
</div>
</a>
<a href="{% url 'board_list' %}" class="p-4 bg-white rounded-xl border border-gray-200 hover:border-blue-300 hover:shadow-sm transition-all">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-lg bg-sky-100 flex items-center justify-center"><svg class="w-5 h-5 text-sky-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7"/></svg></div>
<div><p class="font-semibold text-gray-900">Kanban</p><p class="text-sm text-gray-500">View boards</p></div>
</div>
</a>
</div>
{% if tickets %}
<div class="mt-6">
<h3 class="font-semibold text-gray-900 mb-3">Recent Tickets</h3>
{% for ticket in tickets %}
<a href="{% url 'ticket_detail' ticket.pk %}" class="flex items-center justify-between p-3 rounded-xl hover:bg-gray-50 transition-colors">
<span class="text-sm font-medium text-gray-900">{{ ticket.title }}</span>
<span class="text-xs px-2 py-1 rounded-full font-medium {% if ticket.ticket_type == 'bug' %}bg-red-100 text-red-700{% elif ticket.ticket_type == 'feature_request' %}bg-blue-100 text-blue-700{% else %}bg-sky-100 text-sky-700{% endif %}">{{ ticket.get_ticket_type_display }}</span>
</a>
{% endfor %}
</div>
{% endif %}
</div>
</div>
{% url 'project_delete' project.pk as delete_url %}
{% include "components/delete_modal.html" with modal_id="delete-modal-project" delete_url=delete_url %}
{% endblock %}