string / int strictness issue causing default size to not highlight button - fixed

This commit is contained in:
2021-07-16 17:52:31 +10:00
parent 6e6f59fdd5
commit d42ac8c8b5
2 changed files with 27 additions and 9 deletions

View File

@@ -122,8 +122,8 @@ def ViewingOptions( request ):
noo="Oldest" noo="Oldest"
grouping="None" grouping="None"
how_many="50" how_many="50"
offset=0 offset="0"
size=128 size="128"
if 'files_sp' in request.path: if 'files_sp' in request.path:
noo="A to Z" noo="A to Z"
folders=True folders=True

View File

@@ -129,7 +129,7 @@
{# rare event of empty folder, still need to show back button #} {# rare event of empty folder, still need to show back button #}
{% if folders and entry_data|length == 0 %} {% if folders and entry_data|length == 0 %}
{% if cwd != root %} {% if cwd != root %}
<figure class="px-1 dir entry" ecnt="1" dir="{{cwd|ParentPath}}"> <figure class="px-1 dir entry" ecnt="1" dir="{{cwd|ParentPath}}" type="Directory">
<span style="font-size:{{(size|int-22)/2}}px" class="fa-stack"> <span style="font-size:{{(size|int-22)/2}}px" class="fa-stack">
<i style="color:grey" class="fas fa-folder fa-stack-2x"></i> <i style="color:grey" class="fas fa-folder fa-stack-2x"></i>
<i class="fas fa-level-up-alt fa-flip-horizontal fa-stack-1x fa-inverse"></i> <i class="fas fa-level-up-alt fa-flip-horizontal fa-stack-1x fa-inverse"></i>
@@ -147,7 +147,7 @@
{% for obj in entry_data %} {% for obj in entry_data %}
{% if loop.index==1 and folders %} {% if loop.index==1 and folders %}
{% if cwd != root %} {% if cwd != root %}
<figure class="px-1 dir entry" ecnt="{{loop.index}}" dir="{{cwd|ParentPath}}"> <figure class="px-1 dir entry" ecnt="{{loop.index}}" dir="{{cwd|ParentPath}}" type="Directory">
<span style="font-size:{{(size|int-22)/2}}px" class="fa-stack"> <span style="font-size:{{(size|int-22)/2}}px" class="fa-stack">
<i style="color:grey" class="fas fa-folder fa-stack-2x"></i> <i style="color:grey" class="fas fa-folder fa-stack-2x"></i>
<i class="fas fa-level-up-alt fa-flip-horizontal fa-stack-1x fa-inverse"></i> <i class="fas fa-level-up-alt fa-flip-horizontal fa-stack-1x fa-inverse"></i>
@@ -195,7 +195,7 @@
{% endif %} {% endif %}
{% if obj.type.name != "Directory" %} {% if obj.type.name != "Directory" %}
{% if (not folders) or ((obj.in_dir.in_path.path_prefix+'/'+obj.in_dir.rel_path+'/'+obj.name) | TopLevelFolderOf(cwd)) %} {% if (not folders) or ((obj.in_dir.in_path.path_prefix+'/'+obj.in_dir.rel_path+'/'+obj.name) | TopLevelFolderOf(cwd)) %}
<figure id="{{obj.id}}" ecnt="{{loop.index}}" class="figure entry mx-1" path_type="{{obj.in_dir.in_path.type.name}}" size="{{obj.file_details.size_mb}}" hash="{{obj.file_details.hash}}" in_dir="{{obj.in_dir.in_path.path_prefix}}/{{obj.in_dir.rel_path}}" fname="{{obj.name}}" yr="{{obj.file_details.year}}" date="{{obj.file_details.year}}{{"%02d" % obj.file_details.month}}{{"%02d" % obj.file_details.day}}" pretty_date="{{obj.file_details.day}}/{{obj.file_details.month}}/{{obj.file_details.year}}"> <figure id="{{obj.id}}" ecnt="{{loop.index}}" class="figure entry mx-1" path_type="{{obj.in_dir.in_path.type.name}}" size="{{obj.file_details.size_mb}}" hash="{{obj.file_details.hash}}" in_dir="{{obj.in_dir.in_path.path_prefix}}/{{obj.in_dir.rel_path}}" fname="{{obj.name}}" yr="{{obj.file_details.year}}" date="{{obj.file_details.year}}{{"%02d" % obj.file_details.month}}{{"%02d" % obj.file_details.day}}" pretty_date="{{obj.file_details.day}}/{{obj.file_details.month}}/{{obj.file_details.year}}" type="{{obj.type.name}}">
{% if obj.type.name=="Image" %} {% if obj.type.name=="Image" %}
<div style="position:relative; width:100%"> <div style="position:relative; width:100%">
<a href="{{obj.in_dir.in_path.path_prefix}}/{{obj.in_dir.rel_path}}/{{obj.name}}"><img class="thumb" height="{{size}}" src="data:image/jpeg;base64,{{obj.file_details.thumbnail}}"></img></a> <a href="{{obj.in_dir.in_path.path_prefix}}/{{obj.in_dir.rel_path}}/{{obj.name}}"><img class="thumb" height="{{size}}" src="data:image/jpeg;base64,{{obj.file_details.thumbnail}}"></img></a>
@@ -230,7 +230,7 @@
{% endif %} {% endif %}
{# if this dir is the toplevel of the cwd, show the folder icon #} {# if this dir is the toplevel of the cwd, show the folder icon #}
{% if dirname| TopLevelFolderOf(cwd) %} {% if dirname| TopLevelFolderOf(cwd) %}
<figure class="px-1 dir entry" id={{obj.id}} ecnt={{loop.index}} dir="{{dirname}}"> <figure class="px-1 dir entry" id={{obj.id}} ecnt={{loop.index}} dir="{{dirname}}" type="Directory">
<i style="font-size:{{size|int-22}}px" class="fas fa-folder"></i> <i style="font-size:{{size|int-22}}px" class="fas fa-folder"></i>
<figcaption class="figure-caption text-center text-wrap text-break">{{obj.name}}</figcaption> <figcaption class="figure-caption text-center text-wrap text-break">{{obj.name}}</figcaption>
</figure class="figure"> </figure class="figure">
@@ -513,12 +513,27 @@ $.contextMenu({
DoSel(e, e.currentTarget ) DoSel(e, e.currentTarget )
if( FiguresOrDirsOrBoth() == "figure" ) if( FiguresOrDirsOrBoth() == "figure" )
{
item_list = { item_list = {
details: { name: "Details..." }, details: { name: "Details..." },
view: { name: "View File" }, view: { name: "View File" },
sep: "---", sep: "---",
move: { name: "Move selected file(s) to new storage folder" }, }
sep2: "---" } if( e.currentTarget.getAttribute('type') == 'Image' )
{
item_list['rotate'] = {
name: "Rotate",
items: {
"r90": { "name" : "90 degrees" },
"r180": { "name" : "180 degrees" },
"r270": { "name" : "270 degrees" }
}
}
}
item_list['move'] = { name: "Move selected file(s) to new storage folder" }
item_list['sep2'] = { sep: "---" }
}
else else
item_list = {} item_list = {}
@@ -537,7 +552,7 @@ $.contextMenu({
} else { } else {
if (e.currentTarget.getAttribute('path_type') == 'Bin' ) if (e.currentTarget.getAttribute('path_type') == 'Bin' )
item_list['undel']= { name: "Restore selected file(s)" } item_list['undel']= { name: "Restore selected file(s)" }
else else if( e.currentTarget.getAttribute('type') != 'Directory' )
item_list['del']= { name: "Delete Selected file(s)" } item_list['del']= { name: "Delete Selected file(s)" }
} }
@@ -552,6 +567,9 @@ $.contextMenu({
if( key == "move" ) { MoveDBox() } if( key == "move" ) { MoveDBox() }
if( key == "del" ) { DelDBox('Delete') } if( key == "del" ) { DelDBox('Delete') }
if( key == "undel" ) { DelDBox('Restore') } if( key == "undel" ) { DelDBox('Restore') }
if( key == "r90" ) { console.log('r90') }
if( key == "r180" ) { console.log('r180') }
if( key == "r270" ) { console.log('r270') }
if( key.startsWith("ai")) { RunAIOnSeln(key) } if( key.startsWith("ai")) { RunAIOnSeln(key) }
}, },
items: item_list items: item_list