<commit_before>

<?php

//echo $ajax->remoteTimer( 
//    array( 
//    'url' => array( 'controller' => 'logs', 'action' => 'index'), 
//    'update' => 'test', 'frequency' => 10
//    )
//);
?>
 <div id='logsFormAdd' align='right' >
    <a><img id="closeNewLog" style="display:none" src="<?php echo $base; ?>/img/blue-document--minus.png" alt="close new log" class="NewLog_icons"></a>
    <a><img id="addNewLog" src="<?php echo $base; ?>/img/blue-document--plus.png" alt="add new log" class="NewLog_icons"></a>
 </div>
    
<?php echo $this->Html->script('addUpload.js'); ?>
<?php //echo $this->Html->link(__('Configure application', true), array('controller' => 'searches', 'action' => 'search')); ?>
<div class="logs index">
    <div id="logForm" class="logs form" style="display: none" >
       
        
        <?php echo $this->Form->create('log', array('type' => 'file', 'action' => 'add')); ?>
        <fieldset id='logFormFieldset'>
            <legend><?php __('Add a New Log'); ?></legend>
            <div id='logFormCredentials'>
                <?php if (!$session->check('Auth.User.name')) {
                ?>
                    <div id='logFormUsername'><?php echo $this->Form->input('username', array('label' => 'Username')); ?></div>
                    <div id='logFormPassword'><?php echo $this->Form->input('password', array('label' => 'Password')); ?></div>
                <?php } ?>
            </div>
            <div id='logFormContainer'>

                <div id='logFormInfo'>
                    
                    <?php echo $this->Form->input('subject', array('type' => 'hidden')); ?>
                    <div id='logFormDescription' style="resize: none">
                        <?php echo $this->Form->input('description', array('type' => 'textarea', 'rows' => '15')); ?>
                    </div>
                </div>
                <div id='logFormSelects'>
                    <div id='logFormLevels'><?php echo $this->Form->input('level'); ?></div>
                    <div id='logFormLogbooks'><?php echo $this->Form->input('logbooks', array('type' => 'select', 'multiple' => true)); ?></div>
                    <div id='logFormTags'><?php echo $this->Form->input('tags', array('type' => 'select', 'multiple' => true)); ?></div>
                    <div id='logFormSubmit'>
                        <?php echo $this->Form->end(__('Submit', true)); ?>
                    </div>
                </div>
            </div>
	    <div style="display:none" class="addFiles" id="fileupload_<?php //echo $log['id']; ?>">
		<form action="<?php echo $base; ?>/olog/uploads/index/id:<?php //echo $log['id']; ?>" method="POST" enctype="multipart/form-data">
		    <label class="fileinput-button">
			<span>Add files</span>
			<input type="hidden" name="id" value="<?php //echo $log['id']; ?>" />
			<input type="file" name="file" multiple>
		    </label>
		</form>
		<div class="fileupload-content">
		    <table class="files"></table>
		    <div class="fileupload-progressbar"></div>
		    <script id="template-upload" type="text/x-jquery-tmpl">
			<tr class="template-upload{{if error}} ui-state-error{{/if}}">
			    <td class="preview"></td>
			    <td class="name">${name}</td>
			    <td class="size">${sizef}</td>
			    {{if error}}
				<td class="error" colspan="2">Error:
				{{if error === 'maxFileSize'}}File is too big
				{{else error === 'minFileSize'}}File is too small
				{{else error === 'acceptFileTypes'}}Filetype not allowed
				{{else error === 'maxNumberOfFiles'}}Max number of files exceeded
				{{else}}${error}
				{{/if}}
				</td>
			    {{else}}
				<td class="progress"><div></div></td>
				<td class="start"><button>Start</button></td>
			    {{/if}}
			    <td class="cancel"><button>Cancel</button></td>
			</tr>
		    </script>
		</div>
	    </div>
        </fieldset>
    </div>

    <script type="text/javascript" >
    $('#addNewLog').click(function() {
	$('#logForm').show('fast');
	$('#addNewLog').hide();
	$('#closeNewLog').show();
    });
    $('#closeNewLog').click(function() {
	$('#logForm').hide();
	$('#closeNewLog').hide();
	$('#addNewLog').show();
    });
    
    $(document).ready(function() {
	$("input[type=file]").filestyle({ 
	    image: "<?php echo $base; ?>/img/image--plus.png",
	    imageheight : 16,
	    imagewidth : 16,
	    width : 16,
	    showFilename : false
	});
    });
    </script>
    
    <div id="logviews">
        <?php // Todo:  toggle, when Threaded selected, display collapse/expand  ?>
        <?php //echo $this->Html->link(__('Full', true), array('action' => 'add')) . ' | '; ?>
        <?php //echo $this->Html->link(__('Summary', true), array('action' => 'add')) . ' | '; ?>
        <?php //echo $this->Html->link(__('Threaded', true), array('action' => 'threaded')); ?>

                    <span id="quickfilters">
            <?php<commit_msg>double submit & empty submission<commit_after>

<?php

