Skip to content
Commits on Source (2)
...@@ -170,6 +170,19 @@ def get_annotation_list_for_target_folder( uuid, admin = True ): ...@@ -170,6 +170,19 @@ def get_annotation_list_for_target_folder( uuid, admin = True ):
""" """
return config.db.query_fetchall( sql, ( uuid, ) ) return config.db.query_fetchall( sql, ( uuid, ) )
def get_target_folder_details( uuid ):
sql = """
SELECT
submissions.uuid,
cnm_folder.pc,
users.username
FROM cnm_folder
INNER JOIN submissions ON cnm_folder.donor_id = submissions.donor_id
INNER JOIN users ON cnm_folder.donor_id = users.id
WHERE cnm_folder.uuid = %s
"""
return config.db.query_fetchone( sql, ( uuid, ) )
def show_folder_inner( uuid, admin ): def show_folder_inner( uuid, admin ):
""" """
This function get all the data related to particular target This function get all the data related to particular target
...@@ -188,17 +201,11 @@ def show_folder_inner( uuid, admin ): ...@@ -188,17 +201,11 @@ def show_folder_inner( uuid, admin ):
marks_list = get_marks_list_for_target_folder( uuid, admin ) marks_list = get_marks_list_for_target_folder( uuid, admin )
# Generic information # Generic information
sql = """ details = get_target_folder_details( uuid )
SELECT submission_id = details[ "uuid" ]
submissions.uuid, pc = details[ "pc" ]
cnm_folder.pc, username = details[ "username" ]
users.username
FROM cnm_folder
INNER JOIN submissions ON cnm_folder.donor_id = submissions.donor_id
INNER JOIN users ON cnm_folder.donor_id = users.id
WHERE cnm_folder.uuid = %s
"""
submission_id, pc, username = config.db.query_fetchone( sql, ( uuid, ) )
finger_name = "{} (F{})".format( segments_position_code[ pc ], pc ) finger_name = "{} (F{})".format( segments_position_code[ pc ], pc )
# User assignments # User assignments
...@@ -502,6 +509,14 @@ def cnm_edit_inner( target_uuid, cnm_uuid, admin ): ...@@ -502,6 +509,14 @@ def cnm_edit_inner( target_uuid, cnm_uuid, admin ):
sql = "SELECT * FROM cnm_result_quality" sql = "SELECT * FROM cnm_result_quality"
all_qualities = config.db.query_fetchall( sql ) all_qualities = config.db.query_fetchall( sql )
# Generic information for the target and donor
details = get_target_folder_details( target_uuid )
submission_uuid = details[ "uuid" ]
pc = details[ "pc" ]
username = details[ "username" ]
finger_name = "{} (F{})".format( segments_position_code[ pc ], pc )
#
return utils.template.my_render_template( return utils.template.my_render_template(
"afis/shared/cnm_edit.html", "afis/shared/cnm_edit.html",
target_uuid = target_uuid, target_uuid = target_uuid,
...@@ -511,6 +526,9 @@ def cnm_edit_inner( target_uuid, cnm_uuid, admin ): ...@@ -511,6 +526,9 @@ def cnm_edit_inner( target_uuid, cnm_uuid, admin ):
uploaded_screenshots = uploaded_screenshots, uploaded_screenshots = uploaded_screenshots,
all_qualities = all_qualities, all_qualities = all_qualities,
pfsp_zones = pfsp.zones, pfsp_zones = pfsp.zones,
submission_id = submission_uuid,
username = username,
finger_name = finger_name,
) )
@afis_view.route( "/afis/<target_uuid>/<cnm_uuid>/set_pfsp", methods = [ "POST" ] ) @afis_view.route( "/afis/<target_uuid>/<cnm_uuid>/set_pfsp", methods = [ "POST" ] )
......
...@@ -710,25 +710,63 @@ ...@@ -710,25 +710,63 @@
$( "#icnml_navigation_afis" ) $( "#icnml_navigation_afis" )
.addClass( "activated" ); .addClass( "activated" );
$( "#navloc" ).append( {% if admin %}
$( "<a />" ) $( "#navloc" ).append(
.attr( "href", "{{ url_for( 'afis.list_folders' ) }}" ) $( "<a />" )
.text( "AFIS targets" ) .attr( "href", "{{ url_for( 'submission.admin_submission_list' ) }}" )
) .text( "Submissions" )
.append( )
$( "<span />" ).text( ">" ) .append(
) $( "<span />" ).text( ">" )
.append( )
$( "<a />" ) .append(
.attr( "href", "{{ url_for( 'afis.show_folder', uuid = target_uuid ) }}" ) $( "<a />" )
.text( "{{ target_uuid[ 0:18 ] }}" ) .attr( "href", "{{ url_for( 'submission.admin_submission_home', submission_id = submission_id ) }}" )
) .text( "{{ username }}" )
.append( )
$( "<span />" ).text( ">" ) .append(
) $( "<span />" ).text( ">" )
.append( )
$( "<span />" ).text( cnm_nickname_navbar ) .append(
) $( "<a />" )
.attr( "href", "{{ url_for( 'afis.admin_show_target_list', uuid = submission_id ) }}" )
.text( "Targets" )
)
.append(
$( "<span />" ).text( ">" )
)
.append(
$( "<a />" )
.attr( "href", "{{ url_for( 'afis.admin_show_target', uuid = target_uuid ) }}" )
.text( "{{ finger_name }}" )
)
.append(
$( "<span />" ).text( ">" )
)
.append(
$( "<span />" ).text( cnm_nickname_navbar )
)
{% else %}
$( "#navloc" ).append(
$( "<a />" )
.attr( "href", "{{ url_for( 'afis.list_folders' ) }}" )
.text( "AFIS targets" )
)
.append(
$( "<span />" ).text( ">" )
)
.append(
$( "<a />" )
.attr( "href", "{{ url_for( 'afis.show_folder', uuid = target_uuid ) }}" )
.text( "{{ target_uuid[ 0:18 ] }}" )
)
.append(
$( "<span />" ).text( ">" )
)
.append(
$( "<span />" ).text( cnm_nickname_navbar )
)
{% endif %}
</script> </script>
</body> </body>
</html> </html>
......