<commit_before><div class="materials-folder-controls">
  <span>
    <% if (can? :upload, @folder) %>
      <% if @folder.is_virtual? %>
        <span class="workbin-disabled-controls" title="This folder is reserved for Mission/Training files.">
          <a class='btn disabled' title="Upload Files">
            <h4 class="icon-upload"></h4>
          </a>
          <a class="btn disabled" title="Create Folder">
            <h4 class="icon-folder-close"></h4>
          </a>
        </span>
      <% else %>
      <% if (can? :upload, @folder) %>
        <a href="<%= upload_course_material_folder_path(@course, @folder) %>" class='btn hover-tooltip' 
           title="Upload Files">
          <h4 class="icon-upload"></h4>
        </a>
      <% end %>
      <% if (can? :manage, @folder) %>
        <a href="#create-subfolder-modal" data-toggle="modal" class="btn hover-tooltip" title="Create Folder">
          <h4 class="icon-folder-close"></h4>
        </a>
      <% end %>
      <% end %>
    <% end %>
    &nbsp;
  </span>
  
  <span class="pull-right btn-group">
    <% if (can? :manage, @folder) %>
      <% if @folder.is_virtual? %>
      <a class="btn disabled workbin-disabled-controls" title="This folder can't be edited.">Edit</a>
      <% else %>
      <%= link_to "Edit", "#edit-subfolder-modal", "data-toggle" => "modal", :class => 'btn' %>
      <% end %>
    <% end %>
    <%= link_to "Download .zip", (@folder.is_virtual? ?
        course_material_virtual_folder_path(@course, @folder.id, :format => 'zip') :
        course_material_folder_path(@course, @folder, :format => 'zip')),
        :class => 'btn', :id => 'workbin-download-zip-button' %>
    
    <% if not(@folder.is_virtual?) %>
    <%= link_to "Mark as Seen", course_material_folder_mark_read_path(@course, @folder), :class => 'btn' %>
    <% end %>
  </span>
</div>

<% if (can? :manage, @folder) && not(@folder.is_virtual?) %>
<div id="create-subfolder-modal" class="modal hide fade">
  <div class="modal-header">
    <h3>Create Subfolder</h3>
  </div>
  <%= render partial: "subfolder_form", locals: { modal: true, folder_to_change: MaterialFolder.new, subfolder_method: :post } %>
</div>

<div id="edit-subfolder-modal" class="modal hide fade">
  <div class="modal-header">
    <h3>Edit Folder</h3>
  </div>
  <%= render partial: "subfolder_form", locals: { modal: true, folder_to_change: @folder, subfolder_method: :put } %>
</div>
<% end %>
<commit_msg>Allow users to mark the entire workbin as read.<commit_after><div class="materials-folder-controls">
  <span>
    <% if (can? :upload, @folder) %>
      <% if @folder.is_virtual? %>
        <span class="workbin-disabled-controls" title="This folder is reserved for Mission/Training files.">
          <a class='btn disabled' title="Upload Files">
            <h4 class="icon-upload"></h4>
          </a>
          <a class="btn disabled" title="Create Folder">
            <h4 class="icon-folder-close"></h4>
          </a>
        </span>
      <% else %>
      <% if (can? :upload, @folder) %>
        <a href="<%= upload_course_material_folder_path(@course, @folder) %>" class='btn hover-tooltip' 
           title="Upload Files">
          <h4 class="icon-upload"></h4>
        </a>
      <% end %>
      <% if (can? :manage, @folder) %>
        <a href="#create-subfolder-modal" data-toggle="modal" class="btn hover-tooltip" title="Create Folder">
          <h4 class="icon-folder-close"></h4>
        </a>
      <% end %>
      <% end %>
    <% end %>
    &nbsp;
  </span>
  
  <span class="pull-right btn-group">
    <% if (can? :manage, @folder) %>
      <% if @folder.is_virtual? %>
      <a class="btn disabled workbin-disabled-controls" title="This folder can't be edited.">Edit</a>
      <% else %>
      <%= link_to "Edit", "#edit-subfolder-modal", "data-toggle" => "modal", :class => 'btn' %>
      <% end %>
    <% end %>
    <%= link_to "Download .zip", (@folder.is_virtual? ?
        course_material_virtual_folder_path(@course, @folder.id, :format => 'zip') :
        course_material_folder_path(@course, @folder, :format => 'zip')),
        :class => 'btn', :id => 'workbin-download-zip-button' %>
    
    <% if not(@folder.is_virtual?) %>
    <%# For non-root folders, allow marking the entire workbin read. %>
    <% if @folder.parent_folder %>
    <%= link_to "Mark as Seen", course_material_folder_mark_read_path(@course, @folder), :class => 'btn' %>
      <button class="btn dropdown-toggle" data-toggle="dropdown">
        <span class="caret"></span>
      </button>
      <ul class="dropdown-menu">
        <li><%= link_to "Mark entire workbin as seen", course_material_folder_mark_read_path(@course, @course.material_folder) %></li>
      </ul>
    <% else %>
    <%# Otherwise we are at root, then marking the root folder read is as
        good as marking the entire workbin read. %>
        <%= link_to "Mark Workbin as Seen", course_material_folder_mark_read_path(@course, @folder), :class => 'btn' %>
    <% end %>
    <% end %>
  </span>
</div>

<% if (can? :manage, @folder) && not(@folder.is_virtual?) %>
<div id="create-subfolder-modal" class="modal hide fade">
  <div class="modal-header">
    <h3>Create Subfolder</h3>
  </div>
  <%= render partial: "subfolder_form", locals: { modal: true, folder_to_change: MaterialFolder.new, subfolder_method: :post } %>
</div>

<div id="edit-subfolder-modal" class="modal hide fade">
  <div class="modal-header">
    <h3>Edit Folder</h3>
  </div>
  <%= render partial: "subfolder_form", locals: { modal: true, folder_to_change: @folder, subfolder_method: :put } %>
</div>
<% end %>

{'fraction_non_alphanumeric': 0.18843683083511778, 'fraction_numerical': 0.004282655246252677, 'mean_word_length': 3.012168933428776, 'pattern_counts': {'":': 0, '<': 142, '<?xml version=': 0, '>': 157, 'https://': 0, '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': '5991647', 'n_tokens_mistral': 1943, 'n_tokens_neox': 1816, 'n_words': 422}