Skip to content
latent_list.html 4.48 KiB
Newer Older
Marco De Donno's avatar
Marco De Donno committed
<!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( 'send_app_files', path = 'functions.js' ) }}"></script>
Marco De Donno's avatar
Marco De Donno committed
        <link type="text/css" rel="stylesheet" href="{{ url_for( 'send_app_files', path = 'app.css' ) }}">
        
        <script type="text/javascript">
            baseurl = "{{ baseurl }}";
            var password_local = decrypt( sessionStorage.getItem( "session_key" ), "{{ session_security_key }}" );
            var nickname = decrypt( "{{ nickname }}", password_local );
            
            var latents_list = new Array();
            {% for file in files %}
            	latents_list.push( "{{ file[ 'uuid' ] }}" );
        	{% endfor %}
            
            update_search_result = function()
            {
            	var searched = $( '#search_bar' ).val();
            	
            	for( var i = 0; i < latents_list.length; i++ )
        		{
            		var uuid = latents_list[ i ];
            		var filename = $( '#latent_' + uuid + '_filename' ).text();
            		
            		if( filename.indexOf( searched ) >= 0 )
            		{
            			$( '#latent_' + uuid ).show();
         			} else {
         				$( '#latent_' + uuid ).hide();
         			}
        		}
            }
Marco De Donno's avatar
Marco De Donno committed
        </script>
        
        <style type="text/css">
            .icnml_lp_list {
                margin: 10px;
                display: grid;
                grid-gap: 10px;
                grid-template-columns: repeat( auto-fit, 320px );
Marco De Donno's avatar
Marco De Donno committed
            }
            .icnml_lp_list > div {
            .icnml_box_content {
                height: 300px;
            .icnml_img > a > img {
Marco De Donno's avatar
Marco De Donno committed
                display: block;
                width: auto;
                height: auto;
                max-width: 300px;
                max-height: 300px;
                margin: auto;
            .icnml_search_bar {
                margin-left: 10px;
                margin-bottom: 20px;
                width: 500px;
            }
Marco De Donno's avatar
Marco De Donno committed
        </style>
    </head>
    <body class="icnml_main_layout">
        {% include "header.html" %}
        {% include "navigations/submitter.html" %}
        
        <div class="icnml_content">
            <div class="icnml_search_bar">
                <input id="search_bar" placeholder="Search for a file..."/>
            </div>
            
            <div class="icnml_lp_list">
                {% for file in files %}
                    <div id="latent_{{ file[ 'uuid' ] }}">
                        <div class="ui-widget-header ui-corner-top icnml_box_top" id="latent_{{ file[ 'uuid' ] }}_filename">-</div>
                        <div class="ui-widget-content ui-corner-bottom icnml_box_content">
                            <div class="icnml_img">
                                <a id="edit_{{ file[ 'id' ] }}" href="{{ url_for( 'submission_latent', id = submission_id, lid = file[ 'uuid' ] ) }}">
                                    <img src="{{ url_for( 'image_file_serve', id = file[ 'uuid' ] ) }}">
Marco De Donno's avatar
Marco De Donno committed
                        </div>
                    </div>
                {% endfor %}
            </div>
Marco De Donno's avatar
Marco De Donno committed
        </div>
        <script type="text/javascript">
        	
        	$( '#search_bar' ).on( 'keyup', update_search_result );
        	$( '#search_bar' ).focus();
        	
        	//
        	
Marco De Donno's avatar
Marco De Donno committed
            $( '#icnml_navigation_updatedonor' )
Marco De Donno's avatar
Marco De Donno committed
    			.addClass( 'activated' );
            {% for file in files %}
            	$( "#latent_{{ file[ 'uuid' ] }}_filename" )
            		.text( decrypt( "{{ file[ 'filename' ] }}", password_local ) );
            {% endfor %}
            
            $( '#navloc' ).append(
        		$( '<a />' )
        			.attr( 'href', "{{ url_for( 'submission_list' ) }}" )
        			.text( "Submissions" )
    		)
    		.append(
        		$( '<span />' ).text( ">" )
    		)
    		.append(
    			$( '<a />' )
    				.attr( 'href', "{{ url_for( 'submission_update', id = submission_id ) }}" )
			.append(
        		$( '<span />' ).text( ">" )
			)
			.append(
        		$( '<span />' ).text( "Latents" )
			);
Marco De Donno's avatar
Marco De Donno committed
        </script>
    </body>
</html>