- 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
105 lines
5.7 KiB
HTML
105 lines
5.7 KiB
HTML
{% extends "base_authenticated.html" %}
|
|
{% load form_helpers %}
|
|
{% block title %}{{ card.title }}{% endblock %}
|
|
{% block content_inner %}
|
|
<div class="max-w-4xl mx-auto">
|
|
<div class="flex items-center gap-2 text-sm text-gray-500 mb-4">
|
|
<a href="{% url 'board_list' %}" class="hover:text-blue-600">Boards</a>
|
|
<span>/</span>
|
|
<a href="{% url 'board_detail' card.column.board.pk %}" class="hover:text-blue-600">{{ card.column.board.name }}</a>
|
|
<span>/</span>
|
|
<span class="text-gray-900">{{ card.title|truncatechars:30 }}</span>
|
|
</div>
|
|
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden mb-6">
|
|
<div class="p-6">
|
|
<div class="flex items-start justify-between mb-4">
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-gray-900">{{ card.title }}</h1>
|
|
<div class="flex items-center gap-2 mt-2">
|
|
{% if card.priority == 'urgent' %}
|
|
<span class="text-xs px-2.5 py-1 rounded-full font-semibold bg-red-100 text-red-700">Urgent</span>
|
|
{% elif card.priority == 'high' %}
|
|
<span class="text-xs px-2.5 py-1 rounded-full font-semibold bg-amber-100 text-amber-700">High</span>
|
|
{% elif card.priority == 'medium' %}
|
|
<span class="text-xs px-2.5 py-1 rounded-full font-semibold bg-blue-100 text-blue-700">Medium</span>
|
|
{% else %}
|
|
<span class="text-xs px-2.5 py-1 rounded-full font-semibold bg-gray-100 text-gray-600">Low</span>
|
|
{% endif %}
|
|
<span class="text-xs text-gray-400">{{ card.column.name }} · {{ card.column.board.name }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="flex gap-2">
|
|
<a href="{% url 'card_edit' card.pk %}" class="btn btn-sm bg-blue-50 text-blue-700 hover:bg-blue-100 border-0">Edit</a>
|
|
<label for="card-delete-modal" class="btn btn-sm bg-red-50 text-red-700 hover:bg-red-100 border-0">Delete</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-3 mb-6">
|
|
<div class="p-3 bg-gray-50 rounded-xl">
|
|
<p class="text-[10px] text-gray-500 uppercase font-semibold tracking-wider">Assignee</p>
|
|
<p class="text-sm font-medium text-gray-900 mt-0.5">{{ card.assignee.username|default:"Unassigned" }}</p>
|
|
</div>
|
|
<div class="p-3 bg-gray-50 rounded-xl">
|
|
<p class="text-[10px] text-gray-500 uppercase font-semibold tracking-wider">Start</p>
|
|
<p class="text-sm font-medium text-gray-900 mt-0.5">{{ card.start_date|date:"M d, Y"|default:"-" }}</p>
|
|
</div>
|
|
<div class="p-3 bg-gray-50 rounded-xl">
|
|
<p class="text-[10px] text-gray-500 uppercase font-semibold tracking-wider">End</p>
|
|
<p class="text-sm font-medium text-gray-900 mt-0.5">{{ card.end_date|date:"M d, Y"|default:"-" }}</p>
|
|
</div>
|
|
<div class="p-3 bg-gray-50 rounded-xl">
|
|
<p class="text-[10px] text-gray-500 uppercase font-semibold tracking-wider">Due</p>
|
|
<p class="text-sm font-medium text-gray-900 mt-0.5">{{ card.due_date|date:"M d, Y"|default:"-" }}</p>
|
|
</div>
|
|
</div>
|
|
|
|
{% if card.description %}
|
|
<div class="prose prose-sm max-w-none text-gray-700 mb-6">
|
|
{{ card.description|render_markdown }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden">
|
|
<div class="px-6 py-4 border-b border-gray-100 flex items-center justify-between">
|
|
<h2 class="font-semibold text-gray-900">Comments ({{ comments.count }})</h2>
|
|
</div>
|
|
<div class="p-6">
|
|
<div id="comment-list" class="space-y-4 mb-6">
|
|
{% for comment in comments %}
|
|
{% include "partials/kanban/comment.html" %}
|
|
{% empty %}
|
|
<p class="text-sm text-gray-400 text-center py-4">No comments yet.</p>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<form method="post" action="{% url 'card_comment' card.pk %}"
|
|
hx-target="#comment-list" hx-swap="beforeend"
|
|
class="border-t border-gray-100 pt-4">
|
|
{% csrf_token %}
|
|
<label class="text-sm font-medium text-gray-700 mb-2 block">Add a comment</label>
|
|
<textarea name="body" class="textarea textarea-bordered w-full min-h-[100px]" placeholder="Write your comment... (Markdown supported)"></textarea>
|
|
<button type="submit" class="btn btn-sm bg-blue-600 text-white hover:bg-blue-700 border-0 mt-2">Post Comment</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
{% include "components/delete_modal.html" with modal_id="card-delete-modal" title="Delete Card" message="Are you sure you want to delete this card? This action cannot be undone." delete_url="/cards/{{ card.pk }}/delete/" %}
|
|
{% block extra_scripts %}
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const commentField = document.querySelector('textarea[name="body"]');
|
|
if (commentField) {
|
|
new EasyMDE({
|
|
element: commentField,
|
|
spellChecker: false,
|
|
toolbar: ['bold', 'italic', 'quote', '|', 'code', 'link', '|', 'preview'],
|
|
});
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock %}
|