Skip to content
Snippets Groups Projects
Verified Commit 644d5ad2 authored by Marco De Donno's avatar Marco De Donno
Browse files

Merge branch 'feature/mark_list_delete_on_right_click' into develop

parents 5d4f1c93 a2153bc6
Branches
No related tags found
No related merge requests found
......@@ -68,6 +68,47 @@
{% endif %}
{% endfor %}
{% endfor %}
var delete_mark = function( file_uuid )
{
$( "<div />" )
.attr( "id", "delete_confirmation" )
.text( "Do you really want to delete this mark?" )
.dialog( {
title: "Confirm mark deletion",
modal: true,
buttons: {
"OK": function()
{
$.ajax( {
{% if admin %}
url: "{{ url_for( 'submission.admin_submission_mark_delete', submission_id = submission_id, mark_id = '<uuid>' ) }}".replace( "%3Cuuid%3E", file_uuid ),
{% else %}
url: "{{ url_for( 'submission.submission_mark_delete', submission_id = submission_id, mark_id = '<uuid>' ) }}".replace( "%3Cuuid%3E", file_uuid ),
{% endif %}
dataType: "json",
success: function( data )
{
$( "#delete_confirmation" ).remove();
$( "#mark_" + file_uuid ).remove();
},
error: function( data )
{
$( "#delete_confirmation" ).remove();
}
} );
},
"Cancel": function()
{
$( this ).dialog( "close" );
},
},
close: function()
{
$( this ).remove();
}
} );
}
</script>
<style type="text/css">
......@@ -124,6 +165,12 @@
{% endfor %}
{% endif %}
{% for file in files %}
$( "#mark_{{ file[ 'uuid' ] }}" ).on( "contextmenu", function(){
delete_mark( "{{ file[ 'uuid' ] }}" );
} );
{% endfor %}
// Information regarding the missing fields for each mark
_.forEach( mark_missing_informations, function( missing, uuid )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment