From 81264bd50d6bab19b294ad8c4171091170029153 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Fri, 24 Sep 2021 21:39:35 +1000 Subject: [PATCH] stop trying to use loop.index for which ecnt, just use a dedicated var... stops the weirdness between folders/no folders when highlighting too -- fixed last bug with incorrect selections --- templates/files.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/templates/files.html b/templates/files.html index 02a09c6..55ba2e1 100644 --- a/templates/files.html +++ b/templates/files.html @@ -117,15 +117,17 @@ + {% set ecnt=namespace( val=0 ) %}
{% set last = namespace(printed=0) %} {# rare event of empty folder, still need to show back button #} {% if OPT.folders and entry_data|length == 0 %} {% if OPT.cwd != OPT.root %} -
+
Back
+ {% set ecnt.val=ecnt.val+1 %} {% else %}
@@ -136,11 +138,12 @@ {% for obj in entry_data %} {% if loop.index==1 and OPT.folders %} {% if OPT.cwd != OPT.root %} -
+
Back
+ {% set ecnt.val=ecnt.val+1 %} {% else %} {# create an even lighter-grey, unclickable back button - so folders dont jump around when you go into them #}
@@ -169,7 +172,7 @@ {% endif %} {% if obj.type.name == "Image" or obj.type.name == "Video" %} {% if (not OPT.folders) or ((obj.in_dir.in_path.path_prefix+'/'+obj.in_dir.rel_path+'/'+obj.name) | TopLevelFolderOf(OPT.cwd)) %} -
+
{% if obj.type.name=="Image" %}
{{obj.name}} @@ -196,6 +199,7 @@
{% endif %}
+ {% set ecnt.val=ecnt.val+1 %} {% endif %} {% elif obj.type.name == "Directory" %} {% if OPT.folders %} @@ -206,11 +210,12 @@ {% endif %} {# if this dir is the toplevel of the cwd, show the folder icon #} {% if dirname| TopLevelFolderOf(OPT.cwd) %} -
+
{{obj.name}}
+ {% set ecnt.val=ecnt.val+1 %} {% endif %} {% endif %}