diff --git a/TODO b/TODO index 923d570..c5106ee 100644 --- a/TODO +++ b/TODO @@ -8,8 +8,6 @@ * move all unsorted photos/* -> import/ - * when viewing image, with fname, show full path with icon of 'path' - * when hitting back button to a search, it doesnt handle the post, etc. * get build process to create a random string for secret for PROD, otherwise use builtin for dev diff --git a/internal/js/view_support.js b/internal/js/view_support.js index 146f379..3b06974 100644 --- a/internal/js/view_support.js +++ b/internal/js/view_support.js @@ -52,7 +52,7 @@ function DrawImg() if( $('#fname_toggle').prop('checked' ) ) { // reset fname for new image (if navigated left/right to get here) - $('#fname').html(objs[current].name) + $('#fname').html(PrettyFname(objs[current].name)) $('.figcaption').show() } else @@ -157,7 +157,7 @@ function ViewImageOrVideo() $('#video_div').hide() if( $('#fname_toggle').prop('checked' ) ) $('#img-cap').show() - $('#fname_i').html(objs[current].name) + $('#fname_i').html(PrettyFname(objs[current].name)) $('#figure').show() if( fullscreen ) $('#canvas').get(0).requestFullscreen() @@ -166,7 +166,7 @@ function ViewImageOrVideo() { $('#figure').hide() $('#video').prop('src', '../' + objs[current].url ) - $('#fname_v').html(objs[current].name) + $('#fname_v').html(PrettyFname(objs[current].name)) if( $('#fname_toggle').prop('checked' ) ) $('#img-cap').hide() ResizeVideo() diff --git a/templates/viewer.html b/templates/viewer.html index 197f5aa..8bbdd53 100644 --- a/templates/viewer.html +++ b/templates/viewer.html @@ -29,8 +29,8 @@ {% for id in objs %} e=new Object() - e.name = "{{objs[id].name|safe}}" e.url = "{{objs[id].FullPathOnFS()|safe}}" + e.name = e.url e.type = "{{objs[id].type.name}}" {% if objs[id].file_details.faces %} e.face_model="{{objs[id].file_details.faces[0].facefile_lnk.model_used}}" @@ -50,6 +50,29 @@ objs[{{id}}]=e {% endfor %} + + function PrettyFname(fname) + { + s='' + if( fname.indexOf( "static/Import" ) == 0 ) + { + s+='' + tmp_path=fname.replace("static/Import","" ) + } + if( fname.indexOf( "static/Storage" ) == 0 ) + { + s+='' + tmp_path=fname.replace("static/Storage","" ) + } + if( fname.indexOf( "static/Bin" ) == 0 ) + { + s+='' + tmp_path=fname.replace("static/Bin","" ) + } + s+=tmp_path+'' + return s + } + function CallViewListRoute(dir) { s='