diff --git a/files.py b/files.py index 646c907..cd3c521 100644 --- a/files.py +++ b/files.py @@ -209,6 +209,16 @@ class FaceRefimgLinkSchema(ma.SQLAlchemyAutoSchema): class Meta: model = FaceRefimgLink load_instance = True +class FaceNoMatchOverrideSchema(ma.SQLAlchemyAutoSchema): + class Meta: model = FaceOverrideType + load_instance = True + type = ma.Nested(FaceOverrideType) + +class FaceForceMatchOverrideSchema(ma.SQLAlchemyAutoSchema): + class Meta: model = FaceOverrideType + load_instance = True + person = ma.Nested(Person) + class FaceSchema(ma.SQLAlchemyAutoSchema): class Meta: model=Face @@ -218,6 +228,8 @@ class FaceSchema(ma.SQLAlchemyAutoSchema): # faces have to come with a file connection facefile_lnk = ma.Nested(FaceFileLinkSchema) refimg_lnk = ma.Nested(FaceRefimgLinkSchema,allow_none=True) + fnmo = ma.Nested( FaceNoMatchOverride, allow_none=True ) + ffmo = ma.Nested( FaceForceMatchOverride, allow_none=True ) class FileSchema(ma.SQLAlchemyAutoSchema): class Meta: model = File @@ -466,9 +478,8 @@ def file_list_ip(): @login_required def files_ip(): OPT=States( request ) - people = Person.query.all() query_data = GetQueryData( OPT ) - return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", OPT=OPT, people=people, query_data=query_data ) + return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", OPT=OPT, query_data=query_data ) ################################################################################ # /files -> show thumbnail view of files from storage_path @@ -477,9 +488,8 @@ def files_ip(): @login_required def files_sp(): OPT=States( request ) - people = Person.query.all() query_data = GetQueryData( OPT ) - return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", OPT=OPT, people=people, query_data=query_data ) + return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", OPT=OPT, query_data=query_data ) ################################################################################ @@ -489,9 +499,8 @@ def files_sp(): @login_required def files_rbp(): OPT=States( request ) - people = Person.query.all() query_data = GetQueryData( OPT ) - return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", OPT=OPT, people=people, query_data=query_data ) + return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", OPT=OPT, query_data=query_data ) ################################################################################ # search -> GET version -> has search_term in the URL and is therefore able to diff --git a/internal/js/files_support.js b/internal/js/files_support.js index 82b411c..62fb546 100644 --- a/internal/js/files_support.js +++ b/internal/js/files_support.js @@ -490,7 +490,7 @@ function drawPageOfFigures() if( OPT.folders ) { - if( !document.entries.length || (document.entries.length && document.entries[0].in_dir.rel_path == '' ) ) + if( (document.entries.length && document.entries[0].in_dir.rel_path == '' ) || OPT.root_eid == 0 ) { gray="_gray" back="" @@ -512,9 +512,6 @@ function drawPageOfFigures() ` ecnt++ - /* - - */ $('#figures').append(html) } for (const obj of document.entries) { @@ -524,7 +521,7 @@ function drawPageOfFigures() if( document.entries.length == 0 ) if( OPT.search_term ) $('#figures').append( ` No matches for: '${OPT.search_term}'` ) - else + else if( OPT.root_eid == 0 ) $('#figures').append( `No files in Path!` ) $('.figure').click( function(e) { DoSel(e, this ); SetButtonState(); return false; }); $('.figure').dblclick( function(e) { dblClickToViewEntry( $(this).attr('id') ); setDisabledForViewingNextPrevBttons(); addViewerKeyHandler() } ) @@ -536,6 +533,11 @@ function drawPageOfFigures() function getPageFileList(res, viewingIdx) { $('#file_list_div').empty() + if( OPT.root_eid == 0 ) + { + $('#file_list_div').append( `No files in Path!` ) + return + } html='' html+='' for (const obj of res) { diff --git a/templates/file_list.html b/templates/file_list.html index 727bb6f..097c936 100644 --- a/templates/file_list.html +++ b/templates/file_list.html @@ -19,7 +19,7 @@ -
+
@@ -40,6 +40,7 @@ // this is the list of entry ids for the images for ALL matches for this query var entryList={{query_data.entry_list}} var OPT = {{ OPT.to_dict()|tojson }}; + OPT.root_eid = {{ query_data.root_eid }}; // pageList is just those entries shown on this page from the full entryList var pageList=[]
NameSize (MB)Path PrefixHash