<commit_before><div class="home-box-dashboard">
	<%= link_to "< Back to data collection: #{@dataset.name}", files_path(@dataset.id) %>
	<div class="row">
		<div class="head-dataset">
			<div class="col-md-3">
				<h2><span><i class="fas fa-file-alt"></i></span><%= @dataset_file.title %></h2>
			</div>
			<div class="col-md-offset-6 col-md-3">
				<% if !@dataset.published_status %>
					<%= bs_button_to "View on Github", @dataset.github_url, target: "_blank", rel: "alternate",:class => "btn btn-tertiary disabled" %>
				<% else %>
					<%= bs_button_to "View on Github", @dataset.github_url, target: "_blank", rel: "alternate",:class => "btn btn-tertiary" %>
				<% end %>
			</div>
		</div>
	</div>
	<div class="box-dataset">
	  <div class="row">
			<div class="col-md-2 col-sm-2">
				<strong>Description:</strong>
			</div>
			<div class="col-md-5 col-sm-5">
				<p><%= @dataset_file.description %></p>
			</div>
			<div class="col-md-1 col-md-offset-4 col-sm-1 col-sm-offset-4 icon-blue">
				<i class="as fa-pencil-alt"></i>
				<%= link_to("Edit", edit_dataset_path(@dataset.id)) %>
			</div>
		</div>
		<div class="row">
			<div class="col-md-2 col-sm-2">
				<p><strong>Schema:</strong></p>
			</div>
			<div class="col-md-5 col-sm-5">
				<% if @dataset_file.dataset_file_schema %>
					<p><%= @dataset_file.dataset_file_schema.name %></p>
				<% else %>
					<p>No schema</p>
				<% end %>
			</div>
		</div>
		<div class="row">
			<div class="col-md-2 col-sm-2">
				<p><strong>Last updated:</strong></p>
			</div>
			<div class="col-md-5 col-sm-5">
				<p><%= time_or_date(@dataset_file.updated_at) %></p>
			</div>
		</div>
		<div class="row">
			<div class="col-md-2 col-sm-2">
				<p><strong>Published:</strong></p>
			</div>
			<div class="col-md-5 col-sm-5">
				<% if @dataset.published_status %>
		      <p>Yes</p>
				<% else %>
		      <p>No - this file is not public yet</p>
				<% end %>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="head-dataset">
			<div class="col-md-3">
				<h2>Preview</h2>
			</div>
			<div class="col-md-offset-6 col-md-3">
				<%= bs_button_to "Download CSV", @s3_file, rel: "alternate", :class => "btn btn-secondary" %>
			</div>
		</div>
	</div>
	<div class="box-dataset">
		<div class="table-container">
			<table class="table table-striped table-bordered" id="data-table">
				<thead id="data-table-head"></thead>
				<tbody id="data-table-body"></tbody>
			</table>
		</div>
	</div>
</div>

<div id="loading" style="display: none;">
  <h1>Loading...</h1>
  <i class="fa fa-circle-o-notch fa-spin fa-fw"></i>
</div>


<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/4.3.7/papaparse.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/floatthead/2.0.3/jquery.floatThead.min.js"></script>

