Skip to content
submission_table.html 3.08 KiB
Newer Older
<!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>
            #submissions_list > table {
                width: 100%;
            }
            tr:nth-child( even ) {
                background: rgb( 200, 200, 200 );
            }
            tr:nth-child( odd ) {
                background: rgb( 222, 222, 222 );
            }
        </style>

        <script type="text/javascript">
            baseurl = "{{ baseurl }}";
            
            var files_type_counts = {};
            {% for donor in donors %}
                files_type_counts[ "{{ donor[ 'uuid' ] }}" ] = {};
            {% endfor %}
            {% for c in counts %}
                files_type_counts[ "{{ c[ 'uuid' ] }}" ][ "{{ c[ 'name' ] }}" ] = "{{ c[ 'nb' ] }}";
            {% endfor %}
            {% for s in segments %}
                files_type_counts[ "{{ s[ 'uuid' ] }}" ][ "segments" ] = "{{ s[ 'nb' ] }}";
            {% endfor %}
        </script>
    </head>
    <body class="icnml_main_layout">
        {% include "header.html" %}
        {% include navigation %}
        
        <div class="icnml_content">
            <div id="submissions_list">
                <table>
                    <tr>
                        <th>Donor</th>
                        <th>UUID</th>
                        <th>Marks</th>
                        <th>TP finger</th>
                        <th>TP palms</th>
                        <th>Segments</th>
                    </tr>
                    {% for donor in donors %}
                        <tr>
                            <td>{{ donor[ 'username' ] }}</td>
                            <td>{{ donor[ 'uuid' ] }}</td>
                            {% for c in [ 'mark_target', 'tenprint_card_front', 'tenprint_card_back', 'segments' ] %}
                                <td><span id="c_{{ donor[ 'uuid' ] }}_{{ c }}"></span></td>
                            {% endfor %}
                        </tr>
                    {% endfor %}
                </table>
            </div>
        </div>
        
        <script type="text/javascript">
            {% for donor in donors %}
                {% for c in [ 'mark_target', 'tenprint_card_front', 'tenprint_card_back', 'segments' ] %}
                    $( "#c_{{ donor[ 'uuid' ] }}_{{ c }}" ).text( files_type_counts[ "{{ donor[ 'uuid' ] }}" ][ "{{ c }}" ] );
                {% endfor %}
            {% endfor %}
            
            $( "#icnml_navigation_adminsubmissionstable" )
                .addClass( "activated" );
            
            $( "#navloc" ).append(
                $( "<span />" ).text( "Submissions" )
            );
        </script>
    </body>
</html>