mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-14 11:06:13 +05:00
fix: soften archive result delete controls
This commit is contained in:
parent
2e27985566
commit
4762ff4f57
@ -198,7 +198,7 @@ def render_archiveresults_list(archiveresults_qs, limit=50, config=None, can_del
|
||||
if can_delete:
|
||||
delete_button = f'''
|
||||
<button type="button" data-archive-result-ids="{result.id}" data-delete-url="{delete_url}"
|
||||
title="Delete this output">❌</button>
|
||||
title="Delete this output">×</button>
|
||||
'''
|
||||
|
||||
rows.append(f'''
|
||||
|
||||
@ -1712,7 +1712,7 @@
|
||||
<a href="{{display_url}}" data-no-preview="1" title="Download output file" download>⬇️</a>
|
||||
{% endif %}
|
||||
{% if can_delete_outputs and result.result %}
|
||||
<button type="button" data-no-preview="1" data-archive-result-ids="{{result.result_ids}}" data-delete-url="{% admin_base_url %}/admin/core/archiveresult/" title="Delete this output">❌</button>
|
||||
<button type="button" data-no-preview="1" data-archive-result-ids="{{result.result_ids}}" data-delete-url="{% admin_base_url %}/admin/core/archiveresult/" title="Delete this output">×</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if display_path %}
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
<style>
|
||||
[data-archive-result-ids] { color: #64748b; }
|
||||
[data-archive-result-ids]:hover,
|
||||
[data-archive-result-ids].delete-pending { color: #b91c1c; }
|
||||
</style>
|
||||
<script>
|
||||
(() => {
|
||||
for (const sortButton of document.querySelectorAll('[data-output-size-sort]')) {
|
||||
@ -23,8 +28,8 @@
|
||||
function renderDeleteCountdown(label='') {
|
||||
for (const button of deleteOutputButtons) {
|
||||
const queued = button.dataset.archiveResultIds.split(',').every((id) => queuedOutputIds.has(id))
|
||||
button.textContent = queued ? label : '❌'
|
||||
button.style.color = queued ? '#b91c1c' : ''
|
||||
button.textContent = queued ? label : '×'
|
||||
button.classList.toggle('delete-pending', queued)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -780,6 +780,10 @@ class TestSnapshotOutputDeletion:
|
||||
assert "action: 'delete_selected'" in html
|
||||
assert "/admin/core/archiveresult/" in html
|
||||
assert "[deleting]" in html
|
||||
assert ">×</button>" in html
|
||||
assert "[data-archive-result-ids]:hover" in html
|
||||
assert "[data-archive-result-ids].delete-pending" in html
|
||||
assert "button.classList.toggle('delete-pending', queued)" in html
|
||||
|
||||
request.user = AnonymousUser()
|
||||
anonymous_html = SnapshotView.render_live_index(request, snapshot).content.decode()
|
||||
@ -856,6 +860,8 @@ class TestSnapshotOutputDeletion:
|
||||
assert reverse("admin:core_archiveresult_changelist") in html
|
||||
assert "const queuedOutputIds = new Set()" in html
|
||||
assert "action: 'delete_selected'" in html
|
||||
assert ">×</button>" in html
|
||||
assert "button.classList.toggle('delete-pending', queued)" in html
|
||||
|
||||
|
||||
class TestAdminSnapshotListView:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user