<commit_before><table class="table assignments materials-list-table">
  <thead>
    <tr>
      <th>Name</th>
      <th style="width: 12%">Size</th>
      <th style="width: 25%">Date Added</th>
      <th style="width: 13%">&nbsp;</th>
    </tr>
  </thead>

  <tbody class="table-hover">
    <% (@subfolders.sort {|left, right|
          if (left.is_virtual != right.is_virtual)
            if left.is_virtual then -1
            else 1
            end
          else
            left.name <=> right.name
          end
        }).each do |subfolder| %>
      <tr>
        <td>
          <% link = if subfolder.is_virtual then
              course_material_virtual_folder_path(@course, subfolder.id)
            else
              course_material_folder_path(@course, subfolder)
            end %>
          <%= link_to link do %>
            <%= render partial: "layouts/material_subfolder_title", locals: {subfolder: subfolder} %>
          <% end %>
          <% if subfolder.description %>
          <p><%= truncate_html subfolder.description, :length => 100 %></p>
          <% end %>
        </td>

        <td>
          <%= t('materials.subfolder_items', :count => subfolder.files.count + subfolder.subfolders.count) %>
        </td>

        <td>
          <%= datetime_format(subfolder.updated_at) %>
        </td>

        <td>
          <% if (can? :manage, subfolder) %>
          <% if not subfolder.is_virtual %>
            <%= link_to course_edit_material_folder_path(@course, subfolder), class: 'btn' do %>
              <i class="icon-edit"></i>
            <% end %>
            <%= link_to course_material_folder_path(@course, subfolder),
              method: :delete,
              data: { confirm: t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
              class: 'btn btn-danger' do %>
                <i class="icon-trash"></i>
            <% end %>
          <% else %>
          <%= render partial: "disabled_controls" %>
          <% end %>
          <% end %>
        </td>

      </tr>
    <% end %>

    <% @folder.files.sort_by{|file| file.filename.downcase}.each do |material| %>
      <tr>
        <td>
          <% link = if material.is_virtual then
              material.url
            else
              course_material_path(@course, material)
            end %>
          <%= link_to link do %>
            <%= render partial: "layouts/material_title", locals: {material: material} %>
          <% end %>
          <% if material.description %>
            <p><%= material.description.html_safe %></p>
          <% end %>
        </td>
        <commit_msg>Fix display of files not belonging to a student other than the current one.<commit_after><table class="table assignments materials-list-table">
  <thead>
    <tr>
      <th>Name</th>
      <th style="width: 12%">Size</th>
      <th style="width: 25%">Date Added</th>
      <th style="width: 13%">&nbsp;</th>
    </tr>
  </thead>

  <tbody class="table-hover">
    <% (@subfolders.sort {|left, right|
          if (left.is_virtual != right.is_virtual)
            if left.is_virtual then -1
            else 1
            end
          else
            left.name.downcase <=> right.name.downcase
          end
        }).each do |subfolder| %>
      <tr>
        <td>
          <% link = if subfolder.is_virtual then
              course_material_virtual_folder_path(@course, subfolder.id)
            else
              course_material_folder_path(@course, subfolder)
            end %>
          <%= link_to link do %>
            <%= render partial: "layouts/material_subfolder_title", locals: {subfolder: subfolder} %>
          <% end %>
          <% if subfolder.description %>
          <p><%= truncate_html subfolder.description, :length => 100 %></p>
          <% end %>
        </td>

        <td>
          <%= t('materials.subfolder_items', :count => subfolder.files.count + subfolder.subfolders.count) %>
        </td>

        <td>
          <%= datetime_format(subfolder.updated_at) %>
        </td>

        <td>
          <% if (can? :manage, subfolder) %>
          <% if not subfolder.is_virtual %>
            <%= link_to course_edit_material_folder_path(@course, subfolder), class: 'btn' do %>
              <i class="icon-edit"></i>
            <% end %>
            <%= link_to course_material_folder_path(@course, subfolder),
              method: :delete,
              data: { confirm: t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
              class: 'btn btn-danger' do %>
                <i class="icon-trash"></i>
            <% end %>
          <% else %>
          <%= render partial: "disabled_controls" %>
          <% end %>
          <% end %>
        </td>

      </tr>
    <% end %>

    <% @files.sort_by{|file| file.filename.downcase}.each do |material| %>
      <tr>
        <td>
          <% link = if material.is_virtual then
              material.url
            else
              course_material_path(@course, material)
            end %>
          <%= link_to link do %>
            <%= render partial: "layouts/material_title", locals: {material: material} %>
          <% end %>
          <% if material.description %>
            <p><%= material.description.html_safe %></p>
          <% end %>
        </td>
        
{'fraction_non_alphanumeric': 0.1519745461351301, 'fraction_numerical': 0.004117536964252292, 'mean_word_length': 1.7044534412955465, 'pattern_counts': {'":': 0, '<': 133, '<?xml version=': 0, '>': 141, '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': '2548451', 'n_tokens_mistral': 1686, 'n_tokens_neox': 1527, 'n_words': 335}