Merge branch 'dev_newproject' of https://git.trustie.net/jacknudt/trustieforge into dev_newproject
This commit is contained in:
commit
6b04c9144e
|
@ -44,6 +44,7 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
helper :bids
|
helper :bids
|
||||||
include BidsHelper
|
include BidsHelper
|
||||||
helper :contests
|
helper :contests
|
||||||
|
@ -658,6 +659,23 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
# 获取项目tree目录的最新提交记录
|
||||||
|
# 异步请求
|
||||||
|
# gpid, rev, ent_name, g
|
||||||
|
def repository_tree_changes
|
||||||
|
rev = params[:rev]
|
||||||
|
ent_path = params[:ent_path]
|
||||||
|
gpid = params[:gpid]
|
||||||
|
g = Gitlab.client
|
||||||
|
begin
|
||||||
|
result = g.rep_last_changes(gpid, :rev => rev, :path => ent_path)
|
||||||
|
# result.time = distance_of_time_in_words(result.time, Time.now)
|
||||||
|
rescue Exception => e
|
||||||
|
puts e
|
||||||
|
end
|
||||||
|
render :json => result
|
||||||
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
@project.safe_attributes = params[:project]
|
@project.safe_attributes = params[:project]
|
||||||
@project.organization_id = params[:organization_id]
|
@project.organization_id = params[:organization_id]
|
||||||
|
|
|
@ -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, @g) %>
|
<%# 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">
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
:repository_id => @repository.identifier_param,
|
:repository_id => @repository.identifier_param,
|
||||||
:path => to_path_param(ent_path),
|
:path => to_path_param(ent_path),
|
||||||
:rev => @rev,
|
:rev => @rev,
|
||||||
:latest_changes => latest_changes,
|
|
||||||
:depth => (depth + 1),
|
:depth => (depth + 1),
|
||||||
:parent_id => tr_id)) %>');"> </span>
|
:parent_id => tr_id)) %>');"> </span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -26,21 +26,42 @@
|
||||||
</td>
|
</td>
|
||||||
<div id="children_tree">
|
<div id="children_tree">
|
||||||
<td class="tree-comments c_grey hidden">
|
<td class="tree-comments c_grey hidden">
|
||||||
<div class="hidden" title="<%= (latest_changes.message) if latest_changes %>">
|
<div class="hidden" id="changes_message_<%= tr_id %>">
|
||||||
<%= (latest_changes.message) if latest_changes %>
|
<%#= (latest_changes.message) if latest_changes %>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="tree-author c_grey">
|
<td class="tree-author c_grey">
|
||||||
<div class="hidden" title="<%= (latest_changes.author_name) if latest_changes %>">
|
<div class="hidden" id="changes_author_<%= tr_id %>">
|
||||||
<%= (latest_changes.author_name) if latest_changes %>
|
<%#= (latest_changes.author_name) if latest_changes %>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="tree-age c_grey">
|
<td class="tree-age c_grey">
|
||||||
<div class="hidden" title="<%= format_time(latest_changes.time) if latest_changes %>">
|
<div class="hidden" id="changes_time_<%= tr_id %>">
|
||||||
<%# 为了转换UTC时间,时差8小时 %>
|
<%# 为了转换UTC时间,时差8小时 %>
|
||||||
<%= distance_of_time_in_words(latest_changes.time, Time.now) if latest_changes %>
|
<%#= distance_of_time_in_words(latest_changes.time, Time.now) if latest_changes %>
|
||||||
|
<%#= link_to "", repository_tree_changes_project_path(@project, :rev => @rev, :ent_name => ent_name) %>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</div>
|
</div>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
console.log("2222222222");
|
||||||
|
$.ajax({
|
||||||
|
url:"<%= repository_tree_changes_project_path(@project, :rev => @rev, :ent_path => ent_path, :gpid => @project.gpid) %>",
|
||||||
|
type: "GET",
|
||||||
|
data: "text",
|
||||||
|
success:function(data){
|
||||||
|
console.log(data);
|
||||||
|
$('#changes_message_<%=tr_id %>').html(data.message)
|
||||||
|
$('#changes_author_<%=tr_id %>').html(data.author_name)
|
||||||
|
$('#changes_time_<%=tr_id %>').html(data.time)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -752,6 +752,7 @@ RedmineApp::Application.routes.draw do
|
||||||
match 'store_mine', :to => 'projects#store_mine', :as => 'store_mine'
|
match 'store_mine', :to => 'projects#store_mine', :as => 'store_mine'
|
||||||
get 'file', :action => 'file', :as => 'file'
|
get 'file', :action => 'file', :as => 'file'
|
||||||
get 'statistics', :action => 'statistics', :as => 'statistics'
|
get 'statistics', :action => 'statistics', :as => 'statistics'
|
||||||
|
get 'repository_tree_changes', :action => 'repository_tree_changes', :as => 'repository_tree_changes'
|
||||||
|
|
||||||
get 'feedback', :action => 'feedback', :as => 'project_feedback'
|
get 'feedback', :action => 'feedback', :as => 'project_feedback'
|
||||||
get 'watcherlist', :action=> 'watcherlist'
|
get 'watcherlist', :action=> 'watcherlist'
|
||||||
|
|
Loading…
Reference in New Issue