<!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( 'files.send_app_files', subpath = 'functions.js' ) }}"></script>
        <link type="text/css" rel="stylesheet" href="{{ url_for( 'files.send_app_files', subpath = 'app.css' ) }}">
        
        <style type="text/css">
            .icnml_submission_form {
                width: fit-content;
                width: -moz-fit-content;
                margin-top: 30px;
                margin-left: auto;
                margin-right: auto;
            }
            .icnml_buttons_list {
                display: grid;
                grid-template-columns: repeat( 3, 1fr );
                grid-gap: 10px;
                margin: 20px;
            }
            .icnml_button {
                height: 120px;
                width: 120px;
                padding: 0px;
            }
            .icnml_button > span {
                height: 120px;
                width: 120px;
                line-height: 120px;
                vertical-align: center;
                text-align: center;
            }
        </style>
        
        <script type="text/javascript">
            baseurl = "{{ baseurl }}";
            submission_id = "{{ submission_id }}";
        </script>
    </head>
    <body class="icnml_main_layout">
        {% include "header.html" %}
        {% include navigation %}
        
        <div class="icnml_content">
            <div class="icnml_submission_form">
                <div class="ui-widget-header ui-corner-top icnml_box_top">{{ donor[ 'username' ] }}</div>
                <div class="ui-widget-content ui-corner-bottom">
                    <div class="icnml_buttons_list">
                        <div class="icnml_button">
                            <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only icnml_button" id="gp_button" role="button" aria-disabled="false">
                                <span>General pattern</span>
                            </a>
                        </div>
                        <div class="icnml_button">
                            <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only icnml_button" id="tp_button" role="button" aria-disabled="false">
                                <span>Tenprint(s)</span>
                            </a>
                        </div>
                        <div class="icnml_button">
                            <a class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only icnml_button" id="lt_button" role="button" aria-disabled="false">
                                <span>Mark(s)</span>
                            </a>
                        </div>
                    </div>
                    <input id="donor_uuid" size="52" style="text-align: center; border: none; margin-bottom: 10px" class="icnml_pointer" value="{{ donor[ 'uuid' ] }}"/>
                </div>
            </div>
        </div>
        
        <script type="text/javascript">
            $( "#gp_button" ).on( "click", function()
            {
                window.location = "{{ url_for( 'submission.admin_submission_gp', submission_id = donor[ 'uuid' ] ) }}";
            } );
            $( "#tp_button" ).on( "click", function()
            {
                window.location = "{{ url_for( 'submission.admin_tenprint_list', submission_id = donor[ 'uuid' ] ) }}";
            } );
            
            $( "#lt_button" ).on( "click", function()
            {
                window.location = "{{ url_for( 'submission.admin_submission_mark_list', submission_id = donor[ 'uuid' ] ) }}";
            } );
            
            $( "#donor_uuid" ).on( "click", function()
            {
                $( "#donor_uuid" ).select();
                document.execCommand( "copy" );
                $( "#donor_uuid" ).blur();
                toastr.info( "UUID copied to clipboard" );
            } );
            
            $( "#icnml_navigation_submissions" )
                .addClass( "activated" );
            
            $( "#navloc" ).append(
                $( "<a />" )
                    .attr( "href", "{{ url_for( 'submission.admin_submission_list' ) }}" )
                    .text( "Submissions" )
            )
            .append(
                $( "<span />" ).text( ">" )
            )
            .append(
                $( "<span />" ).text( "{{ donor[ 'username' ] }}" )
            );
        </script>
    </body>
</html>

