diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 7139bb19a..d23203c9f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -671,7 +671,7 @@ class ProjectsController < ApplicationController g = Gitlab.client begin result = g.rep_last_changes(gpid, :rev => rev, :path => ent_path) - result = {:message => result.message, :author_name => result.author_name, :time => distance_of_time_in_words(result.time, Time.now)} + result = {:message => result.message, :author_name => User.find_by_login(result.author_name).nil? ? result.author_name : User.find_by_login(result.author_name).show_name, :time => distance_of_time_in_words(result.time, Time.now)} rescue Exception => e puts e end diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index bc5e8ee57..e6603070d 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -27,6 +27,11 @@ module RepositoriesHelper REPO_IP_ADDRESS = Setting.host_repository REPO_GITLAB_ADDRESS = "git.trustie.net" + # 因为gitlab的提交总数不是实时同步的,说以取总数用两种方法 + def choise_commit_count git_count, pro_count + git_count > pro_count ? git_count : pro_count + end + # 某个成员不能拥有同名版本库,不同的成员可以创建同名版本库 def is_sigle_identifier?(user_id, iden) projects = Project.where("user_id =?",user_id) diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index dc5344422..0b56ce184 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -53,12 +53,12 @@ <% if @changesets_latest_coimmit %> <% if !user_commit_rep(@changesets_latest_coimmit.author_email).nil? %> <%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.author_email)), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %> - +
提交于 <%= time_tag(@changesets_latest_coimmit.created_at) %> 前:
<%= @changesets_latest_coimmit.message %>
<% else %> - +
提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
<%= @changesets_latest_coimmit.message %>
@@ -69,7 +69,7 @@
- <%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %> 提交 + <%=link_to "#{choise_commit_count(@changesets_all_count, @g_project.commit_count.to_i)} 提交", {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev, :page => 1 ,:commit_count =>"#{@changesets_all_count}"} %> <% end %> diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css index 10e006c04..95bd22d8d 100644 --- a/public/stylesheets/repository.css +++ b/public/stylesheets/repository.css @@ -220,7 +220,7 @@ .vl_branch {background:url(../images/vlicon/branch_icon.png) 0px -2px no-repeat; padding-left:22px} .mt1 {margin-top:1px;} .mt2 {margin-top:2px;} -.commit_content_dec{width: 400px;overflow: hidden; white-space: nowrap;text-overflow: ellipsis;} +.commit_content_dec{width: 500px;overflow: hidden; white-space: nowrap;text-overflow: ellipsis;} /*提交信息列表*/ .col-md-10 {