From 1e219fd2b89c44fb417d7708deef4afb9103c1ce Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Tue, 2 Feb 2021 01:15:28 +1100 Subject: [PATCH] now keep size over reloads of page, its hacky though --- files.py | 4 +++- templates/files.html | 43 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/files.py b/files.py index 6dad0df..ed71665 100644 --- a/files.py +++ b/files.py @@ -105,12 +105,14 @@ def files(): grouping="Day" how_many="50" offset=0 + size=128 if request.method=="POST": noo=request.form['noo'] how_many=request.form['how_many'] offset=int(request.form['offset']) grouping=request.form['grouping'] + size = request.form['size'] if 'prev' in request.form: offset -= int(how_many) if offset < 0: @@ -123,7 +125,7 @@ def files(): entries=Entry.query.join(File).order_by(File.year,File.month,File.day,Entry.name).offset(offset).limit(how_many).all() else: entries=Entry.query.join(File).order_by(File.year.desc(),File.month.desc(),File.day.desc(),Entry.name).offset(offset).limit(how_many).all() - return render_template("files.html", page_title='View Files', entry_data=entries, noo=noo, grouping=grouping, how_many=how_many, offset=offset ) + return render_template("files.html", page_title='View Files', entry_data=entries, noo=noo, grouping=grouping, how_many=how_many, offset=offset, size=size ) ################################################################################ # /search -> show thumbnail view of files from import_path(s) diff --git a/templates/files.html b/templates/files.html index 97bb4b7..d8b936c 100644 --- a/templates/files.html +++ b/templates/files.html @@ -20,24 +20,50 @@
+ {% if size == "64" %} + {% set bt="btn-info" %} + {% else %} + {% set bt="btn-outline-info" %} + {% endif %}
- +
+ {% if size == "96" %} + {% set bt="btn-info" %} + {% else %} + {% set bt="btn-outline-info" %} + {% endif %}
- +
+ {% if size == "128" %} + {% set bt="btn-info" %} + {% else %} + {% set bt="btn-outline-info" %} + {% endif %}
- +
+ {% if size == "192" %} + {% set bt="btn-info" %} + {% else %} + {% set bt="btn-outline-info" %} + {% endif %}
- +
+ {% if size == "256" %} + {% set bt="btn-info" %} + {% else %} + {% set bt="btn-outline-info" %} + {% endif %}
- +
+ {% set last = namespace(printed=0) %} @@ -77,10 +103,10 @@
{% if obj.type.name=="Image" %} - + {% elif obj.type.name == "Video" %}
- +
@@ -100,9 +126,10 @@