<commit_before><% javascript 'generic_files.js' %>
<% stylesheet 'generic_files.css' %>

<div class="alert alert-info hide" id="redirect-loc" type="text/x-jquery-tmpl">
  <%=batch_edit_path(@batch_noid)%>
</div>

<div id="upload_tooltip">Please accept terms of service before you can upload.</div>

<div class="alert alert-info hide" id="success">
  You have successfully uploaded some of your files.  Either continue to upload or edit use the links below to abandon the rest of your added files.
  <p>
  <%= link_to 'Add Descriptions', batch_edit_path(@batch_noid), :class=>'btn' %>
  </p>
</div>
<div class="alert hide" id="fail">
  There was a problem during upload. Please click the &quot;Start Upload&quot; button or <%= link_to 'start over', new_generic_file_path %>
</div>
<div class="alert hide" id="partial_fail">
  One or more files did not upload successfully. To continue using the files uploaded use one of the links below.
  <p>
  <%= link_to 'Add Descriptions', batch_edit_path(@batch_noid), :class=>'btn' %>
</div>
<div class="alert hide" id="errmsg">
</div>
    <!-- The file upload form used as target for the file upload widget -->
      <%= form_for(@generic_file, :url => generic_files_path, :html => {:multipart => true, :class => 'form-horizontal', :id => 'fileupload'}) do |f| %>
      <%= check_box_tag 'terms_of_service' %> <%= label_tag 'terms_of_service' %>      
      <%= hidden_field_tag(:batch_id, @batch_noid) %>
        <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
        <div class="row fileupload-buttonbar">
            <div class="span7">
                <!-- The fileinput-button span is used to style the file input field as button -->
                <span class="btn btn-success fileinput-button">
                    <i class="icon-plus icon-white"></i>
                    <span>Add files...</span>
                    <input type="file" name="files[]" multiple />
                </span> 
                <span class="btn btn-success fileinput-button">
                    <i class="icon-plus icon-white"></i>
                    <span>Add folder</span>
                    <input type="file" name="files[]" directory webkitdirectory mozdirectory />
                </span>
                <span id="main_upload_start_span">                
                <button type="submit" class="btn btn-primary start" disabled ='true' id='main_upload_start'>
                    <i class="icon-upload icon-white"></i>
                    <span>Start upload</span>
                </button>
                </span>
                <button type="reset" class="btn btn-warning cancel">
                    <i class="icon-ban-circle icon-white"></i>
                    <span>Cancel upload</span>
                </button>
            </div>
            <div class="span5">
                <!-- The global progress bar -->
                <div class="progress progress-success progress-striped active fade">
                    <div class="bar" style="width:0%;"></div>
                </div>
            </div>
        </div>
        <!-- The loading indicator is shown during image processing -->
        <div class="fileupload-loading"></div>
        <br />
        <!-- The table listing the files available for upload/download -->
        <table id="file-table" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
    </form>
  <% end %>

