Skip to content
GitLab
Explore
Sign in
Commits on Source (4)
Change the "finger" label to "segment" on the tenprint edit page
· b979cef2
Marco De Donno
authored
Dec 24, 2019
b979cef2
Refactoring of the next_fpc() function on the tenprint edit page
· 6129c808
Marco De Donno
authored
Dec 24, 2019
6129c808
Remove the move_text text if the value is null
· 4599d84c
Marco De Donno
authored
Dec 24, 2019
4599d84c
Patch the admin tenprint list navigation bar
· fd9e5ef7
Marco De Donno
authored
Dec 24, 2019
fd9e5ef7
Hide whitespace changes
Inline
Side-by-side
views/submission/__init__.py
View file @
fd9e5ef7
...
@@ -1462,22 +1462,24 @@ def admin_tenprint_list( submission_id = "all" ):
...
@@ -1462,22 +1462,24 @@ def admin_tenprint_list( submission_id = "all" ):
if
submission_id
!=
"
all
"
:
if
submission_id
!=
"
all
"
:
sql
=
"""
sql
=
"""
SELECT users.username
SELECT users.username
, submissions.uuid
FROM submissions
FROM submissions
LEFT JOIN users ON submissions.donor_id = users.id
LEFT JOIN users ON submissions.donor_id = users.id
WHERE submissions.uuid = %s
WHERE submissions.uuid = %s
"""
"""
selector
=
config
.
db
.
query_fetchone
(
sql
,
(
submission_id
,
)
)
[
"
username
"
]
selector
,
submission_uuid
=
config
.
db
.
query_fetchone
(
sql
,
(
submission_id
,
)
)
else
:
else
:
selector
=
"
all
"
selector
=
"
all
"
submission_uuid
=
None
current_app
.
logger
.
info
(
"
{} tenprints cards found
"
.
format
(
len
(
tenprint_cards
)
)
)
current_app
.
logger
.
info
(
"
{} tenprints cards found
"
.
format
(
len
(
tenprint_cards
)
)
)
return
my_render_template
(
return
my_render_template
(
"
admin/tenprint_list.html
"
,
"
admin/tenprint_list.html
"
,
tenprint_cards
=
tenprint_cards
,
tenprint_cards
=
tenprint_cards
,
selector
=
selector
selector
=
selector
,
submission_uuid
=
submission_uuid
)
)
@submission_view.route
(
"
/admin/<submission_id>/tenprint/<tenprint_id>
"
)
@submission_view.route
(
"
/admin/<submission_id>/tenprint/<tenprint_id>
"
)
...
...
views/submission/templates/admin/tenprint_list.html
View file @
fd9e5ef7
...
@@ -66,7 +66,13 @@
...
@@ -66,7 +66,13 @@
$
(
"
<span />
"
).
text
(
"
>
"
)
$
(
"
<span />
"
).
text
(
"
>
"
)
)
)
.
append
(
.
append
(
$
(
"
<span />
"
).
text
(
"
{{ selector }}
"
)
{
%
if
submission_uuid
!=
null
%
}
$
(
"
<a />
"
)
.
attr
(
"
href
"
,
"
{{ url_for( 'submission.admin_submission_home', submission_id = submission_uuid ) }}
"
)
.
text
(
"
{{ selector }}
"
)
{
%
else
%
}
$
(
"
<span />
"
).
text
(
"
{{ selector }}
"
)
{
%
endif
%
}
)
)
.
append
(
.
append
(
$
(
"
<span />
"
).
text
(
"
>
"
)
$
(
"
<span />
"
).
text
(
"
>
"
)
...
...
views/submission/templates/shared/tenprint.html
View file @
fd9e5ef7
...
@@ -379,19 +379,20 @@
...
@@ -379,19 +379,20 @@
var
next_fpc
=
function
()
var
next_fpc
=
function
()
{
{
current_fpc
=
null
;
current_fpc_pointer
+=
1
;
current_fpc_pointer
+=
1
;
if
(
current_fpc_pointer
>=
to_annotate
.
length
)
while
(
current_fpc_pointer
<
to_annotate
.
length
)
{
{
current_fpc
=
null
;
if
(
$
(
"
#segment_fpc_
"
+
to_annotate
[
current_fpc_pointer
]
).
length
===
0
)
}
else
{
while
(
$
(
"
#segment_fpc_
"
+
to_annotate
[
current_fpc_pointer
]
).
length
===
1
)
{
{
return
next_fpc
();
current_fpc
=
to_annotate
[
current_fpc_pointer
];
break
;
}
}
current_fpc
=
to_annotate
[
current_fpc_pointer
]
;
current_fpc_pointer
+=
1
;
}
}
move_text
=
current_fpc
;
move_text
=
current_fpc
;
}
}
...
@@ -611,7 +612,10 @@
...
@@ -611,7 +612,10 @@
$
(
"
#move_text
"
)
$
(
"
#move_text
"
)
.
attr
(
"
x
"
,
event
.
offsetX
+
10
)
.
attr
(
"
x
"
,
event
.
offsetX
+
10
)
.
attr
(
"
y
"
,
event
.
offsetY
-
10
)
.
attr
(
"
y
"
,
event
.
offsetY
-
10
)
.
text
(
"
finger
"
+
move_text
+
"
(
"
+
segments_position_code
[
move_text
]
+
"
)
"
)
.
text
(
"
segment
"
+
move_text
+
"
(
"
+
segments_position_code
[
move_text
]
+
"
)
"
)
}
else
{
$
(
"
#move_text
"
)
.
text
(
""
)
}
}
}
}
...
@@ -792,7 +796,7 @@
...
@@ -792,7 +796,7 @@
.
attr
(
"
x
"
,
x
)
.
attr
(
"
x
"
,
x
)
.
attr
(
"
y
"
,
y
-
5
)
.
attr
(
"
y
"
,
y
-
5
)
.
attr
(
"
fill
"
,
colour
)
.
attr
(
"
fill
"
,
colour
)
.
text
(
"
finger
"
+
fpc
)
.
text
(
"
segment
"
+
fpc
+
"
(
"
+
segments_position_code
[
fpc
]
+
"
)
"
)
.
appendTo
(
svggroup
);
.
appendTo
(
svggroup
);
return
svggroup
;
return
svggroup
;
...
...