diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 60f3724f8..dac4034d0 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -364,6 +364,7 @@ update unless @changesets[0].blank? update_commits_date(@project, @changesets_latest_coimmit) end + @creator = User.where("id =?", @project.user_id).first.try(:login) @properties = @repository.properties(@path, @rev) @repositories = @project.repositories project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 750a3c6ec..4dfa86538 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -24,7 +24,9 @@
克隆网址:
-
ZIP
+
+ <%=link_to "统计", stats_repository_project_path(:id => @project, :repository_id => @repository.identifier_param, :rev => @rev, :creator => @creator ), :class => "fl vl_zip" %> +
<%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %> <% if User.current.id != @project.user_id %>
<%= link_to "".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :target => "_blank", :confirm=>"平台将为您创建一个新的同名项目和版本库,请问是否继续?" %> diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb index 0bce15069..b4e4c92a3 100644 --- a/app/views/repositories/stats.html.erb +++ b/app/views/repositories/stats.html.erb @@ -1,8 +1,8 @@

<%= l(:label_statistics) %>

-<% if @status_commit_count ==0 %> -
该项目目前还没有提交过代码!
+<% if false %> +
请在版本库中提交代码,统计信息将更准确
<% else %>
修订 是版本库的提交次数, 显示为橘红色。

变更 是对版本库中文件的修改次数, 显示为蓝色。
diff --git a/config/routes.rb b/config/routes.rb index c6b3d9da3..ea89bb57e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -836,7 +836,7 @@ RedmineApp::Application.routes.draw do get 'activity', :to => 'activities#index' # repositories routes - get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats' + get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats', :as => "stats_repository_project" get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph' get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))', :to => 'repositories#changes' diff --git a/public/images/vlicon/graph.png b/public/images/vlicon/graph.png new file mode 100644 index 000000000..5f3e1c989 Binary files /dev/null and b/public/images/vlicon/graph.png differ diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css index a086889f1..9e0e07a77 100644 --- a/public/stylesheets/repository.css +++ b/public/stylesheets/repository.css @@ -214,7 +214,7 @@ .recordBanner {width:670px; height:30px; background-color:#f1f1f1; color:#666666; line-height:30px; vertical-align:middle;} .vl_copy {background:url(../images/vlicon/clone_url.png) 0px 0px no-repeat; padding-left:22px;} .vl_copy2 {background:url(../images/vlicon/clone_url.png) 0px 0px no-repeat; padding-left:22px;} -.vl_zip {background:url(../images/vlicon/download_icon.png) 0px 0px no-repeat; padding-left:22px;} +.vl_zip {background:url(../images/vlicon/graph.png) 0px 2px no-repeat; padding-left:22px;} .vl_fork {background:url(../images/vlicon/fork_icon.png) 0px -2px no-repeat; padding-left:22px;} .vl_commit {background:url(../images/vlicon/commit_icon.png) 0px -2px no-repeat; padding-left:22px;weight:20px;height: 24px;} .vl_branch {background:url(../images/vlicon/branch_icon.png) 0px -2px no-repeat; padding-left:22px}