版本库统计show权限统计

This commit is contained in:
huang 2016-04-14 13:39:19 +08:00
parent c87611dfec
commit 2a00c4ddd7
3 changed files with 4 additions and 2 deletions

View File

@ -320,7 +320,7 @@ class ProjectsController < ApplicationController
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc").page(params['page'|| 1]).per(10);
end
g = Gitlab.client
unless @project.gpid.nil?
unless @project.gpid.nil? || @project.project_score.changeset_num == 0
@static_total_per_user = g.rep_stats(@project.gpid)
end
# 根据对应的请求,返回对应的数据

View File

@ -29,12 +29,14 @@
<!--CONTENT LIST-->
</div>
<% unless @project.gpid.nil? || @project.project_score.changeset_num == 0 %>
<div class="resources mt10">
<div class="homepagePostBrief">
<%= render :partial => "rep_static" %>
<div class="cl"></div>
</div>
</div>
<% end %>
<%= render :partial => "project_activities", :locals => {:forge_acts => @events_pages, :page => 0, :type => @type} %>
</div>

View File

@ -25,7 +25,7 @@
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%= @repository.type.to_s=="Repository::Gitlab" ? @repos_url.to_s.lstrip : @repository.url %></textarea>
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
<div class="fl mt5 ml15">
<%=link_to "统计", stats_repository_project_path(:id => @project, :repository_id => @repository.identifier_param, :rev => @rev, :creator => @creator ), :class => "fl vl_zip" %>
<%=link_to "统计", stats_repository_project_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :creator => @creator ), :class => "fl vl_zip" %>
</div>
<%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %>
<% if User.current.id != @project.user_id %>