mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-16 10:17:47 +00:00
filesize now shown
This commit is contained in:
@@ -34,7 +34,9 @@ todo = """
|
||||
|
||||
- Enable folder creation in dwguploads or as a separate form
|
||||
|
||||
- Enable file rename on expofiles, particularly in /surveyscans/ (aka wallets)
|
||||
- Enable file rename on expofiles, not just for /surveyscans/ (aka wallets)
|
||||
|
||||
- Make file rename utility less ugly.
|
||||
"""
|
||||
|
||||
class FilesForm(forms.Form): # not a model-form, just a form-form
|
||||
@@ -69,7 +71,8 @@ def expofilerename(request, filepath):
|
||||
return render(request, "errors/generic.html", {"message": message})
|
||||
else:
|
||||
filename = Path(filepath).name
|
||||
folder = Path(actualpath).parent
|
||||
folder = actualpath.parent
|
||||
filesize = f"{actualpath.stat().st_size:,}"
|
||||
|
||||
if not actualpath.is_relative_to(Path(settings.SCANS_ROOT)):
|
||||
message = f'\n Can only do rename within wallets (expofiles/surveyscans/) currently, sorry. "{actualpath}" '
|
||||
@@ -101,6 +104,7 @@ def expofilerename(request, filepath):
|
||||
"form": form,
|
||||
"filepath": filepath,
|
||||
"filename": filename,
|
||||
"filesize": filesize,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user