@@ -248,6 +248,9 @@ function renderTimeline() {
|
|||||||
</div>
|
</div>
|
||||||
<h6 class="event-title mt-1 mb-1">${esc(e.title)}</h6>
|
<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>' : ''}
|
${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="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="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>
|
<div class="comment-log">${renderComments(e)}</div>
|
||||||
@@ -289,6 +292,13 @@ async function addComment(eventId, el) {
|
|||||||
loadEvents();
|
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() {
|
async function saveEvent() {
|
||||||
const data = {
|
const data = {
|
||||||
team_id: document.getElementById('eventTeam').value,
|
team_id: document.getElementById('eventTeam').value,
|
||||||
|
|||||||
Reference in New Issue
Block a user