Newer
Older
<!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( 'send_app_files', path = 'functions.js' ) }}"></script>
<link type="text/css" rel="stylesheet" href="{{ url_for( 'send_app_files', path = 'app.css' ) }}">
<link type="text/css" rel="stylesheet" href="{{ url_for( 'send_app_files', path = 'dropzone.css' ) }}">
<script type="text/javascript">
baseurl = "{{ baseurl }}";

Marco De Donno
committed
var password_local = decrypt( sessionStorage.getItem( "session_key" ), "{{ session_security_key }}" );
var nickname = decrypt( "{{ nickname }}", password_local );

Marco De Donno
committed
var update_nickname = function()
{
var nickname = encrypt( $( '#upload_nickname' ).val() || null, password_local );

Marco De Donno
committed
$.ajax( {
url: "{{ url_for( 'submission_update_nickname', id = upload_id ) }}",
dataType: 'json',
method: 'POST',
data: {

Marco De Donno
committed
}
} );
}

Marco De Donno
committed
<style type="text/css">
.icnml_next_buttons {
margin-top: 20px;
padding-left: 50px;
padding-right: 50px;
}
.icnml_next_button {
width: 100%;
margin-bottom: 5px;
}
</style>
</head>
<body class="icnml_main_layout">
{% include "header.html" %}
{% include "navigations/submitter.html" %}
<div class="icnml_content">
<form id="icnml_submission_form">
<div class="ui-widget-header ui-corner-top icnml_box_top">Submission form</div>
<div class="ui-widget-content ui-corner-bottom icnml_box_content">
<div class="icnml_box_fields">
<div style="text-align: right;">
<label for="upload_nickname">Submission nickname</label>
</div>
<div>
<input id="upload_nickname" name="upload_nickname" type="text" value="" />
</div>
<div style="text-align: right;">
<label for="email">Donor e-mail</label>
</div>
<div>
<input id="email" name="email" type="text" value="{{ email }}" readonly />
</div>
<div style="text-align: right;">
<label for="tenprint_card_front">Tenprint card(s)<br />fingers</label>
</div>
<div>
<div id="tenprint_card_front_dropzone" class="dropzone"></div>
</div>
<div style="text-align: right;">
<label for="tenprint_card_back">Tenprint card(s)<br />palms</label>
</div>
<div>
<div id="tenprint_card_back_dropzone" class="dropzone"></div>
</div>
<div style="text-align: right;">
<label for="latents_target">Latent(s)<br />target</label>
<div id="latents_target_dropzone" class="dropzone"></div>
</div>
<div style="text-align: right;">
<label for="latents_incidental">Latent(s)<br />incidental</label>
</div>
<div>
<div id="latents_incidental_dropzone" class="dropzone"></div>
<div id="icnml_sub_error" class="icnml_box_error"></div>
<div class="icnml_button icnml_next_buttons">
<a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only icnml_next_button" id="next_front_button" role="button" aria-disabled="false">
<span class="ui-button-text">Tenprint card(s)</span>
</a>
<br />
<a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only icnml_next_button" id="latent_target_button" role="button" aria-disabled="false">
<span class="ui-button-text">Latent(s) target</span>
</a>
<br />
<a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only icnml_next_button" id="latent_incidental_button" role="button" aria-disabled="false">
<span class="ui-button-text">Latent(s) incidental</span>
<script type="text/javascript">
Dropzone.autoDiscover = false;
function sleep( ms ) {
return new Promise( resolve => setTimeout( resolve, ms ) );
}
$( function()
{
new Dropzone(
"#tenprint_card_front_dropzone",
{
url: baseurl + "/upload",
timeout: 600000,
parallelUploads: 1,
params: {
'upload_type': 'tenprint_card_front',
'upload_id': upload_id
},
renameFile: function( file )
{
var newName = encrypt( file.name, password_local );
return newName;
}
}
)
.on( 'addedfile', function( file )
{
$( '#tenprint_card_front_dropzone > .dz-default.dz-message' ).remove();
} )
.on( "success", function( p ) {
var response = JSON.parse( p.xhr.response );
console.log( response );
} )
.on( "error", function( p )
{
console.log( p );
toastr.error( "Error" );
} );
} );
$( function()
{
new Dropzone(
"#tenprint_card_back_dropzone",
{
url: baseurl + "/upload",
timeout: 600000,

Marco De Donno
committed
parallelUploads: 1,
'upload_type': 'tenprint_card_back',
},
renameFile: function( file )
{
var newName = encrypt( file.name, password_local );
return newName;
}
}
)
.on( 'addedfile', function( file )
{
$( '#tenprint_card_back_dropzone > .dz-default.dz-message' ).remove();
} )
.on( "success", function( p ) {
var response = JSON.parse( p.xhr.response );
console.log( response );
} )
.on( "error", function( p )
{
console.log( p );
toastr.error( "Error" );
} );
} );
$( function()
{
new Dropzone(
"#latents_target_dropzone",
{
url: baseurl + "/upload",
timeout: 600000,
'upload_type': 'latent_target',
},
renameFile: function( file )
{
var newName = encrypt( file.name, password_local );
return newName;
}
}
)
.on( 'addedfile', function( file )
{
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
$( '#latents_target_dropzone > .dz-default.dz-message' ).remove();
} )
.on( "success", function( p ) {
var response = JSON.parse( p.xhr.response );
console.log( response );
} )
.on( "error", function( p )
{
console.log( p );
toastr.error( "Error" );
} );
} );
$( function()
{
new Dropzone(
"#latents_incidental_dropzone",
{
url: baseurl + "/upload",
timeout: 600000,
createImageThumbnails: false,
params: {
'upload_type': 'latent_incidental',
'upload_id': upload_id
},
renameFile: function( file )
{
var newName = encrypt( file.name, password_local );
return newName;
}
}
)
.on( 'addedfile', function( file )
{
$( '#latents_incidental_dropzone > .dz-default.dz-message' ).remove();
} )
.on( "success", function( p ) {
var response = JSON.parse( p.xhr.response );
console.log( response );
} )
.on( "error", function( p )
{
console.log( p );
toastr.error( "Error" );
} );
} );
$( '#upload_nickname' ).val( nickname );

Marco De Donno
committed
$( '#upload_nickname' ).on( 'change', update_nickname );

Marco De Donno
committed
$( '#next_front_button' ).on( 'click', function()
{
window.location = "{{ url_for( 'submission_tenprint_list', id = upload_id ) }}";

Marco De Donno
committed
} );
$( '#latent_target_button' ).on( 'click', function()
{
window.location = "{{ url_for( 'submission_latent_list', id = upload_id, ltype = 'target' ) }}";
} );
$( '#latent_incidental_button' ).on( 'click', function()

Marco De Donno
committed
{
window.location = "{{ url_for( 'submission_latent_list', id = upload_id, ltype = 'incidental' ) }}";

Marco De Donno
committed
} );
.addClass( 'activated' );
$( '<a />' )
.attr( 'href', "{{ url_for( 'submission_list' ) }}" )
.text( "Submissions" )
)
.append(
$( '<span />' ).text( ">" )
)
.append(
$( '<span />' ).text( nickname )
</script>
</body>
</html>