<commit_before>@extends('layouts/main')

@section('head')
		
		<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.min.js"></script>
		<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/css/datepicker3.min.css">

		{{ HTML::script('javascripts/bootstrapValidator.min.js') }}
		{{ HTML::style('stylesheets/bootstrapValidator.min.css'); }}

		{{ HTML::style('stylesheets/jquery.fileupload.css') }}
		<style type="text/css">
			.form-control[readonly] {
				background-color:#fff;
			}
			.datepicker{z-index:1151 !important;}
		</style>
		
		<script>
			$(document).ready(function() {
				$('#open_file_upload').click(function(){
					$('#fileUploadModal').modal('show');
				});
				
				$('#fileupload').fileupload({
			        url: "{{ URL::action('FileController@postUploadFile', array('id' => $paper->id)) }}",
			        dataType: 'json',
			        autoUpload: false,
			        type: 'POST',
			        add: function (e, data) {
			        	$.each(data.files, function (index, file) {
			                $('<p/>').text(file.name).appendTo('#files');
			            });
			        	$('#startupload').click(function () {
		                    //data.context = $('<p/>').text('Uploading...').replaceAll($(this));
		                    data.submit();
		                });
			        },
			        done: function (e, data) {
			        	if (data.result.success == 1) {
				        	$('#uploadstatus').html('Upload finished.');
			        	} else {
				        	$('#uploadstatus').html("Some problems occured!");
			        	}
			        },
			        fail : function (e, data) {
				        console.log("Failed");
			        },
			        progressall: function (e, data) {
			            var progress = parseInt(data.loaded / data.total * 100, 10);
			            $('#progress .progress-bar').css(
			                'width',
			                progress + '%'
			            );
			        }
			    }).prop('disabled', !$.support.fileInput)
			        .parent().addClass($.support.fileInput ? undefined : 'disabled');


				$.fn.datepicker.defaults.format = "M dd, yyyy";
				$.fn.datepicker.defaults.multidateSeparator = ";";

				$('#deadline').datepicker({<commit_msg>Paper: Reload page after file upload<commit_after>@extends('layouts/main')

@section('head')
		
		<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.min.js"></script>
		<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/css/datepicker3.min.css">

		{{ HTML::script('javascripts/bootstrapValidator.min.js') }}
		{{ HTML::style('stylesheets/bootstrapValidator.min.css'); }}

		{{ HTML::style('stylesheets/jquery.fileupload.css') }}
		<style type="text/css">
			.form-control[readonly] {
				background-color:#fff;
			}
			.datepicker{z-index:1151 !important;}
		</style>
		
		<script>
			var filesUploaded = false;
			
			$(document).ready(function() {
				$('#open_file_upload').click(function(){
					$('#fileUploadModal').modal('show');
				});
				
				$('#fileUploadModal').on('hidden.bs.modal', function () {
				    if(filesUploaded) 
				    	location.reload();
				})
				
				$('#fileupload').fileupload({
			        url: "{{ URL::action('FileController@postUploadFile', array('id' => $paper->id)) }}",
			        dataType: 'json',
			        autoUpload: false,
			        type: 'POST',
			        add: function (e, data) {
			        	$.each(data.files, function (index, file) {
			                $('<p/>').text(file.name).appendTo('#files');
			            });
			        	$('#startupload').click(function () {
		                    //data.context = $('<p/>').text('Uploading...').replaceAll($(this));
		                    data.submit();
		                });
			        },
			        done: function (e, data) {
			        	if (data.result.success == 1) {
			        		filesUploaded = true;
				        	$('#uploadstatus').html('Upload finished.');
			        	} else {
				        	$('#uploadstatus').html("Some problems occured!");
			        	}
			        },
			        fail : function (e, data) {
				        console.log("Failed");
			        },
			        progressall: function (e, data) {
			            var progress = parseInt(data.loaded / data.total * 100, 10);
			            $('#progress .progress-bar').css(
			                'width',
			                progress + '%'
			            );
			        }
			    }).prop('disabled', !$.support.fileInput)
			        .parent().addClass($.support.fileInput ? undefined : 'disabled');


				$.fn.datepicker.defaults.format = "M dd, yyyy";
				$.fn.datepicker.defaults.multidateSeparator = ";";

				$('#deadline').datepicker({
{'fraction_non_alphanumeric': 0.19002325089833016, 'fraction_numerical': 0.007186641302050306, 'mean_word_length': 2.0627831715210356, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, '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': '7637065', 'n_tokens_mistral': 1723, 'n_tokens_neox': 1352, 'n_words': 189}