<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-jquery-tmpl">
 {% for (var i=0, file; file=o.files[i]; i++) { %}

    <tr class="template-upload fade">
        <td class="preview"><span class="fade"></span></td>
        <td class="name"><span>{%=file.name%}</span></td>
        <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
        {% if (file.error) { %}
            <td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
        {% } else if (o.files.valid && !i) { %}
            <td>
                <div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
            </td>
            <td class="start">{% if (!o.options.autoUpload) { %}
                <button class="btn btn-primary">
                    <i class="icon-upload icon-white"></i>
                    <span>{%=locale.fileupload.start%}</span>
                </button>
            {% } %}</td>
        {% } else { %}
            <td colspan="2"></td>
        {% } %}
        <td class="cancel">{% if (!i) { %}
            <button class="btn btn-warning">
                <i class="icon-ban-circle icon-white"></i>
                <span>{%=locale.fileupload.cancel%}</span><commit_msg>hid the start button on individual uploads so user can't see it.  Initially when I removed the start button entirely the upload broke, so there is some type of dependency on the button and for the sake of time I didn't find out exactly what that dependency is and just solved that problem. fixes #816<commit_after><% javascript 'generic_files.js' %>
<% stylesheet 'generic_files.css' %>

<div class="alert alert-info hide" id="redirect-loc" type="text/x-jquery-tmpl">
  <%=batch_edit_path(@batch_noid)%>
</div>

<div id="upload_tooltip">Please accept terms of service before you can upload.</div>

<div class="alert alert-info hide" id="success">
  You have successfully uploaded some of your files.  Either continue to upload or edit use the links below to abandon the rest of your added files.
  <p>
  <%= link_to 'Add Descriptions', batch_edit_path(@batch_noid), :class=>'btn' %>
  </p>
</div>
<div class="alert hide" id="fail">
  There was a problem during upload. Please click the &quot;Start Upload&quot; button or <%= link_to 'start over', new_generic_file_path %>
</div>
<div class="alert hide" id="partial_fail">
  One or more files did not upload successfully. To continue using the files uploaded use one of the links below.
  <p>
  <%= link_to 'Add Descriptions', batch_edit_path(@batch_noid), :class=>'btn' %>
</div>
<div class="alert hide" id="errmsg">
</div>
    <!-- The file upload form used as target for the file upload widget -->
      <%= form_for(@generic_file, :url => generic_files_path, :html => {:multipart => true, :class => 'form-horizontal', :id => 'fileupload'}) do |f| %>
      <%= check_box_tag 'terms_of_service' %> <%= label_tag 'terms_of_service' %>      
      <%= hidden_field_tag(:batch_id, @batch_noid) %>
        <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
        <div class="row fileupload-buttonbar">
            <div class="span7">
                <!-- The fileinput-button span is used to style the file input field as button -->
                <span class="btn btn-success fileinput-button">
                    <i class="icon-plus icon-white"></i>
                    <span>Add files...</span>
                    <input type="file" name="files[]" multiple />
                </span> 
                <span class="btn btn-success fileinput-button">
                    <i class="icon-plus icon-white"></i>
                    <span>Add folder</span>
                    <input type="file" name="files[]" directory webkitdirectory mozdirectory />
                </span>
                <span id="main_upload_start_span">                
                <button type="submit" class="btn btn-primary start" disabled ='true' id='main_upload_start'>
                    <i class="icon-upload icon-white"></i>
                    <span>Start upload</span>
                </button>
                </span>
                <button type="reset" class="btn btn-warning cancel">
                    <i class="icon-ban-circle icon-white"></i>
                    <span>Cancel upload</span>
                </button>
            </div>
            <div class="span5">
                <!-- The global progress bar -->
                <div class="progress progress-success progress-striped active fade">
                    <div class="bar" style="width:0%;"></div>
                </div>
            </div>
        </div>
        <!-- The loading indicator is shown during image processing -->
        <div class="fileupload-loading"></div>
        <br />
        <!-- The table listing the files available for upload/download -->
        <table id="file-table" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
    </form>
  <% end %>

<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-jquery-tmpl">
 {% for (var i=0, file; file=o.files[i]; i++) { %}

    <tr class="template-upload fade">
        <td class="preview"><span class="fade"></span></td>
        <td class="name"><span>{%=file.name%}</span></td>
        <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
        {% if (file.error) { %}
            <td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
        {% } else if (o.files.valid && !i) { %}
            <td>
                <div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
            </td>
            <td class="start">{% if (!o.options.autoUpload) { %}
              <button class="btn btn-primary hide">
                    <i class="icon-upload icon-white"></i>
                    <span>{%=locale.fileupload.start%}</span>
              </button>
            {% } %}</td>
        {% } else { %}
            <td colspan="2"></td>
        {% } %}
        <td class="cancel">{% if (!i) { %}
            <button class="btn btn-warning">
                <i class="icon-ban-circle icon-white"></i>
                <span>{%=locale.fileupload.cancel%}</span>
{'fraction_non_alphanumeric': 0.16153998809287556, 'fraction_numerical': 0.0016868426275054573, 'mean_word_length': 2.3231124299373556, 'pattern_counts': {'":': 0, '<': 241, '<?xml version=': 0, '>': 255, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5919533', 'n_tokens_mistral': 2957, 'n_tokens_neox': 2778, 'n_words': 774}