版本库目录最新动态

This commit is contained in:
huang 2016-04-19 15:03:47 +08:00
parent ad3d27d6b0
commit 4e4cb309a9
3 changed files with 38 additions and 26 deletions

View File

@ -1,5 +1,5 @@
<div class="autoscroll">
<table class="list entries" id="browser">
<table class="list entries" id="browser" style="table-layout: fixed;">
<tbody>
<%= render :partial => 'dir_list_content' %>

View File

@ -1,15 +1,15 @@
<% @entries.each do |entry| %>
<% tr_id = Digest::MD5.hexdigest(entry.path)
depth = params[:depth].to_i %>
<% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(entry.path) %>
<% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %>
<% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_name) %>
<% tr_id = Digest::MD5.hexdigest(entry.path)
depth = params[:depth].to_i %>
<% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(entry.path) %>
<% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %>
<% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_name) %>
<tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>">
<td style="padding-left: <%=18 * depth%>px;" class="<%=@repository.report_last_commit ? "filename" : "filename_no_report" %>">
<% if entry.is_dir? %>
<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(
<span class="expander" onclick="scmEntryClick('<%= tr_id %>', '<%= escape_javascript(url_for(
:action => 'show',
:id => @project,
:repository_id => @repository.identifier_param,
@ -17,21 +17,33 @@
:rev => @rev,
:depth => (depth + 1),
:parent_id => tr_id)) %>');">&nbsp;</span>
<% end %>
<%= link_to h(ent_name),
<% 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 %>
<td class="tree-age c_grey">
<%#= format_time(latest_changes.first.last_change.split(",")[1]) %>
<%= distance_of_time_in_words(latest_changes.first.last_change.split(",")[1], Time.now) if latest_changes && latest_changes.first.last_change %>
</td>
<td class="tree-author c_grey"><%= (latest_changes.first.last_change.split(",")[2]) if latest_changes && latest_changes.first.last_change %><%#= entry.author %></td>
<td class="tree-comments c_grey"><%= (latest_changes.first.last_change.split(",")[3]) if latest_changes && latest_changes.first.last_change %><%#=h truncate(entry.changeset.comments, :length => 50) if entry.changeset %></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 %>
<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="<%= distance_of_time_in_words(latest_changes.time, Time.now) if latest_changes && latest_changes.time %>"><%= distance_of_time_in_words(latest_changes.time, Time.now) if latest_changes && latest_changes.time %></div>
</td>
<%# end %>
</tr>
</tr>
<% end %>

View File

@ -594,8 +594,8 @@ img.ui-datepicker-trigger {
.repos_t_c li{ text-align:center;}
.pic_stats{display:block; background:url(../images/public_icon.png) 0px -548px no-repeat; width:20px; height:15px;}
.tree-age{width:10%; text-align:right;}
.tree-author{width:10%; text-align:right;}
.tree-comments{width:20%; text-align:right;}
.tree-author{width:10%; text-align:left;}
.tree-comments{width:40%; text-align:left;}
/* 里程碑 */
@ -819,7 +819,7 @@ div.changeset { border-bottom: 1px solid #ddd; }
tr.entry { border: 1px solid #DDD; }
tr.entry td { white-space: nowrap; }
tr.entry td.filename { width: 30%; }
tr.entry td.filename_no_report { width: 60%; }
tr.entry td.filename_no_report { width: 40%; }
tr.entry td.size { text-align: right; font-size: 90%; }
tr.entry td.revision, tr.entry td.author { text-align: center; }
tr.entry td.age { text-align: right; }