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.

This commit is contained in:
2021-06-08 21:16:49 +10:00
parent 651e1250a4
commit 060cf8acd2

View File

@@ -6,6 +6,7 @@
<div class="dropdown-divider"></div>
<a id="dd_move" class="dropdown-item" href="#">Move selected file(s) to new storage folder</a>
<a id="dd_del" class="dropdown-item" href="#">Delete Selected file(s)</a>
<a id="dd_undel" class="dropdown-item" href="#">UnDelete Selected file(s)</a>
</div>
<div class="container-fluid">
@@ -28,7 +29,7 @@
<i class="fas fa-trash-alt"></i>
{% set tmp_path=cwd | replace( "static/Bin", "" ) + "/" %}
{% endif %}
In: {{tmp_path}}</span>
{{tmp_path}}</span>
</div class="col my-auto">
{% endif %}
<div class="input-group col-lg-4">
@@ -121,6 +122,12 @@
</span>
<figcaption class="figure-caption text-center">Back</figcaption>
</figure class="figure">
{% else %}
{# create an even lighter-grey, unclickable back button - so folders dont jump around when you go into them #}
<span style="font-size:{{(size|int-22)/2}}" class="fa-stack">
<i style="color:lightgrey" class="fas fa-folder fa-stack-2x"></i>
<i class="fas fa-level-up-alt fa-flip-horizontal fa-stack-1x fa-inverse"></i>
</span>
{% endif %}
{% endif %}
{% if not folders and obj.type.name == "Directory" %}
@@ -202,6 +209,7 @@
{% if grouping == "None" %}
</div class="row pl-3">
{% endif %}
</div class="container">
{% 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')