//echo $ajax->remoteTimer( 
//    array( 
//    'url' => array( 'controller' => 'logs', 'action' => 'index'), 
//    'update' => 'test', 'frequency' => 10
//    )
//);
?>
 <div id='logsFormAdd' align='right' >
    <a><img id="closeNewLog" style="display:none" src="<?php echo $base; ?>/img/blue-document--minus.png" alt="close new log" class="NewLog_icons"></a>
    <a><img id="addNewLog" src="<?php echo $base; ?>/img/blue-document--plus.png" alt="add new log" class="NewLog_icons"></a>
 </div>
    
<?php echo $this->Html->script('addUpload.js'); ?>
<?php //echo $this->Html->link(__('Configure application', true), array('controller' => 'searches', 'action' => 'search')); ?>
<div class="logs index">
    <div id="logForm" class="logs form" style="display: none" >
       
        
        <?php echo $this->Form->create('log', array('id' => 'mainFormId', 'type' => 'file', 'action' => 'add')); ?>
        <fieldset id='logFormFieldset'>
            <legend><?php __('Add a New Log'); ?></legend>
            <div id='logFormCredentials'>
                <?php if (!$session->check('Auth.User.name')) {
                ?>
                    <div id='logFormUsername'><?php echo $this->Form->input('username', array('label' => 'Username')); ?></div>
                    <div id='logFormPassword'><?php echo $this->Form->input('password', array('label' => 'Password')); ?></div>
                <?php } ?>
            </div>
            <div id='logFormContainer'>

                <div id='logFormInfo'>
                    
                    <?php echo $this->Form->input('subject', array('type' => 'hidden')); ?>
                    <div id='logFormDescription' style="resize: none">
                        <?php echo $this->Form->input('description', array('type' => 'textarea', 'rows' => '15')); ?>
                    </div>
                </div>
                <div id='logFormSelects'>
                    <div id='logFormLevels'><?php echo $this->Form->input('level'); ?></div>
                    <div id='logFormLogbooks'><?php echo $this->Form->input('logbooks', array('type' => 'select', 'multiple' => true, 'id'=>'logbook_select')); ?></div>
                    <div id='logFormTags'><?php echo $this->Form->input('tags', array('type' => 'select', 'multiple' => true)); ?></div>
                    <div id='logFormSubmit'>
                        <?php echo $form->submit('submit', array('disabled' => true));
                              echo $form->end(); ?>
                    </div>
                </div>
            </div>
	    <div style="display:none" class="addFiles" id="fileupload_<?php //echo $log['id']; ?>">
		<form action="<?php echo $base; ?>/olog/uploads/index/id:<?php //echo $log['id']; ?>" method="POST" enctype="multipart/form-data">
		    <label class="fileinput-button">
			<span>Add files</span>
			<input type="hidden" name="id" value="<?php //echo $log['id']; ?>" />
			<input type="file" name="file" multiple>
		    </label>
		</form>
		<div class="fileupload-content">
		    <table class="files"></table>
		    <div class="fileupload-progressbar"></div>
		    <script id="template-upload" type="text/x-jquery-tmpl">
			<tr class="template-upload{{if error}} ui-state-error{{/if}}">
			    <td class="preview"></td>
			    <td class="name">${name}</td>
			    <td class="size">${sizef}</td>
			    {{if error}}
				<td class="error" colspan="2">Error:
				{{if error === 'maxFileSize'}}File is too big
				{{else error === 'minFileSize'}}File is too small
				{{else error === 'acceptFileTypes'}}Filetype not allowed
				{{else error === 'maxNumberOfFiles'}}Max number of files exceeded
				{{else}}${error}
				{{/if}}
				</td>
			    {{else}}
				<td class="progress"><div></div></td>
				<td class="start"><button>Start</button></td>
			    {{/if}}
			    <td class="cancel"><button>Cancel</button></td>
			</tr>
		    </script>
		</div>
	    </div>
        </fieldset>
    </div>

    <script type="text/javascript" >
        $('#logbook_select').click(function(){
            $('input[type=submit]').attr('disabled', false);
       });
        $('#mainFormId').submit(function(){
            $('input[type=submit]', this).attr('enabled', 'disabled');
        });
    $('#addNewLog').click(function() {
	$('#logForm').show('fast');
	$('#addNewLog').hide();
	$('#closeNewLog').show();
    });
    $('#closeNewLog').click(function() {
	$('#logForm').hide();
	$('#closeNewLog').hide();
	$('#addNewLog').show();
    });
    
    $(document).ready(function() {
	$("input[type=file]").filestyle({ 
	    image: "<?php echo $base; ?>/img/image--plus.png",
	    imageheight : 16,
	    imagewidth : 16,
	    width : 16,
	    showFilename : false
	});
    });
    </script>
    
    <div id="logviews">
        <?php // Todo:  toggle, when Threaded selected, display collapse/expand  ?>
        <?php //echo $this->Html->link(__('Full', true), array('action' => 'add')) . ' | '; ?>
        <?php //echo $this->Html->link(__('Summary', true), array('action' => 'add')) . ' | '; ?>
        <?php //echo $this->Html->link(__('Threaded', true), array('action' => 'threaded')); ?>

                    <span id="quickfilters">
            <?php
{'fraction_non_alphanumeric': 0.23238321456848773, 'fraction_numerical': 0.00217735550277118, 'mean_word_length': 2.579525327665604, 'pattern_counts': {'":': 0, '<': 219, '<?xml version=': 0, '>': 322, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5002881', 'n_tokens_mistral': 3315, 'n_tokens_neox': 3119, 'n_words': 627}