Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!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' ) }}">
<style type="text/css">
#img_preview > img {
max-height:500px;
max-width:500px;
height:auto;
width:auto;
}
.icnml_button {
margin-top: 50px;
}
.icnml_button > div > a {
width: 60%;
margin-bottom: 10px;
}
#location_img {
background-image: url( '{{ url_for( 'send_static_files', path = 'location/main.png' ) }}' );
background-repeat: no-repeat;
background-size: 100%;
}
#location_img > img {
height: 500px;
width: auto;
}
.icnml_lp_cardbox {
display: grid;
grid-template-columns: auto auto;
grid-gap: 30px;
}
</style>
<script type="text/javascript">
baseurl = "{{ baseurl }}";
current_pfsp = "{{ current_pfsp }}";
var password_local = decrypt( sessionStorage.getItem( "session_key" ), "{{ session_security_key }}" );
var nickname = decrypt( "{{ nickname }}", password_local );
var filename = decrypt( "{{ file[ 'filename' ] }}", password_local );
var note = decrypt( "{{ file[ 'note' ] }}", password_local );
var updateMapCoordinates = function( data, fac )
{
data.children( 'area' ).each( function( i )
{
$( this )[ 0 ].coords = $( this )[ 0 ].coords
.split( ',' )
.map( x => x * fac )
.join( ',' );
} );
}
var updateSelection = function( data )
{
var location_base_url = "{{ url_for( 'send_static_files', path = 'location' ) }}";
var d = [ 'main' ]
.concat( data )
.map( x => 'url( ' + location_base_url + '/' + x + '.png )' )
.join( ', ' );
$( '#location_img' )
.css( 'background-image', d );
}
var update_pfsp_db = function( data )
{
$.ajax( {
url: "{{ url_for( 'submission_latent_pfsp_set', id = submission_id, lid = file[ 'uuid' ] ) }}",
dataType: 'json',
method: 'POST',
data: {
pfsp: data
},
error: function()
{
toastr.error( "Error while saving the location data" );
}
} );
}
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
</script>
</head>
<body class="icnml_main_layout">
{% include "header.html" %}
{% include "navigations/submitter.html" %}
<div class="icnml_content">
<div class="icnml_lp_oneperpage">
<form id="icnml_file_update_{{ file[ 'uuid' ] }}">
<div class="ui-widget-header ui-corner-top icnml_box_top">File '<span id="header_filename">-</span>'</div>
<div class="ui-widget-content ui-corner-bottom icnml_box_content">
<div class="icnml_lp_cardbox">
<div id="img_preview" class="icnml_img">
<img src="{{ url_for( 'image_file_serve', id = file[ 'uuid' ] ) }}">
</div>
<div>
<div id="pfsp">
<div id="location_img">
<img src="{{ url_for( 'send_static_files', path = 'location/empty.png' ) }}" usemap="#location_map" />
</div>
<map id="Map" name="location_map" class="location_map">
{% for zone in pfsp_zones %}
<area
shape="polygon"
id="area_{{ zone[ 'sel' ] | join( '_' ) }}"
coords="{{ zone[ 'coords' ] }}"
data-selection="{{ zone[ 'sel' ] | join( ',' ) }}"
data-desc="{{ zone[ 'desc' ] }}"
data-zone="{{ zone[ 'zone' ] }}"
data-lat="{{ zone[ 'lat' ] }}"
/>
{% endfor %}
</map>
</div>
<div class="icnml_button">
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</body>
<script type="text/javascript">
$( '#header_filename' ).text( filename );
$( '#box_filename' ).text( filename );
// Action for the PFSP zones
updateMapCoordinates( $( "#Map" ), 500 / 656 );
var current_pfsp = "{{ current_pfsp }}".split( "," );
areas.push( "#area_{{ zone[ 'sel' ] | join( '_' ) }}" );
{% endfor %}
for( var i = 0; i < areas.length; i++ )
{
$( areas[ i ] )
.mouseover( function()
{
var s = $( this )[ 0 ].dataset.selection.split( ',' );
updateSelection( s );
} )
.mouseout( function()
{
updateSelection( current_pfsp );
} )
.on( 'click', function()
{
var d = $( this )[ 0 ].dataset.desc;
var s = $( this )[ 0 ].dataset.selection.split( ',' );
update_pfsp_db( d );
current_pfsp = s;
updateSelection( current_pfsp );
updateSelection( current_pfsp );
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
//
$( '#icnml_navigation_updatedonor' )
.addClass( 'activated' );
$( '#navloc' ).append(
$( '<a />' )
.attr( 'href', "{{ url_for( 'submission_list' ) }}" )
.text( "Submissions" )
)
.append(
$( '<span />' ).text( ">" )
)
.append(
$( '<a />' )
.attr( 'href', "{{ url_for( 'submission_update', id = submission_id ) }}" )
.text( nickname )
)
.append(
$( '<span />' ).text( ">" )
)
.append(
$( '<a />' )
.attr( 'href', "{{ url_for( 'submission_latent_list', id = submission_id ) }}" )
.text( "Latents" )
)
.append(
$( '<span />' ).text( ">" )
)
.append(
$( '<span />' ).text( filename )
);
</script>
</html>