fix: deleted entries shown with strikethrough + opacity, edit/delete hidden

This commit is contained in:
2026-06-11 21:26:05 +04:00
parent bc209aeab8
commit f818f454a3
+4 -4
View File
@@ -328,19 +328,18 @@
</thead>
<tbody>
<% entries.forEach(e => { %>
<tr>
<td><code><%= e.value_cidr %></code></td>
<tr style="<%= e.deleted_at ? 'opacity:.5;text-decoration:line-through;' : '' %>">
<td><code><%= e.value_cidr %></code><% if (e.deleted_at) { %> <span style="font-size:.7rem;color:var(--red);">удалена</span><% } %></td>
<td><%= e.comment || '—' %></td>
<td><%= e.created_by %></td>
<td><%= new Date(e.created_at).toLocaleDateString('ru', {day:'numeric',month:'short',year:'numeric',hour:'2-digit',minute:'2-digit',timeZone:'Etc/GMT-4'}) %></td>
<!-- Дата последнего редактирования (null если не менялась) -->
<td style="color:var(--muted);font-size:.8rem;">
<%= e.updated_at
? new Date(e.updated_at).toLocaleDateString('ru', {day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Etc/GMT-4'})
: '—' %>
</td>
<td class="text-center" style="white-space:nowrap;">
<%
<% if (!e.deleted_at) { %>
// data-* атрибуты для JS-заполнения modal без inline-onclick с параметрами.
// Так как комментарий может содержать кавычки — EJS экранирует их в HTML.
// Но в data-атрибуте JSON::stringify безопаснее.
@@ -364,6 +363,7 @@
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
<button class="btn btn-danger">Удалить</button>
</form>
<% } %>
</td>
</tr>
<% }) %>