From 060cf8acd2111401feeae2264312a2653a9bae29 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Tue, 8 Jun 2021 21:16:49 +1000 Subject: [PATCH] put beginnings of undelete in context menu -> does nothing as yet, nor does delete for that matter. tweaked the alert displaying folder we are in to better show path icon and location, added a disabled back button in folder view so actual folders dont jumped around when you go into the first folder and a back button used to appear. Peak into first entry to see if we are viewing a Bin path and if so, then we could use undel.... In hindsight this is a hack that needs to be thought through per file (when I search it will break), but its a start for now and shows the right context menu when viewing a specific path. --- templates/files.html | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/templates/files.html b/templates/files.html index 31d27bb..e8984b4 100644 --- a/templates/files.html +++ b/templates/files.html @@ -6,6 +6,7 @@ Move selected file(s) to new storage folder Delete Selected file(s) + UnDelete Selected file(s)
@@ -28,7 +29,7 @@ {% set tmp_path=cwd | replace( "static/Bin", "" ) + "/" %} {% endif %} - In: {{tmp_path}} + {{tmp_path}}
{% endif %}
@@ -121,6 +122,12 @@
Back
+ {% else %} + {# create an even lighter-grey, unclickable back button - so folders dont jump around when you go into them #} + + + + {% endif %} {% endif %} {% if not folders and obj.type.name == "Directory" %} @@ -202,6 +209,7 @@ {% if grouping == "None" %}
{% endif %} + {% endblock main_content %} {% block script_content %} @@ -359,11 +367,19 @@ $('.figure').click( function(e) { DoSel(e, this ); return false; }); }; })(jQuery, window); +{% if entry_data|length > 0 %} + if( "{{entry_data[0].in_dir.in_path.type.name}}" == "Bin" ) { + $('#dd_del').hide() + } else { + $('#dd_undel').hide() + } +{% endif %} + $(".figure").contextMenu({ menuSelector: "#contextMenu", menuSelected: function (invokedOn, selectedMenu) { var msg = "You selected the menu item '" + selectedMenu.text() + - "' on the file id: " + $(invokedOn).parent().parent().attr('id') + "' on the file id: " + $(invokedOn).parent().parent().parent().attr('id') console.log(msg); if ( "View File" == selectedMenu.text() ) { document.location.href = $(invokedOn).parent().attr('href')