<%#-- copyright OpenProject is an open source project management software. Copyright (C) 2012-2024 the OpenProject GmbH This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3. OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: Copyright (C) 2006-2013 Jean-Philippe Lang Copyright (C) 2010-2013 the ChiliProject Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. See COPYRIGHT and LICENSE files for more details. ++#%> <% if @entries.truncated? %>
<%= I18n.t "repositories.truncated", limit: @limit, truncated: @entries.truncated %>
<% end %> <% @entries.each do |entry| %> <% tr_id = Digest::MD5.hexdigest(entry.path) depth = params[:depth].to_i %> <% ent_path = replace_invalid_utf8(entry.path) %> <% ent_name = replace_invalid_utf8(entry.name) %> <% parent_ref = params[:parent_id] ? "dir_#{h(params[:parent_id])}" : '' %> <% if entry.dir? %> <%= link_to '#', class: 'icon-context dir-expander', title: I18n.t('js.label_expand'), 'aria-label': I18n.t('js.label_expand'), data: { action: 'repository-navigation#toggleDirectory', element: "dir_#{tr_id}", url: url_for(action: 'show', project_id: @project, repo_path: to_path_param(ent_path), rev: @rev, depth: (depth + 1), parent_id: tr_id), } do %> <%= op_icon('icon-context') %>   <% end %> <% end %> <%= link_to({ action: (entry.dir? ? 'show' : 'changes'), project_id: @project, repo_path: to_path_param(ent_path), rev: @rev }, class: 'icon-context', aria: { label: (entry.dir? ? t('label_folder') : t('activerecord.attributes.attachment.file')) + " #{h(ent_name)}" }) do %> <%= op_icon(entry.dir? ? 'icon-folder' : "icon-ticket #{OpenProject::MimeType.css_class_of(ent_name)}") %> <%= h(ent_name) %> <% end %> <%= depth %> <%= (entry.size ? number_to_human_size(entry.size, precision: 3) : "?") unless entry.dir? %> <% changeset = @project.repository.find_changeset_by_name(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %> <%= link_to_revision(changeset, @project) if changeset %> <%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %> <%= changeset.nil? ? h(replace_invalid_utf8(entry.lastrev.author.to_s.split('<').first)) : h(changeset.author) if entry.lastrev %> <%=h truncate(Changeset.to_utf8(changeset.comments, changeset.repository.repo_log_encoding), length: 50) unless changeset.nil? %> <% end %>