<% @entries.each do |entry| %>
    <% tr_id = Digest::MD5.hexdigest(entry.path)
       depth = params[:depth].to_i %>
    <% sub_path = entry.path[0] == "/" ? entry.path.sub("/", "") : entry.path %>
    <% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(sub_path)   %>
    <% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name)   %>
    <% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path) %>

    <tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>">
      <td style="padding-left: <%=18 * depth%>px;" class="filename_no_report hidden">
        <% if entry.is_dir? %>
<%# 展开文件目录 %>
            <span class="expander" onclick="scmEntryClick('<%= tr_id %>', '<%= escape_javascript(url_for(
                       :action => 'show',
                       :id     => @project,
                       :repository_id => @repository.identifier_param,
                       :path   => to_path_param(ent_path),
                       :rev    => @rev,
                       :latest_changes => latest_changes,
                       :depth  => (depth + 1),
                       :parent_id => tr_id)) %>');">&nbsp;</span>
        <% end %>
        <!--<a class="<%#= (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}") %>">-->
          <!--<%#= h(ent_name) %>-->
        <!--</a>-->
        <%#= h(ent_name), :class => "(entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%>
<%=  link_to h(ent_name),
          {:action => (entry.is_dir? ? 'show' : 'entry'), :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(ent_path), :rev => @rev},
           :class => (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%>
      </td>
      <!--<td class="size"><%#= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>-->
      <!--<td class="size"><%#= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>-->
<%# if @repository.report_last_commit %>
      <div id="children_tree">
        <td class="tree-comments c_grey hidden">
          <div class="hidden" title="<%= (latest_changes.message) if latest_changes && latest_changes.message %>">
            <%= (latest_changes.message) if latest_changes && latest_changes.message %>
          </div>
        </td>
        <td class="tree-author c_grey">
          <div class="hidden" title="<%= (latest_changes.author) if latest_changes && latest_changes.author %>">
            <%= (latest_changes.author) if latest_changes && latest_changes.author %>
          </div>
        </td>
        <td class="tree-age c_grey">
          <div class="hidden" title="<%= format_time(latest_changes.time) %>">
            <%# 为了转换UTC时间，时差8小时 %>
            <%= distance_of_time_in_words(latest_changes.time, Time.now + 8.hours) if latest_changes && latest_changes.time %>
            <%#= latest_changes.time if latest_changes && latest_changes.time %>
          </div>
        </td>
      </div>
<%# end %>
    </tr>
<% end %>
