fix: deleted entries shown with strikethrough + opacity, edit/delete hidden
This commit is contained in:
+4
-4
@@ -328,19 +328,18 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% entries.forEach(e => { %>
|
<% entries.forEach(e => { %>
|
||||||
<tr>
|
<tr style="<%= e.deleted_at ? 'opacity:.5;text-decoration:line-through;' : '' %>">
|
||||||
<td><code><%= e.value_cidr %></code></td>
|
<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.comment || '—' %></td>
|
||||||
<td><%= e.created_by %></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>
|
<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;">
|
<td style="color:var(--muted);font-size:.8rem;">
|
||||||
<%= e.updated_at
|
<%= e.updated_at
|
||||||
? new Date(e.updated_at).toLocaleDateString('ru', {day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Etc/GMT-4'})
|
? new Date(e.updated_at).toLocaleDateString('ru', {day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Etc/GMT-4'})
|
||||||
: '—' %>
|
: '—' %>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center" style="white-space:nowrap;">
|
<td class="text-center" style="white-space:nowrap;">
|
||||||
<%
|
<% if (!e.deleted_at) { %>
|
||||||
// data-* атрибуты для JS-заполнения modal без inline-onclick с параметрами.
|
// data-* атрибуты для JS-заполнения modal без inline-onclick с параметрами.
|
||||||
// Так как комментарий может содержать кавычки — EJS экранирует их в HTML.
|
// Так как комментарий может содержать кавычки — EJS экранирует их в HTML.
|
||||||
// Но в data-атрибуте JSON::stringify безопаснее.
|
// Но в data-атрибуте JSON::stringify безопаснее.
|
||||||
@@ -364,6 +363,7 @@
|
|||||||
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
|
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
|
||||||
<button class="btn btn-danger">Удалить</button>
|
<button class="btn btn-danger">Удалить</button>
|
||||||
</form>
|
</form>
|
||||||
|
<% } %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% }) %>
|
<% }) %>
|
||||||
|
|||||||
Reference in New Issue
Block a user