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
3a26d4b2
Commit
3a26d4b2
authored
3 years ago
by
Marco De Donno
Browse files
Options
Downloads
Patches
Plain Diff
Add the 'download full resolution' button for admin in the mark display page
parent
6804f9a0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
views/images/__init__.py
+21
-0
21 additions, 0 deletions
views/images/__init__.py
views/submission/templates/submission/shared/mark.html
+17
-0
17 additions, 0 deletions
views/submission/templates/submission/shared/mark.html
with
38 additions
and
0 deletions
views/images/__init__.py
+
21
−
0
View file @
3a26d4b2
...
...
@@ -74,6 +74,27 @@ def image_file_serve( file_id = None ):
current_app
.
logger
.
error
(
"
Error while creating the thumbnail. Serving a
'
no preview
'
image
"
)
return
send_file
(
no_preview_image
(),
mimetype
=
"
image/png
"
)
@image_view.route
(
"
/image/file/<file_id>/full_resolution
"
)
@utils.decorator.admin_required
def
admin_download_file_full_resolution
(
file_id
):
try
:
if
file_id
==
None
:
raise
Exception
(
"
No file id
"
)
submission_id
=
get_submission_uuid_for_file
(
file_id
)
current_app
.
logger
.
debug
(
"
submission id:
'
{}
'"
.
format
(
submission_id
)
)
img
,
_
=
image_serve
(
"
files
"
,
file_id
,
submission_id
)
if
img
==
None
:
return
abort
(
404
)
buff
=
utils
.
images
.
pil2buffer
(
img
,
"
TIFF
"
)
return
send_file
(
buff
,
mimetype
=
"
image/tiff
"
)
except
:
return
abort
(
403
)
@image_view.route
(
"
/image/segment/<tenprint_id>/<pc>
"
)
@utils.decorator.login_required
def
image_segment_serve
(
tenprint_id
,
pc
):
...
...
This diff is collapsed.
Click to expand it.
views/submission/templates/submission/shared/mark.html
+
17
−
0
View file @
3a26d4b2
...
...
@@ -128,6 +128,13 @@
}
);
}
{
%
if
admin
%
}
var
download_image
=
function
()
{
window
.
open
(
"
{{ url_for( 'image.admin_download_file_full_resolution', file_id = file[ 'uuid' ] ) }}
"
,
"
_blank
"
);
}
{
%
endif
%
}
var
next_information
=
function
()
{
{
%
if
admin
%
}
...
...
@@ -290,6 +297,13 @@
</div>
<div>
<div
class=
"icnml_button"
>
{% if admin %}
<div
id=
"download_full_res_button_div"
>
<a
class=
"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
id=
"download_button"
>
<span
class=
"ui-button-text"
id=
"next_button_span_text"
>
Download image
</span>
</a>
</div>
{% endif %}
<div
id=
"next_button_div"
>
<a
class=
"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
id=
"next_button"
>
<span
class=
"ui-button-text"
id=
"next_button_span_text"
>
Next
</span>
...
...
@@ -320,6 +334,9 @@
$
(
"
#file_{{ file[ 'uuid' ] }}_uploadtime
"
)
.
text
(
moment
.
utc
(
"
{{ file[ 'creation_time' ] }}
"
).
local
().
format
(
"
MMMM Do YYYY, HH:mm:ss
"
)
);
{
%
if
admin
%
}
$
(
"
#download_button
"
).
on
(
"
click
"
,
download_image
);
{
%
endif
%
}
$
(
"
#next_button
"
).
on
(
"
click
"
,
next_information
);
$
(
"
#delete_button
"
).
on
(
"
click
"
,
delete_mark
);
...
...
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