Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
web app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICNML
web app
Commits
74aca334
Commit
74aca334
authored
4 years ago
by
Marco De Donno
Browse files
Options
Downloads
Patches
Plain Diff
Add the list of segments to search in the user view
parent
e94d9607
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
views/afis/__init__.py
+34
-1
34 additions, 1 deletion
views/afis/__init__.py
views/afis/templates/afis/folder_list.html
+75
-0
75 additions, 0 deletions
views/afis/templates/afis/folder_list.html
with
109 additions
and
1 deletion
views/afis/__init__.py
+
34
−
1
View file @
74aca334
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from
flask
import
Blueprint
from
flask
import
Blueprint
,
session
import
config
from
utils.decorator
import
login_required
from
utils.template
import
my_render_template
afis_view
=
Blueprint
(
"
afis
"
,
__name__
,
template_folder
=
"
templates
"
)
...
...
@@ -9,3 +13,32 @@ afis_view = Blueprint( "afis", __name__, template_folder = "templates" )
def
admin_list_folders
():
return
"
ok
"
@afis_view.route
(
"
/afis/list
"
)
@login_required
def
list_folders
():
user_id
=
session
.
get
(
"
user_id
"
,
None
)
sql
=
"""
SELECT
cnm_assignment.folder_uuid,
tmp.*
FROM cnm_assignment
LEFT JOIN cnm_folder ON cnm_assignment.folder_uuid = cnm_folder.folder_uuid
LEFT JOIN (
SELECT DISTINCT ON ( donor_id, pc ) *
FROM donor_segments_v
) AS tmp ON cnm_folder.donor_id = tmp.donor_id AND cnm_folder.pc = tmp.pc
WHERE cnm_assignment.user_id = %s
ORDER BY
tmp.donor_id ASC,
tmp.pc ASC
"""
folder_list
=
config
.
db
.
query_fetchall
(
sql
,
(
user_id
,
)
)
return
my_render_template
(
"
afis/folder_list.html
"
,
folder_list
=
folder_list
)
This diff is collapsed.
Click to expand it.
views/afis/templates/afis/folder_list.html
0 → 100644
+
75
−
0
View file @
74aca334
<!DOCTYPE html>
<html>
<head>
{% for src in js %}
<script
type=
"text/javascript"
src=
"{{ src }}"
></script>
{% endfor %}
{% for src in css %}
<link
type=
"text/css"
rel=
"stylesheet"
href=
"{{ src }}"
>
{% endfor %}
<script
type=
"text/javascript"
src=
"{{ url_for( 'files.send_app_files', subpath = 'functions.js' ) }}"
></script>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"{{ url_for( 'files.send_app_files', subpath = 'app.css' ) }}"
>
<script
type=
"text/javascript"
>
baseurl
=
"
{{ baseurl }}
"
;
</script>
<style
type=
"text/css"
>
.icnml_list_of_boxes
{
grid-template-columns
:
repeat
(
auto-fill
,
calc
(
var
(
--imgsize
)
+
2
*
var
(
--imgmargin
)
)
);
}
.icnml_search_bar
{
margin-left
:
10px
;
margin-bottom
:
20px
;
width
:
500px
;
}
</style>
</head>
<body
class=
"icnml_main_layout"
>
{% include "header.html" %}
{% include navigation %}
<div
class=
"icnml_content"
>
<div
class=
"icnml_search_bar"
>
<input
id=
"search_bar"
placeholder=
"Search for a file..."
/>
</div>
<div
class=
"icnml_list_of_boxes"
>
{% for f in folder_list %}
<div
id=
"segment_{{ f[ 'folder_uuid' ] }}_outer"
>
<div
class=
"ui-widget-header ui-corner-top icnml_box_top"
id=
"segment_{{ f[ 'uuid' ] }}_filename"
>
{{ f[ 'folder_uuid' ][ 0:18 ] }}
</div>
<div
class=
"ui-widget-content ui-corner-bottom icnml_box_content"
>
<div
id=
"segment_{{ f[ 'folder_uuid' ] }}"
class=
"icnml_pointer"
style=
"background-image: url( {{ url_for( 'image.image_segment_serve', tenprint_id = f[ 'tenprint' ], pc = f[ 'pc' ] ) }} )"
>
</div>
</div>
</div>
{% endfor %}
</div>
<div
id=
"zoom_slider"
></div>
</div>
<script
type=
"text/javascript"
>
$
(
"
#icnml_navigation_afis
"
)
.
addClass
(
"
activated
"
);
$
(
"
#navloc
"
).
append
(
$
(
"
<a />
"
)
.
attr
(
"
href
"
,
"
{{ url_for( 'afis.list_folders' ) }}
"
)
.
text
(
"
AFIS folders
"
)
)
.
append
(
$
(
"
<span />
"
).
text
(
"
>
"
)
)
.
append
(
$
(
"
<span />
"
).
text
(
"
All
"
)
)
$
(
"
#search_bar
"
).
focus
();
</script>
</body>
</html>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment