05/22 Enhance codes and fix bugs
This commit is contained in:
@@ -116,7 +116,8 @@
|
||||
<span class="comment-time">{{ comment.created_at | localtime("%b %d, %Y %H:%M") }}</span>
|
||||
{% if current_user.is_it_staff or comment.author_id == current_user.id %}
|
||||
<form method="POST" action="{{ url_for('tickets.delete_comment', comment_id=comment.id) }}"
|
||||
onsubmit="return confirm('Delete this comment?');">
|
||||
data-confirm="Delete this comment? This cannot be undone."
|
||||
data-confirm-title="Delete Comment" data-confirm-ok="Delete">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<button type="submit" class="btn btn-sm" style="background:none;border:none;color:var(--muted);padding:2px 6px;"
|
||||
title="Delete comment">
|
||||
@@ -502,7 +503,7 @@ function buildCommentEl(c) {
|
||||
? '<span style="font-size:10px;background:rgba(251,191,36,.15);color:var(--warning);padding:1px 7px;border-radius:4px;font-weight:600;">INTERNAL NOTE</span>'
|
||||
: '';
|
||||
const deleteBtn = c.can_delete
|
||||
? `<form method="POST" action="${DELETE_COMMENT_URL.replace('{id}', c.id)}" onsubmit="return confirm('Delete this comment?');" style="margin:0;">
|
||||
? `<form method="POST" action="${DELETE_COMMENT_URL.replace('{id}', c.id)}" data-confirm="Delete this comment? This cannot be undone." data-confirm-title="Delete Comment" data-confirm-ok="Delete" style="margin:0;">
|
||||
<input type="hidden" name="csrf_token" value="${document.querySelector('meta[name=csrf-token]').content}"/>
|
||||
<button type="submit" class="btn btn-sm" style="background:none;border:none;color:var(--muted);padding:2px 6px;" title="Delete comment">
|
||||
<i class="bi bi-trash"></i>
|
||||
@@ -654,7 +655,8 @@ function buildCommentEl(c) {
|
||||
</div>
|
||||
<form method="POST"
|
||||
action="{{ url_for('tickets.unlink_ticket', ticket_id=ticket.id, link_id=lnk.id) }}"
|
||||
onsubmit="return confirm('Remove this link?')" style="margin:0;flex-shrink:0;">
|
||||
data-confirm="Remove this link?" data-confirm-title="Remove Link" data-confirm-ok="Remove"
|
||||
style="margin:0;flex-shrink:0;">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<button type="submit" class="btn btn-sm" title="Remove link"
|
||||
style="background:none;border:none;color:var(--muted);padding:2px 6px;">
|
||||
|
||||
Reference in New Issue
Block a user