修改动态问题

This commit is contained in:
huang 2016-07-22 16:35:03 +08:00
parent 160b05ae89
commit 8dbdebe02e
3 changed files with 9 additions and 2 deletions

View File

@ -44,6 +44,13 @@ module ApplicationHelper
user.nil? ? User.find(2) : user user.nil? ? User.find(2) : user
end end
# 历史数据(老版本库数据)处理完则可以修改该放放
def get_rep_identifier_by_project project
identifier = Repository.where(:project_id => project.id, :type => "Repository::Gitlab").first.try(:identifier)
result = identifier.nil? ? Repository.where(:project_id => project.id).first.try(:identifier) : identifier
result
end
# 获取用户单位 # 获取用户单位
# 优先获取高校信息如果改信息不存在则获取occupation # 优先获取高校信息如果改信息不存在则获取occupation
def get_occupation_from_user user def get_occupation_from_user user

View File

@ -73,7 +73,7 @@
<% when "Attachment" %> <% when "Attachment" %>
<%= render :partial => 'users/project_attachment', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %> <%= render :partial => 'users/project_attachment', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %>
<% when "Commit" %> <% when "Commit" %>
<%= render :partial => 'projects/project_commit', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %> <%= render :partial => 'projects/project_commit', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :identifier => get_rep_identifier_by_project(@project) } %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -17,7 +17,7 @@
<%= link_to project.to_s+" | 项目代码提交", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %> <%= link_to project.to_s+" | 项目代码提交", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word" > <div class="homepagePostTitle break_word" >
<%= link_to activity.comments, {:controller => 'repositories', :action => 'commit_diff', :id => project.id, :changeset => activity.version}, :class => "postGrey" %> <%= link_to activity.comments, {:controller => 'repositories', :action => 'commit_diff', :id => project.id, :repository_id => identifier, :changeset => activity.version}, :class => "postGrey" %>
</div> </div>
<div class="homepagePostDate"> <div class="homepagePostDate">
提交时间:<%= format_time(activity.committed_on) %> 提交时间:<%= format_time(activity.committed_on) %>