add some padding, and set root_eid - Its 0 when nothing at all in Path (first run/empty). Also, started override for marshmallow, but overrides wont work yet
This commit is contained in:
21
files.py
21
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
|
||||
|
||||
@@ -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()
|
||||
</figure>
|
||||
</div>`
|
||||
ecnt++
|
||||
/*
|
||||
<script>f=$('#_back'); w=f.find('svg').width(); f.find('figcaption').width(w);</script>
|
||||
*/
|
||||
$('#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( `<span class="alert alert-danger p-2 col-auto"> No matches for: '${OPT.search_term}'</span>` )
|
||||
else
|
||||
else if( OPT.root_eid == 0 )
|
||||
$('#figures').append( `<span class="alert alert-danger p-2 col-auto d-flex align-items-center">No files in Path!</span>` )
|
||||
$('.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( `<span class="alert alert-danger p-2">No files in Path!</span>` )
|
||||
return
|
||||
}
|
||||
html='<table class="table table-striped table-sm col-12">'
|
||||
html+='<thead><tr class="table-primary"><th>Name</th><th>Size (MB)</th><th>Path Prefix</th><th>Hash</th></tr></thead><tbody>'
|
||||
for (const obj of res) {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</div class="input-group...">
|
||||
</div class="col col-auto">
|
||||
</div class="container">
|
||||
<div id="file_list_div" class="container-fluid">
|
||||
<div id="file_list_div" class="container-fluid pt-2">
|
||||
</div class="container">
|
||||
<div class="container-fluid">
|
||||
<input type="hidden" name="cwd" id="cwd" value="{{OPT.cwd}}">
|
||||
@@ -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=[]
|
||||
|
||||
Reference in New Issue
Block a user