<!DOCTYPE html>
<html lang="en">
    <head>
        <title>ICNML</title>
        <meta name="description" content="International Close Non-Matches Library">
        
        {% autoescape false %}
            {{ app_files }}
        {% endautoescape %}
        
        <script type="text/javascript">
            baseurl = "{{ baseurl }}";
        </script>
    </head>
    <body class="icnml_main_layout">
        {% include "header.html" %}
        {% include navigation %}
        
        <div class="icnml_content">
            {% if candidate_list != None %}
                <div class="icnml_list_of_boxes">
                    {% for cnm in candidate_list %}
                        <div id="candidate_{{ cnm[ 'uuid' ] }}_outer">
                            <div class="ui-widget-header ui-corner-top icnml_box_top" id="candidate_{{ cnm[ 'uuid' ] }}_filename">{{ cnm[ 'uuid' ][ 0:18 ] }}</div>
                            <div class="ui-widget-content ui-corner-bottom icnml_box_content">
                                <div
                                    id="candidate_{{ cnm[ 'uuid' ] }}"
                                    class="icnml_pointer"
                                    style="background-image: url( {{ url_for( 'afis.image_auto_detect_format', cnm_uuid = cnm[ 'uuid' ], file_uuid = cnm[ 'file_uuid' ] or 'None', fpc = 0 ) }} )">
                                </div>
                            </div>
                        </div>
                    {% endfor %}
                </div>
            {% else %}
                <div>No CNM candidate at the moment</div>
            {% endif %}
        </div>
        <script type="text/javascript">
            {% if candidate_list != None and admin %}
                {% for cnm in candidate_list %}
                    $( "#candidate_{{ cnm[ 'uuid' ] }}_outer" ).on( "click", function()
                    {
                        window.location = "{{ url_for( 'afis.admin_cnm_edit', target_uuid = cnm[ 'target_uuid' ], cnm_uuid = cnm[ 'uuid' ] ) }}"
                    } );
                {% endfor %}
            {% endif %}
            
            $( "#icnml_navigation_cnm_list_all" )
                .addClass( "activated" );
            
            $( "#navloc" ).append(
                $( "<span />" ).text( "CNM Candidate full list" )
            )
        </script>
    </body>
</html>

