diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index ebac846d5..bef1a3ac4 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -44,6 +44,7 @@ class ProjectsController < ApplicationController end end + helper :bids include BidsHelper helper :contests @@ -658,6 +659,23 @@ class ProjectsController < ApplicationController end #end + # 获取项目tree目录的最新提交记录 + # 异步请求 + # gpid, rev, ent_name, g + def repository_tree_changes + rev = params[:rev] + ent_name = params[:ent_name] + gpid = params[:gpid] + g = Gitlab.client + begin + result = g.rep_last_changes(gpid, :rev => rev, :path => ent_name) + # result.time = distance_of_time_in_words(result.time, Time.now) + rescue Exception => e + puts e + end + render :json => result + end + def update @project.safe_attributes = params[:project] @project.organization_id = params[:organization_id] diff --git a/app/views/repositories/_dir_list_content.html.erb b/app/views/repositories/_dir_list_content.html.erb index b9f3580fc..e1c610ecd 100644 --- a/app/views/repositories/_dir_list_content.html.erb +++ b/app/views/repositories/_dir_list_content.html.erb @@ -4,7 +4,7 @@ <% 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, @g) %> + <%# latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path, @g) %>