fix BUG-64: can now move files into import or storage path

This commit is contained in:
2021-09-26 21:14:08 +10:00
parent 25a50d029f
commit 23c8d16a5b
7 changed files with 119 additions and 41 deletions

View File

@@ -1,6 +1,7 @@
from wtforms import SubmitField, StringField, HiddenField, validators, Form
from flask_wtf import FlaskForm
from flask import request, render_template, redirect, send_from_directory, url_for
from path import MovePathDetails
from main import db, app, ma
from sqlalchemy import Sequence
from sqlalchemy.exc import SQLAlchemyError
@@ -287,7 +288,8 @@ def files_ip():
OPT=Options( request )
entries=GetEntries( OPT )
people = Person.query.all()
return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", entry_data=entries, OPT=OPT, people=people )
move_paths = MovePathDetails()
return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", entry_data=entries, OPT=OPT, people=people, move_paths=move_paths )
################################################################################
# /files -> show thumbnail view of files from storage_path
@@ -298,7 +300,8 @@ def files_sp():
OPT=Options( request )
entries=GetEntries( OPT )
people = Person.query.all()
return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", entry_data=entries, OPT=OPT, people=people )
move_paths = MovePathDetails()
return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", entry_data=entries, OPT=OPT, people=people, move_paths=move_paths )
################################################################################
@@ -310,7 +313,8 @@ def files_rbp():
OPT=Options( request )
entries=GetEntries( OPT )
people = Person.query.all()
return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", entry_data=entries, OPT=OPT )
move_paths = MovePathDetails()
return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", entry_data=entries, OPT=OPT, move_paths=move_paths )
################################################################################
@@ -323,7 +327,8 @@ def search():
# always show flat results for search to start with
OPT.folders=False
entries=GetEntries( OPT )
return render_template("files.html", page_title='View Files', search_term=request.form['search_term'], entry_data=entries, OPT=OPT )
move_paths = MovePathDetails()
return render_template("files.html", page_title='View Files', search_term=request.form['search_term'], entry_data=entries, OPT=OPT, move_paths=move_paths )
################################################################################
# /files/scannow -> allows us to force a check for new files
@@ -448,6 +453,7 @@ def delete_files():
@app.route("/move_files", methods=["POST"])
@login_required
def move_files():
jex=[]
for el in request.form:
jex.append( JobExtra( name=f"{el}", value=request.form[el] ) )