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
This commit is contained in:
21 files changed
+454
-118
No files matched your search
@@ -40,8 +40,13 @@
|
||||
<div class="flex gap-3 pt-2">
|
||||
<a href="{% url 'user_edit' profile_user.pk %}" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">Edit User</a>
|
||||
<a href="{% url 'user_list' %}" class="btn btn-ghost">Back</a>
|
||||
{% if user.is_admin %}
|
||||
<label for="delete-modal-user" class="btn bg-red-600 text-white hover:bg-red-700 border-0 cursor-pointer">Delete</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% url 'user_delete' profile_user.pk as delete_url %}
|
||||
{% include "components/delete_modal.html" with modal_id="delete-modal-user" delete_url=delete_url %}
|
||||
{% endblock %}
|
||||
@@ -5,14 +5,10 @@
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
||||
<h1 class="text-xl font-bold text-gray-900 mb-1">Edit User</h1>
|
||||
<p class="text-sm text-gray-500 mb-6">{{ object.username }}</p>
|
||||
<form method="post" class="space-y-4">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-700">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.errors %}<p class="text-red-500 text-xs mt-1">{{ field.errors.0 }}</p>{% endif %}
|
||||
</div>
|
||||
{% include "partials/form_field.html" %}
|
||||
{% endfor %}
|
||||
<div class="flex gap-3 pt-2">
|
||||
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">Save Changes</button>
|
||||
|
||||
@@ -5,14 +5,10 @@
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
||||
<h1 class="text-xl font-bold text-gray-900 mb-1">New Expense</h1>
|
||||
<p class="text-sm text-gray-500 mb-6">Log a new project expense.</p>
|
||||
<form method="post" class="space-y-4">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-700">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.errors %}<p class="text-red-500 text-xs mt-1">{{ field.errors.0 }}</p>{% endif %}
|
||||
</div>
|
||||
{% include "partials/form_field.html" %}
|
||||
{% endfor %}
|
||||
<div class="flex gap-3 pt-2">
|
||||
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">Submit</button>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</span>
|
||||
{% if user.is_admin %}
|
||||
<a href="{% url 'invoice_edit' invoice.pk %}" class="btn btn-sm bg-blue-50 text-blue-700 hover:bg-blue-100 border-0">Edit</a>
|
||||
<a href="{% url 'invoice_delete' invoice.pk %}" class="btn btn-sm text-red-600 hover:bg-red-50 border-0">Delete</a>
|
||||
<label for="delete-modal-invoice" class="btn btn-sm text-red-600 hover:bg-red-50 border-0 cursor-pointer">Delete</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -51,4 +51,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% url 'invoice_delete' invoice.pk as delete_url %}
|
||||
{% include "components/delete_modal.html" with modal_id="delete-modal-invoice" delete_url=delete_url %}
|
||||
{% endblock %}
|
||||
@@ -5,14 +5,10 @@
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
||||
<h1 class="text-xl font-bold text-gray-900 mb-1">New Invoice</h1>
|
||||
<p class="text-sm text-gray-500 mb-6">Create a new invoice for a client.</p>
|
||||
<form method="post" class="space-y-4">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-700">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.errors %}<p class="text-red-500 text-xs mt-1">{{ field.errors.0 }}</p>{% endif %}
|
||||
</div>
|
||||
{% include "partials/form_field.html" %}
|
||||
{% endfor %}
|
||||
<div class="flex gap-3 pt-2">
|
||||
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">Create</button>
|
||||
|
||||
@@ -5,14 +5,10 @@
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
||||
<h1 class="text-xl font-bold text-gray-900 mb-1">Record Payment</h1>
|
||||
<p class="text-sm text-gray-500 mb-6">Record a payment against an invoice.</p>
|
||||
<form method="post" class="space-y-4">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-700">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.errors %}<p class="text-red-500 text-xs mt-1">{{ field.errors.0 }}</p>{% endif %}
|
||||
</div>
|
||||
{% include "partials/form_field.html" %}
|
||||
{% endfor %}
|
||||
<div class="flex gap-3 pt-2">
|
||||
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">Record</button>
|
||||
|
||||
@@ -5,14 +5,10 @@
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
||||
<h1 class="text-xl font-bold text-gray-900 mb-1">Record Team Payment</h1>
|
||||
<p class="text-sm text-gray-500 mb-6">Record a payroll payment for a team member.</p>
|
||||
<form method="post" class="space-y-4">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-700">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.errors %}<p class="text-red-500 text-xs mt-1">{{ field.errors.0 }}</p>{% endif %}
|
||||
</div>
|
||||
{% include "partials/form_field.html" %}
|
||||
{% endfor %}
|
||||
<div class="flex gap-3 pt-2">
|
||||
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">Save</button>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="flex gap-2">
|
||||
<a href="{% url 'issue_edit' issue.pk %}" class="btn btn-sm bg-blue-50 text-blue-700 hover:bg-blue-100 border-0">Edit</a>
|
||||
{% if user.is_admin %}
|
||||
<a href="{% url 'issue_delete' issue.pk %}" class="btn btn-sm text-red-600 hover:bg-red-50 border-0">Delete</a>
|
||||
<label for="delete-modal-issue" class="btn btn-sm text-red-600 hover:bg-red-50 border-0 cursor-pointer">Delete</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -34,7 +34,7 @@
|
||||
<div><p class="text-xs text-gray-500 uppercase font-medium">Assignee</p><p class="text-sm font-semibold text-gray-900 mt-0.5">{{ issue.assignee.username|default:"Unassigned" }}</p></div>
|
||||
</div>
|
||||
<div class="prose prose-sm max-w-none">
|
||||
<p class="text-gray-700 whitespace-pre-wrap">{{ issue.description }}</p>
|
||||
<div class="text-gray-700">{{ issue.description|safe }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -71,4 +71,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% url 'issue_delete' issue.pk as delete_url %}
|
||||
{% include "components/delete_modal.html" with modal_id="delete-modal-issue" delete_url=delete_url %}
|
||||
{% endblock %}
|
||||
@@ -5,14 +5,10 @@
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
||||
<h1 class="text-xl font-bold text-gray-900 mb-1">{% if object %}Edit{% else %}New{% endif %} Issue</h1>
|
||||
<p class="text-sm text-gray-500 mb-6">{% if object %}Update the issue details.{% else %}Create a new issue to track work.{% endif %}</p>
|
||||
<form method="post" class="space-y-4">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-700">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.errors %}<p class="text-red-500 text-xs mt-1">{{ field.errors.0 }}</p>{% endif %}
|
||||
</div>
|
||||
{% include "partials/form_field.html" %}
|
||||
{% endfor %}
|
||||
<div class="flex gap-3 pt-2">
|
||||
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">Save</button>
|
||||
@@ -22,3 +18,34 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block extra_scripts %}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const descField = document.querySelector('textarea[name="description"]');
|
||||
if (descField) {
|
||||
const container = document.createElement('div');
|
||||
container.style.height = '300px';
|
||||
container.className = 'mb-4 rounded-xl';
|
||||
descField.parentNode.insertBefore(container, descField);
|
||||
descField.style.display = 'none';
|
||||
const quill = new Quill(container, {
|
||||
theme: 'snow',
|
||||
modules: {
|
||||
toolbar: [
|
||||
['bold', 'italic', 'underline', 'strike'],
|
||||
[{ 'header': [1, 2, 3, false] }],
|
||||
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
|
||||
['link', 'code-block', 'blockquote'],
|
||||
[{ 'align': [] }],
|
||||
['clean']
|
||||
]
|
||||
}
|
||||
});
|
||||
quill.root.innerHTML = descField.value;
|
||||
document.querySelector('form').addEventListener('submit', function() {
|
||||
descField.value = quill.root.innerHTML;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -22,6 +22,7 @@
|
||||
<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Priority</th>
|
||||
<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Assignee</th>
|
||||
<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Created</th>
|
||||
{% if user.is_admin %}<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Actions</th>{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -43,6 +44,11 @@
|
||||
</td>
|
||||
<td class="text-sm text-gray-600">{{ issue.assignee.username|default:"-" }}</td>
|
||||
<td class="text-sm text-gray-500">{{ issue.created_at|date:"M d" }}</td>
|
||||
{% if user.is_admin %}
|
||||
<td>
|
||||
<label for="delete-issue-{{ issue.pk }}" class="btn btn-ghost btn-xs text-red-600">Delete</label>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="6" class="text-center py-12 text-gray-500">No issues found.</td></tr>
|
||||
@@ -51,4 +57,12 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% if user.is_admin %}
|
||||
{% for issue in issues %}
|
||||
{% with issue_id=issue.pk|stringformat:"s" %}
|
||||
{% url 'issue_delete' issue.pk as delete_url %}
|
||||
{% include "components/delete_modal.html" with modal_id="delete-issue-"|add:issue_id title="Delete Issue" message="Are you sure you want to delete this issue? This action cannot be undone." delete_url=delete_url %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -13,7 +13,7 @@
|
||||
<div class="flex gap-2">
|
||||
<a href="{% url 'board_edit' board.pk %}" class="btn btn-sm btn-ghost">Edit</a>
|
||||
{% if user.is_admin %}
|
||||
<a href="{% url 'board_delete' board.pk %}" class="btn btn-sm text-red-600 hover:bg-red-50">Delete</a>
|
||||
<label for="delete-modal-board" class="btn btn-sm text-red-600 hover:bg-red-50 cursor-pointer">Delete</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,42 +30,22 @@
|
||||
</div>
|
||||
<div class="flex-1 px-3 pb-3 space-y-2 min-h-[100px]"
|
||||
id="column-{{ column.pk }}"
|
||||
data-sortable-column="{{ column.pk }}"
|
||||
hx-post="{% url 'card_move' 0 %}"
|
||||
hx-trigger="end"
|
||||
x-data="{}">
|
||||
data-sortable-column="{{ column.pk }}">
|
||||
{% for card in column.cards.all %}
|
||||
{% include "partials/kanban/card.html" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="px-3 pb-3">
|
||||
<form method="post" action="{% url 'card_create' board.pk column.pk %}"
|
||||
hx-target="#column-{{ column.pk }}" hx-swap="beforeend"
|
||||
x-data="{ showForm: false }">
|
||||
{% csrf_token %}
|
||||
<template x-if="!showForm">
|
||||
<button type="button" @click="showForm = true" class="btn btn-ghost btn-sm w-full text-gray-500 hover:text-gray-700 hover:bg-white/80">
|
||||
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
|
||||
Add Card
|
||||
</button>
|
||||
</template>
|
||||
<template x-if="showForm">
|
||||
<div class="space-y-2">
|
||||
<input type="text" name="title" placeholder="Enter card title..." class="input input-sm w-full bg-white border-gray-200" required @keydown.escape="showForm = false">
|
||||
<div class="flex gap-1">
|
||||
<button type="submit" class="btn btn-sm bg-blue-600 text-white hover:bg-blue-700 border-0 flex-1">Add</button>
|
||||
<button type="button" @click="showForm = false" class="btn btn-sm btn-ghost">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</form>
|
||||
<a href="{% url 'card_create' board.pk column.pk %}" class="btn btn-ghost btn-sm w-full text-gray-500 hover:text-gray-700 hover:bg-white/80">
|
||||
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
|
||||
Add Card
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="flex-shrink-0 min-w-[280px] w-[280px]">
|
||||
<div class="bg-gray-50 border-2 border-dashed border-gray-200 rounded-2xl p-4 h-full">
|
||||
<form method="post" action="{% url 'column_create' board.pk %}"
|
||||
hx-target="#kanban-board" hx-swap="beforeend">
|
||||
<form method="post" action="{% url 'column_create' board.pk %}">
|
||||
{% csrf_token %}
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="text" name="name" placeholder="New column name..." class="input input-sm w-full bg-white border-gray-200" required>
|
||||
@@ -77,17 +57,66 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% url 'board_delete' board.pk as delete_url %}
|
||||
{% include "components/delete_modal.html" with modal_id="delete-modal-board" delete_url=delete_url %}
|
||||
|
||||
<!-- Card Delete Modal -->
|
||||
<input type="checkbox" id="delete-card-modal" class="modal-toggle" />
|
||||
<div class="modal" role="dialog">
|
||||
<div class="modal-box text-center">
|
||||
<div class="w-16 h-16 rounded-full bg-red-100 flex items-center justify-center mx-auto mb-4">
|
||||
<svg class="w-8 h-8 text-red-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/></svg>
|
||||
</div>
|
||||
<h3 class="font-bold text-lg mb-2">Delete Card</h3>
|
||||
<p class="py-4 text-gray-500">Are you sure you want to delete this card?</p>
|
||||
<form id="card-delete-form" method="post" action="">
|
||||
{% csrf_token %}
|
||||
<div class="flex gap-3 justify-center">
|
||||
<button type="submit" class="btn bg-red-600 text-white hover:bg-red-700 border-0">Delete</button>
|
||||
<label for="delete-card-modal" class="btn btn-ghost">Cancel</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<label class="modal-backdrop" for="delete-card-modal"></label>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block extra_scripts %}
|
||||
<script>
|
||||
function openCardDeleteModal(actionUrl) {
|
||||
document.getElementById('card-delete-form').action = actionUrl;
|
||||
document.getElementById('delete-card-modal').checked = true;
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
let cookieValue = null;
|
||||
if (document.cookie && document.cookie !== '') {
|
||||
const cookies = document.cookie.split(';');
|
||||
for (let i = 0; i < cookies.length; i++) {
|
||||
const cookie = cookies[i].trim();
|
||||
if (cookie.substring(0, name.length + 1) === (name + '=')) {
|
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const containers = document.querySelectorAll('[data-sortable-column]');
|
||||
const csrftoken = getCookie('csrftoken');
|
||||
|
||||
containers.forEach(container => {
|
||||
new Sortable(container, {
|
||||
group: 'shared',
|
||||
animation: 150,
|
||||
ghostClass: 'opacity-50',
|
||||
dragClass: '!shadow-xl !rotate-3',
|
||||
delay: 100,
|
||||
delayOnTouchOnly: true,
|
||||
filter: 'button, input, textarea, select, a',
|
||||
preventOnFilter: true,
|
||||
onEnd: function(evt) {
|
||||
const cardId = evt.item.id.replace('card-', '');
|
||||
const newColumnId = evt.to.id.replace('column-', '');
|
||||
@@ -96,10 +125,12 @@
|
||||
fetch('/cards/' + cardId + '/move/', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRFToken': '{{ csrf_token }}',
|
||||
'X-CSRFToken': csrftoken,
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
body: 'column_id=' + newColumnId + '&order=' + order
|
||||
}).catch(function(err) {
|
||||
console.error('Drag drop failed:', err);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -5,14 +5,10 @@
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
||||
<h1 class="text-xl font-bold text-gray-900 mb-1">{% if object %}Edit{% else %}New{% endif %} Board</h1>
|
||||
<p class="text-sm text-gray-500 mb-6">{% if object %}Update your board settings.{% else %}Create a new kanban board to organize your tasks.{% endif %}</p>
|
||||
<form method="post" class="space-y-4">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-700">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.errors %}<p class="text-red-500 text-xs mt-1">{{ field.errors.0 }}</p>{% endif %}
|
||||
</div>
|
||||
{% include "partials/form_field.html" %}
|
||||
{% endfor %}
|
||||
<div class="flex gap-3 pt-2">
|
||||
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">Save</button>
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
<div class="px-5 py-3 bg-gray-50 border-t border-gray-100 flex gap-2">
|
||||
<a href="{% url 'board_detail' board.pk %}" class="text-sm text-blue-600 hover:text-blue-800 font-medium">Open</a>
|
||||
<a href="{% url 'board_edit' board.pk %}" class="text-sm text-gray-500 hover:text-gray-700 ml-auto">Edit</a>
|
||||
<label for="delete-board-{{ board.pk }}" class="text-sm text-red-600 hover:text-red-800 font-medium cursor-pointer">Delete</label>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
@@ -36,4 +37,10 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% for board in boards %}
|
||||
{% with board_id=board.pk|stringformat:"s" %}
|
||||
{% url 'board_delete' board.pk as delete_url %}
|
||||
{% include "components/delete_modal.html" with modal_id="delete-board-"|add:board_id title="Delete Board" message="Are you sure you want to delete this board? This action cannot be undone." delete_url=delete_url %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,104 @@
|
||||
{% 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 %}
|
||||
@@ -1,24 +1,94 @@
|
||||
{% extends "base_authenticated.html" %}
|
||||
{% block title %}Edit Card{% endblock %}
|
||||
{% load form_helpers %}
|
||||
{% block title %}{% if is_create %}New Card{% else %}Edit Card{% endif %}{% endblock %}
|
||||
{% block content_inner %}
|
||||
<div class="max-w-lg mx-auto">
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
||||
<h1 class="text-xl font-bold text-gray-900 mb-1">Edit Card</h1>
|
||||
<p class="text-sm text-gray-500 mb-6">Update the card details.</p>
|
||||
<form method="post" class="space-y-4">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-700">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.errors %}<p class="text-red-500 text-xs mt-1">{{ field.errors.0 }}</p>{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="flex gap-3 pt-2">
|
||||
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">Save</button>
|
||||
<a href="{% url 'board_detail' object.column.board.pk %}" class="btn btn-ghost">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
<div class="max-w-3xl 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' board.pk %}" class="hover:text-blue-600">{{ board.name }}</a>
|
||||
<span>/</span>
|
||||
<span class="text-gray-900">{% if is_create %}New Card{% else %}{{ object.title|truncatechars:30 }}{% endif %}</span>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden">
|
||||
<div class="p-6">
|
||||
<h1 class="text-xl font-bold text-gray-900 mb-1">{% if is_create %}New Card{% else %}Edit Card{% endif %}</h1>
|
||||
<p class="text-sm text-gray-500 mb-6">Column: <strong>{{ column.name }}</strong></p>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
{% for field in form %}
|
||||
<div class="{% if field.name == 'title' or field.name == 'description' %}md:col-span-2{% endif %}">
|
||||
{% include "partials/form_field.html" %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="flex gap-3 pt-4 mt-4 border-t border-gray-100">
|
||||
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">
|
||||
{% if is_create %}Create Card{% else %}Save Changes{% endif %}
|
||||
</button>
|
||||
<a href="{% url 'board_detail' board.pk %}" class="btn btn-ghost">Cancel</a>
|
||||
{% if not is_create %}
|
||||
<label for="card-delete-modal" class="btn bg-red-50 text-red-700 hover:bg-red-100 border-0 ml-auto">Delete</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if not is_create and comments is not None %}
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden mt-6">
|
||||
<div class="px-6 py-4 border-b border-gray-100">
|
||||
<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' object.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>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% if not is_create %}
|
||||
{% 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/{{ object.pk }}/delete/" %}
|
||||
{% endif %}
|
||||
{% block extra_scripts %}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const desc = document.querySelector('textarea[name="description"]');
|
||||
if (desc) {
|
||||
new EasyMDE({
|
||||
element: desc,
|
||||
spellChecker: false,
|
||||
autosave: { enabled: false },
|
||||
toolbar: ['bold', 'italic', 'heading', '|', 'quote', 'unordered-list', 'ordered-list', '|', 'link', 'code', 'table', '|', 'preview', 'guide'],
|
||||
});
|
||||
}
|
||||
{% if not is_create %}
|
||||
const commentFields = document.querySelectorAll('textarea[name="body"]');
|
||||
commentFields.forEach(el => {
|
||||
new EasyMDE({
|
||||
element: el,
|
||||
spellChecker: false,
|
||||
toolbar: ['bold', 'italic', 'quote', '|', 'code', 'link', '|', 'preview'],
|
||||
});
|
||||
});
|
||||
{% endif %}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -14,7 +14,7 @@
|
||||
{% 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>
|
||||
<a href="{% url 'project_delete' project.pk %}" class="btn btn-sm bg-red-500/20 text-white hover:bg-red-500/30 border-0">Delete</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>
|
||||
@@ -88,4 +88,6 @@
|
||||
{% 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 %}
|
||||
@@ -5,14 +5,10 @@
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
||||
<h1 class="text-xl font-bold text-gray-900 mb-1">{% if object %}Edit{% else %}New{% endif %} Project</h1>
|
||||
<p class="text-sm text-gray-500 mb-6">{% if object %}Update the project details below.{% else %}Fill in the details to create a new project.{% endif %}</p>
|
||||
<form method="post" class="space-y-4">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-700">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.errors %}<p class="text-red-500 text-xs mt-1">{{ field.errors.0 }}</p>{% endif %}
|
||||
</div>
|
||||
{% include "partials/form_field.html" %}
|
||||
{% endfor %}
|
||||
<div class="flex gap-3 pt-2">
|
||||
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<a href="{% url 'project_detail' project.pk %}" class="btn btn-sm btn-ghost">View</a>
|
||||
{% if user.is_admin %}
|
||||
<a href="{% url 'project_edit' project.pk %}" class="btn btn-sm btn-ghost">Edit</a>
|
||||
<label for="delete-project-{{ project.pk }}" class="btn btn-sm bg-red-50 text-red-600 hover:bg-red-100 border-0">Delete</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -57,4 +58,12 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if user.is_admin %}
|
||||
{% for project in projects %}
|
||||
{% with project_id=project.pk|stringformat:"s" %}
|
||||
{% url 'project_delete' project.pk as delete_url %}
|
||||
{% include "components/delete_modal.html" with modal_id="delete-project-"|add:project_id title="Delete Project" message="Are you sure you want to delete this project? This action cannot be undone." delete_url=delete_url %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -1,39 +1,79 @@
|
||||
{% extends "base_authenticated.html" %}
|
||||
{% block title %}{{ ticket.title }}{% endblock %}
|
||||
{% block content_inner %}
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden">
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<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>
|
||||
<div class="flex items-center gap-2 text-sm text-gray-500 mb-1">
|
||||
<a href="{% url 'ticket_list' %}" class="hover:text-blue-600">Tickets</a>
|
||||
<span>/</span>
|
||||
<span class="text-gray-900">{{ ticket.title|truncatechars:30 }}</span>
|
||||
</div>
|
||||
<h1 class="text-2xl font-bold text-gray-900">{{ ticket.title }}</h1>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<a href="{% url 'ticket_edit' ticket.pk %}" class="btn btn-sm bg-blue-50 text-blue-700 hover:bg-blue-100 border-0">Edit</a>
|
||||
{% if user.is_admin %}
|
||||
<a href="{% url 'ticket_delete' ticket.pk %}" class="btn btn-sm text-red-600 hover:bg-red-50 border-0">Delete</a>
|
||||
<label for="delete-modal-ticket" class="btn btn-sm text-red-600 hover:bg-red-50 border-0 cursor-pointer">Delete</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2 mb-6">
|
||||
<div class="flex flex-wrap gap-2 mb-4">
|
||||
<span class="text-xs px-2.5 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>
|
||||
<span class="text-xs px-2.5 py-1 rounded-full font-medium bg-gray-100 text-gray-700">{{ ticket.get_status_display }}</span>
|
||||
<span class="text-xs px-2.5 py-1 rounded-full font-medium {% if ticket.status == 'new' %}bg-gray-100 text-gray-700{% elif ticket.status == 'acknowledged' %}bg-blue-100 text-blue-700{% elif ticket.status == 'in_progress' %}bg-amber-100 text-amber-700{% elif ticket.status == 'done' %}bg-green-100 text-green-700{% else %}bg-red-100 text-red-700{% endif %}">
|
||||
{{ ticket.get_status_display }}
|
||||
</span>
|
||||
<span class="text-xs px-2.5 py-1 rounded-full font-medium {% if ticket.priority == 'high' %}bg-red-100 text-red-700{% elif ticket.priority == 'medium' %}bg-amber-100 text-amber-700{% else %}bg-blue-100 text-blue-700{% endif %}">
|
||||
{{ ticket.get_priority_display }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="grid grid-cols-3 gap-4 mb-6 p-4 bg-gray-50 rounded-xl">
|
||||
<div><p class="text-xs text-gray-500 uppercase font-medium">Creator</p><p class="text-sm font-semibold text-gray-900 mt-0.5">{{ ticket.creator.username }}</p></div>
|
||||
<div><p class="text-xs text-gray-500 uppercase font-medium">Project</p><p class="text-sm font-semibold text-gray-900 mt-0.5">{{ ticket.project.name|default:"-" }}</p></div>
|
||||
<div><p class="text-xs text-gray-500 uppercase font-medium">Created</p><p class="text-sm font-semibold text-gray-900 mt-0.5">{{ ticket.created_at|date:"M d, Y" }}</p></div>
|
||||
<div><p class="text-xs text-gray-500 uppercase font-medium">Project</p><p class="text-sm font-semibold text-gray-900 mt-0.5"><a href="{% url 'project_detail' ticket.project.pk %}" class="hover:text-blue-600">{{ ticket.project.name|default:"-" }}</a></p></div>
|
||||
<div><p class="text-xs text-gray-500 uppercase font-medium">Assignee</p><p class="text-sm font-semibold text-gray-900 mt-0.5">{{ ticket.assignee.username|default:"Unassigned" }}</p></div>
|
||||
</div>
|
||||
<div class="prose prose-sm max-w-none">
|
||||
<p class="text-gray-700 whitespace-pre-wrap">{{ ticket.description }}</p>
|
||||
<div class="text-gray-700">{{ ticket.description|safe }}</div>
|
||||
</div>
|
||||
</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">
|
||||
<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 %}
|
||||
<div class="flex gap-3">
|
||||
<div class="w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center text-white text-xs font-bold flex-shrink-0">{{ comment.author.username|first|upper }}</div>
|
||||
<div class="flex-1">
|
||||
<div class="flex items-center gap-2 mb-1">
|
||||
<span class="text-sm font-semibold text-gray-900">{{ comment.author.username }}</span>
|
||||
<span class="text-xs text-gray-400">{{ comment.created_at|timesince }} ago</span>
|
||||
</div>
|
||||
<p class="text-sm text-gray-700">{{ comment.body }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<p class="text-sm text-gray-400 text-center py-4">No comments yet. Be the first to comment.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<form method="post" action="{% url 'ticket_comment' ticket.pk %}"
|
||||
hx-target="#comment-list" hx-swap="innerHTML"
|
||||
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" rows="2" class="textarea textarea-bordered w-full bg-gray-50 focus:bg-white rounded-xl" placeholder="Write your comment..." required></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 %}
|
||||
{% url 'ticket_delete' ticket.pk as delete_url %}
|
||||
{% include "components/delete_modal.html" with modal_id="delete-modal-ticket" delete_url=delete_url %}
|
||||
{% endblock %}
|
||||
@@ -5,14 +5,10 @@
|
||||
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
|
||||
<h1 class="text-xl font-bold text-gray-900 mb-1">{% if object %}Edit{% else %}New{% endif %} Ticket</h1>
|
||||
<p class="text-sm text-gray-500 mb-6">{% if object %}Update the ticket.{% else %}Submit a new support ticket or feature request.{% endif %}</p>
|
||||
<form method="post" class="space-y-4">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{% for field in form %}
|
||||
<div>
|
||||
<label class="text-sm font-medium text-gray-700">{{ field.label }}</label>
|
||||
{{ field }}
|
||||
{% if field.errors %}<p class="text-red-500 text-xs mt-1">{{ field.errors.0 }}</p>{% endif %}
|
||||
</div>
|
||||
{% include "partials/form_field.html" %}
|
||||
{% endfor %}
|
||||
<div class="flex gap-3 pt-2">
|
||||
<button type="submit" class="btn bg-blue-600 text-white hover:bg-blue-700 border-0">Save</button>
|
||||
@@ -22,3 +18,34 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block extra_scripts %}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const descField = document.querySelector('textarea[name="description"]');
|
||||
if (descField) {
|
||||
const container = document.createElement('div');
|
||||
container.style.height = '300px';
|
||||
container.className = 'mb-4 rounded-xl';
|
||||
descField.parentNode.insertBefore(container, descField);
|
||||
descField.style.display = 'none';
|
||||
const quill = new Quill(container, {
|
||||
theme: 'snow',
|
||||
modules: {
|
||||
toolbar: [
|
||||
['bold', 'italic', 'underline', 'strike'],
|
||||
[{ 'header': [1, 2, 3, false] }],
|
||||
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
|
||||
['link', 'code-block', 'blockquote'],
|
||||
[{ 'align': [] }],
|
||||
['clean']
|
||||
]
|
||||
}
|
||||
});
|
||||
quill.root.innerHTML = descField.value;
|
||||
document.querySelector('form').addEventListener('submit', function() {
|
||||
descField.value = quill.root.innerHTML;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -19,9 +19,11 @@
|
||||
<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Title</th>
|
||||
<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Type</th>
|
||||
<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Status</th>
|
||||
<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Priority</th>
|
||||
<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Project</th>
|
||||
<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Creator</th>
|
||||
<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Assignee</th>
|
||||
<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Created</th>
|
||||
{% if user.is_admin %}<th class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Actions</th>{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -33,16 +35,38 @@
|
||||
{{ ticket.get_ticket_type_display }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-sm text-gray-600">{{ ticket.get_status_display }}</td>
|
||||
<td>
|
||||
<span class="text-xs px-2.5 py-1 rounded-full font-medium {% if ticket.status == 'new' %}bg-gray-100 text-gray-700{% elif ticket.status == 'acknowledged' %}bg-blue-100 text-blue-700{% elif ticket.status == 'in_progress' %}bg-amber-100 text-amber-700{% elif ticket.status == 'done' %}bg-green-100 text-green-700{% else %}bg-red-100 text-red-700{% endif %}">
|
||||
{{ ticket.get_status_display }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="text-xs px-2.5 py-1 rounded-full font-medium {% if ticket.priority == 'high' %}bg-red-100 text-red-700{% elif ticket.priority == 'medium' %}bg-amber-100 text-amber-700{% else %}bg-blue-100 text-blue-700{% endif %}">
|
||||
{{ ticket.get_priority_display }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-sm text-gray-600">{{ ticket.project.name|default:"-" }}</td>
|
||||
<td class="text-sm text-gray-600">{{ ticket.creator.username }}</td>
|
||||
<td class="text-sm text-gray-600">{{ ticket.assignee.username|default:"-" }}</td>
|
||||
<td class="text-sm text-gray-500">{{ ticket.created_at|date:"M d" }}</td>
|
||||
{% if user.is_admin %}
|
||||
<td>
|
||||
<label for="delete-ticket-{{ ticket.pk }}" class="btn btn-ghost btn-xs text-red-600">Delete</label>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="6" class="text-center py-12 text-gray-500">No tickets found.</td></tr>
|
||||
<tr><td colspan="8" class="text-center py-12 text-gray-500">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 %}
|
||||
Reference in new issue
Block a user