adding deletion
Deploy / deploy (push) Successful in 38s

This commit is contained in:
2026-05-07 20:28:32 +02:00
parent ca9ff4aaae
commit 925bc427e6
+10
View File
@@ -248,6 +248,9 @@ function renderTimeline() {
</div>
<h6 class="event-title mt-1 mb-1">${esc(e.title)}</h6>
${e.description ? '<p class="mb-1 small text-secondary">' + esc(e.description) + '</p>' : ''}
<div class="text-end">
<button class="btn btn-outline-danger btn-sm py-0 px-1" onclick="deleteEvent(${e.id}, this)" title="Delete event" style="font-size:.7rem;"><i class="fas fa-trash"></i></button>
</div>
<div class="mt-2" id="comments-${e.id}">
<div class="d-flex align-items-center mb-1"><small class="text-secondary fw-bold"><i class="fas fa-comment-dots me-1"></i>Comments ${e.comments && e.comments.length ? '(' + e.comments.length + ')' : ''}</small></div>
<div class="comment-log">${renderComments(e)}</div>
@@ -289,6 +292,13 @@ async function addComment(eventId, el) {
loadEvents();
}
async function deleteEvent(id, btn) {
if (!confirm('Delete this event?')) return;
btn.disabled = true;
await apiFetch('events/' + id, { method: 'DELETE' });
loadEvents();
}
async function saveEvent() {
const data = {
team_id: document.getElementById('eventTeam').value,