mirror of
https://github.com/Xevion/simple-viewer.git
synced 2025-12-06 09:16:31 -06:00
add file count and directory path info to delete confirm prompt
This commit is contained in:
@@ -38,6 +38,7 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django.contrib.humanize'
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
||||
@@ -136,3 +136,8 @@ a.card-footer-item:hover {
|
||||
.delete-icon .icon {
|
||||
color: #d63b3b;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: #bcf6ff;
|
||||
color: #033343;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
<div class="content">
|
||||
<p>
|
||||
Are you sure you want to remove this directory from the file server?
|
||||
<br>
|
||||
{% load humanize %}
|
||||
<code>{{ directory.path }}</code> contains {{ num_files|intcomma }} files.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -120,5 +120,6 @@ def confirm_delete(request, directory_id):
|
||||
def delete(request, directory_id):
|
||||
directory = get_object_or_404(ServedDirectory, id=directory_id)
|
||||
context = {'content_column_size': 'is-one-third',
|
||||
'num_files': len(directory.files.all()),
|
||||
'directory': directory}
|
||||
return render(request, 'delete.html', context=context)
|
||||
|
||||
Reference in New Issue
Block a user