quick fix for view being a POST, its now redirected to a GET, but I want to fix up the viewlist properly as well, should work for now though
This commit is contained in:
40
files.py
40
files.py
@@ -292,10 +292,13 @@ def clear_jm_msg(id):
|
||||
################################################################################
|
||||
# /file_list -> show detailed file list of files from import_path(s)
|
||||
################################################################################
|
||||
@app.route("/file_list_ip", methods=["GET","POST"])
|
||||
@app.route("/file_list_ip", methods=["GET", "POST"])
|
||||
@login_required
|
||||
def file_list_ip():
|
||||
OPT=Options( request )
|
||||
# now we have reset the offset, etc. into the prefs, we can use a GET and this will be back/forward browser button safe
|
||||
if request.method=='POST':
|
||||
redirect("/file_list_ip")
|
||||
entries=GetEntries( OPT )
|
||||
return render_template("file_list.html", page_title='View File Details (Import Path)', entry_data=entries, OPT=OPT )
|
||||
|
||||
@@ -306,6 +309,9 @@ def file_list_ip():
|
||||
@login_required
|
||||
def files_ip():
|
||||
OPT=Options( request )
|
||||
# now we have reset the offset, etc. into the prefs, we can use a GET and this will be back/forward browser button safe
|
||||
if request.method=='POST':
|
||||
redirect("/files_ip")
|
||||
entries=GetEntries( OPT )
|
||||
people = Person.query.all()
|
||||
move_paths = MovePathDetails()
|
||||
@@ -318,6 +324,9 @@ def files_ip():
|
||||
@login_required
|
||||
def files_sp():
|
||||
OPT=Options( request )
|
||||
# now we have reset the offset, etc. into the prefs, we can use a GET and this will be back/forward browser button safe
|
||||
if request.method=='POST':
|
||||
redirect("/files_sp")
|
||||
entries=GetEntries( OPT )
|
||||
people = Person.query.all()
|
||||
move_paths = MovePathDetails()
|
||||
@@ -331,6 +340,9 @@ def files_sp():
|
||||
@login_required
|
||||
def files_rbp():
|
||||
OPT=Options( request )
|
||||
# now we have reset the offset, etc. into the prefs, we can use a GET and this will be back/forward browser button safe
|
||||
if request.method=='POST':
|
||||
redirect("/files_rbp")
|
||||
entries=GetEntries( OPT )
|
||||
people = Person.query.all()
|
||||
move_paths = MovePathDetails()
|
||||
@@ -404,7 +416,7 @@ def fix_dups():
|
||||
|
||||
if rows.returns_rows == False:
|
||||
st.SetMessage(f"Err, no dups - should now clear the FE 'danger' message?")
|
||||
return render_template("base.html")
|
||||
return redirect("/")
|
||||
|
||||
if 'pagesize' not in request.form:
|
||||
# default to 10, see if we have a larger value as someone reset it in the gui, rather than first time invoked
|
||||
@@ -448,7 +460,7 @@ def rm_dups():
|
||||
job=NewJob( "rmdups", 0, None, jex )
|
||||
st.SetMessage( f"Created <a href=/job/{job.id}>Job #{job.id}</a> to delete duplicate files")
|
||||
|
||||
return render_template("base.html")
|
||||
return redirect("/jobs")
|
||||
|
||||
################################################################################
|
||||
# /restore_files -> create a job to restore files for the b/e to process
|
||||
@@ -462,7 +474,7 @@ def restore_files():
|
||||
|
||||
job=NewJob( "restore_files", 0, None, jex )
|
||||
st.SetMessage( f"Created <a href=/job/{job.id}>Job #{job.id}</a> to restore selected file(s)")
|
||||
return render_template("base.html")
|
||||
return redirect("/jobs")
|
||||
|
||||
################################################################################
|
||||
# /delete_files -> create a job to delete files for the b/e to process
|
||||
@@ -476,7 +488,7 @@ def delete_files():
|
||||
|
||||
job=NewJob( "delete_files", 0, None, jex )
|
||||
st.SetMessage( f"Created <a href=/job/{job.id}>Job #{job.id}</a> to delete selected file(s)")
|
||||
return render_template("base.html")
|
||||
return redirect("/jobs")
|
||||
|
||||
################################################################################
|
||||
# /move_files -> create a job to move files for the b/e to process
|
||||
@@ -490,7 +502,7 @@ def move_files():
|
||||
jex.append( JobExtra( name=f"{el}", value=request.form[el] ) )
|
||||
job=NewJob( "move_files", 0, None, jex )
|
||||
st.SetMessage( f"Created <a href=/job/{job.id}>Job #{job.id}</a> to move selected file(s)")
|
||||
return render_template("base.html")
|
||||
return redirect("/jobs")
|
||||
|
||||
################################################################################
|
||||
# /viewlist -> get new set of eids and set current to new img to view
|
||||
@@ -533,6 +545,20 @@ def viewlist():
|
||||
|
||||
return render_template("viewer.html", current=current, eids=eids, objs=objs, OPT=OPT )
|
||||
|
||||
@login_required
|
||||
@app.route("/new_view/<id>", methods=["GET"])
|
||||
def newview_img(id):
|
||||
OPT=Options( request )
|
||||
objs = {}
|
||||
lst = OPT.view_eids.split(',')
|
||||
print( f"lst={lst}" )
|
||||
for e in Entry.query.join(File).filter(Entry.id.in_(lst)).all():
|
||||
objs[e.id]=e
|
||||
# put locn data back into array format
|
||||
for face in e.file_details.faces:
|
||||
face.locn = json.loads(face.locn)
|
||||
return render_template("viewer.html", current=int(id), eids=OPT.view_eids, objs=objs, OPT=OPT )
|
||||
|
||||
################################################################################
|
||||
# /view/id -> grabs data from DB and views it
|
||||
################################################################################
|
||||
@@ -540,7 +566,7 @@ def viewlist():
|
||||
@login_required
|
||||
def view_img(id):
|
||||
OPT=Options( request )
|
||||
eids=request.form['eids'].rstrip(',')
|
||||
return redirect( "/new_view/" + id );
|
||||
objs = {}
|
||||
lst = eids.split(',')
|
||||
for e in Entry.query.join(File).filter(Entry.id.in_(lst)).all():
|
||||
|
||||
Reference in New Issue
Block a user