优化最近动态获取方法
This commit is contained in:
parent
d94f9762ce
commit
412d74e295
|
@ -47,13 +47,11 @@ module RepositoriesHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
# 获取文件目录的最新动态
|
# 获取文件目录的最新动态
|
||||||
def get_trees_last_changes(project_id, rev, ent_name)
|
def get_trees_last_changes(project_id, rev, ent_name, g)
|
||||||
g = Gitlab.client
|
|
||||||
begin
|
begin
|
||||||
tree_changes = g.rep_last_changes(project_id, :rev => rev, :path => ent_name)
|
tree_changes = g.rep_last_changes(project_id, :rev => rev, :path => ent_name)
|
||||||
tree_changes
|
rescue Exception => e
|
||||||
rescue
|
puts e
|
||||||
logger.error("faile to get tress activities!")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<% sub_path = entry.path[0] == "/" ? entry.path.sub("/", "") : entry.path %>
|
<% sub_path = entry.path[0] == "/" ? entry.path.sub("/", "") : entry.path %>
|
||||||
<% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(sub_path) %>
|
<% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(sub_path) %>
|
||||||
<% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %>
|
<% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %>
|
||||||
<% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path) %>
|
<% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path, @g) %>
|
||||||
|
|
||||||
<tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>">
|
<tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>">
|
||||||
<td style="padding-left: <%=18 * depth%>px;" class="filename_no_report hidden">
|
<td style="padding-left: <%=18 * depth%>px;" class="filename_no_report hidden">
|
||||||
|
|
Loading…
Reference in New Issue