<script>
	function dataTable () {
		Papa.SCRIPT_PATH = 'https://cdnjs.cloudflare.com/ajax/libs/PapaParse/4.3.7/papaparse.min.js'

		var url = "<%= @s3_file %>"
		url = url.replace(/&amp;/g, '&');

	  $('#loading').show()
	  $('#data-table-body').hide()

	  Papa.parse(url, {
	    download: true,
			header: true,
	    step: function(row) {
				$('#data-table-head').html(dataHead(row.meta['fields']))
	      $('#data-table-body').append(dataRow(row.data[0]))
	    },
	    complete: function() {
	      $('#loading').hide()

	      var $table = $('table.table');
	      $table.floatThead({
	        scrollContainer: function($table) {<commit_msg>Added loading text for CSV<commit_after><div class="home-box-dashboard">
	<%= link_to "< Back to data collection: #{@dataset.name}", files_path(@dataset.id) %>
	<div class="row">
		<div class="head-dataset">
			<div class="col-md-3">
				<h2><span><i class="fas fa-file-alt"></i></span><%= @dataset_file.title %></h2>
			</div>
			<div class="col-md-offset-6 col-md-3">
				<% if !@dataset.published_status %>
					<%= bs_button_to "View on Github", @dataset.github_url, target: "_blank", rel: "alternate",:class => "btn btn-tertiary disabled" %>
				<% else %>
					<%= bs_button_to "View on Github", @dataset.github_url, target: "_blank", rel: "alternate",:class => "btn btn-tertiary" %>
				<% end %>
			</div>
		</div>
	</div>
	<div class="box-dataset">
	  <div class="row">
			<div class="col-md-2 col-sm-2">
				<strong>Description:</strong>
			</div>
			<div class="col-md-5 col-sm-5">
				<p><%= @dataset_file.description %></p>
			</div>
			<div class="col-md-1 col-md-offset-4 col-sm-1 col-sm-offset-4 icon-blue">
				<i class="as fa-pencil-alt"></i>
				<%= link_to("Edit", edit_dataset_path(@dataset.id)) %>
			</div>
		</div>
		<div class="row">
			<div class="col-md-2 col-sm-2">
				<p><strong>Schema:</strong></p>
			</div>
			<div class="col-md-5 col-sm-5">
				<% if @dataset_file.dataset_file_schema %>
					<p><%= @dataset_file.dataset_file_schema.name %></p>
				<% else %>
					<p>No schema</p>
				<% end %>
			</div>
		</div>
		<div class="row">
			<div class="col-md-2 col-sm-2">
				<p><strong>Last updated:</strong></p>
			</div>
			<div class="col-md-5 col-sm-5">
				<p><%= time_or_date(@dataset_file.updated_at) %></p>
			</div>
		</div>
		<div class="row">
			<div class="col-md-2 col-sm-2">
				<p><strong>Published:</strong></p>
			</div>
			<div class="col-md-5 col-sm-5">
				<% if @dataset.published_status %>
		      <p>Yes</p>
				<% else %>
		      <p>No - this file is not public yet</p>
				<% end %>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="head-dataset">
			<div class="col-md-3">
				<h2>Preview</h2>
			</div>
			<div class="col-md-offset-6 col-md-3">
				<%= bs_button_to "Download CSV", @s3_file, rel: "alternate", :class => "btn btn-secondary" %>
			</div>
		</div>
	</div>
	<div class="box-dataset">
		<div class="table-container">
			<table class="table table-striped table-bordered" id="data-table">
				<thead id="data-table-head"></thead>
				<tbody id="data-table-body"></tbody>
			</table>
		</div>
	</div>
</div>

<div id="loading" style="display: none; text-align: center;">
  <h1>Loading...</h1>
  <i class="fa fa-circle-o-notch fa-spin fa-fw"></i>
</div>


<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/4.3.7/papaparse.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/floatthead/2.0.3/jquery.floatThead.min.js"></script>

<script>
	function dataTable () {
		Papa.SCRIPT_PATH = 'https://cdnjs.cloudflare.com/ajax/libs/PapaParse/4.3.7/papaparse.min.js'

		var url = "<%= @s3_file %>"
		url = url.replace(/&amp;/g, '&');

	  $('#loading').show()
	  $('#data-table-body').hide()

	  Papa.parse(url, {
	    download: true,
			header: true,
	    step: function(row) {
				$('#data-table-head').html(dataHead(row.meta['fields']))
	      $('#data-table-body').append(dataRow(row.data[0]))
	    },
	    complete: function() {
	      $('#loading').hide()

	      var $table = $('table.table');
	      $table.floatThead({
	        scrollContainer: function($table) {
{'fraction_non_alphanumeric': 0.23353983575853623, 'fraction_numerical': 0.012678288431061807, 'mean_word_length': 3.1768953068592056, 'pattern_counts': {'":': 0, '<': 249, '<?xml version=': 0, '>': 253, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '350391', 'n_tokens_mistral': 3154, 'n_tokens_neox': 2700, 'n_words': 468}