From 4b7ff015309ef2799a4d074e9cf07f49af0cc253 Mon Sep 17 00:00:00 2001
From: nigel007 <609441862@qq.com>
Date: Fri, 14 Jun 2019 08:56:33 +0800
Subject: [PATCH] change contribution tab

---
 app/controllers/contributions_controller.rb |  4 +-
 app/controllers/repositories_controller.rb  |  2 +-
 app/views/contributions/show.html.erb       | 70 +--------------------
 3 files changed, 4 insertions(+), 72 deletions(-)

diff --git a/app/controllers/contributions_controller.rb b/app/controllers/contributions_controller.rb
index cba11358f..768d73d9a 100644
--- a/app/controllers/contributions_controller.rb
+++ b/app/controllers/contributions_controller.rb
@@ -29,7 +29,7 @@ class InvalidRevisionParam < Exception; end
 
 class ContributionsController < ApplicationController
   include ApplicationHelper
-  menu_item :repository
+  menu_item :contribution
   menu_item :settings, :only => [:new, :create, :edit, :update, :destroy, :committers]
   default_search_scope :changesets
 
@@ -537,7 +537,7 @@ update
       #   update_commits_date(@project, @changesets_latest_coimmit)
       # end
 
-      render :layout => 'base_projects'
+      render :action => 'show', :layout => 'base_projects'
     end
   end
 
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 2ce1f6c23..0157414e4 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -537,7 +537,7 @@ update
           update_commits_date(@project, @changesets_latest_coimmit)
         end
 
-        render :action => 'show', :layout => 'base_projects'
+        render :layout => 'base_projects'
       end
     end
 
diff --git a/app/views/contributions/show.html.erb b/app/views/contributions/show.html.erb
index 32860cad6..393014731 100644
--- a/app/views/contributions/show.html.erb
+++ b/app/views/contributions/show.html.erb
@@ -1,70 +1,2 @@
-<div class="wrap-big">
-  <div class="repository_con" style="line-height:1.9;">
-    <ul class="clearfix pro-top-info mb10">
-      <li><i class="icon-time mr5 c_grey02 f16 fb"></i>
-        <%=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}"}, :class => "linkBlue fb" %> 提交
-      </li>
-      <li><i class="icon-sitemap mr5 c_grey02 f16 fb"></i>
-        <a class="linkBlue fb "><%= @repository.branches.count %></a>分支
-      </li>
-      <li><i class="icon-bar-chart mr5 c_grey02 f16 fb"></i>
-        <%=link_to "贡献统计", stats_repository_project_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev,
-                                                         :creator => @creator, :default_branch => @g_default_branch ) %>
-      </li>
-    </ul>
-    <div class=" clearfix mb5">
-      <div class=" fl clearfix">
-        <%= render :partial => 'navigation' %>
-      </div>
-      <a href="<%= @zip_path %>" class="btn_zipdown fl ml10" onclick="">ZIP下载</a>
-      <% if !@entries.blank? && User.current.member_of?(@project) && @project.is_public? %>
-        <% if quality_analysis(User.current.try(:login), @repository.id).nil?  %>
-          <%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "1"), :remote => true, :class => "btn_zipdown fl ml10" %>
-        <% else %>
-          <%= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fl ml10" %>
-        <% end %>
-      <% end %>
-      <% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %>
-        <%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fl ml10" %>
-      <% end %>
 
-      <div class="fr ">
-        <label class="pro-fenzhi-label fl">克隆网址</label>
-        <input type="text" id="copy_rep_content" class="pro-fenzhi-input fl" value="<%= @repos_url.to_s.lstrip %>"/>
-        <a href="javascript:void(0);" alt="点击复制版本库地址" onclick="jsCopy()" title="点击复制版本库地址" class="fl pro-fenzhi-a"><i class="icon-copy"></i></a>
-      </div>
-    </div>
-
-    <div class="cl"></div>
-    <%= render :partial => 'latest_commit' %>
-    <div class="cl"></div>
-
-    <% if !@entries.blank? && authorize_for('repositories', 'browse') %>
-      <%= render :partial => 'dir_list' %>
-    <% else %>
-      <%= render :partial => "projects/no_data" %>
-    <% end %>
-
-    <% memo = Memo.where(:id => 1232).first %>
-    <% unless memo.nil? %>
-      <a href="<%= Setting.protocol + "://" %><%=Setting.host_name %>/forums/1/memos/1232" class="linkBlue2" target="_blank">如何提交代码</a>
-    <% end %>
-    <% unless @entries.blank? %>
-      <div class="fr">
-        <a style="color: #7f7f7f;">导出统计结果:</a>
-        <%= link_to "最近一周", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "week"  }, :class => "linkBlue2" %> <a style="color: #7f7f7f;">|</a>
-        <%= link_to "最近一月", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "month" }, :class => "linkBlue2" %>
-      </div>
-      <div class="cl"></div>
-    <% end %>
-    <%#= link_to "导出excel", {:controller => 'repositories', :action => 'export_rep_static', :rev => @rev}, :format => 'xls' %>
-    <!--<a href="<%#=project_issues_path(:project_id => @project, :format => 'xls')%>" class="hw_btn_blue  fr" alt="导出EXCEL">导出EXCEL</a>-->
-  </div>
-</div>
-<%# content_for :header_tags do %>
-<%#= stylesheet_link_tag "scm" %>
-<%# end %>
-
-<% html_title(l(:label_repository)) -%>
+<% html_title(l(:label_contribution)) -%>