解决部分项目(比如:594)切换版本库分支500问题
This commit is contained in:
parent
0070bed92b
commit
0629b31e53
|
@ -410,23 +410,21 @@ update
|
|||
if request.xhr?
|
||||
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
|
||||
else
|
||||
unless @entries.blank?
|
||||
@changesets_latest_coimmit = @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path)
|
||||
# @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path)
|
||||
# 总的提交数
|
||||
@changesets_all_count = @g.user_static(@project.gpid, :rev => @rev).count
|
||||
# 获取默认分支
|
||||
@g_default_branch = @g_project.default_branch.nil? ? "master" : @g_project.default_branch
|
||||
@changesets_latest_coimmit = @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path)
|
||||
# @g.rep_last_changes(@project.gpid, :rev => @rev, :path => @path)
|
||||
# 总的提交数
|
||||
@changesets_all_count = @g.user_static(@project.gpid, :rev => @rev).count
|
||||
# 获取默认分支
|
||||
@g_default_branch = @g_project.default_branch.nil? ? "master" : @g_project.default_branch
|
||||
|
||||
@creator = @project.owner.to_s
|
||||
gitlab_address = Redmine::Configuration['gitlab_address']
|
||||
gitlab_token = Gitlab.private_token
|
||||
# token值加密解密
|
||||
token = aes_encrypt("priEn3UwXfJs3Pmy", gitlab_token)
|
||||
# token值解密
|
||||
# gitlab_token = aes_dicrypt("priEn3UwXfJs3Pmy", token)
|
||||
@zip_path = Gitlab.endpoint.to_s + "/projects/" + @project.gpid.to_s + "/repository/archive?&private_token=" + token
|
||||
end
|
||||
@creator = @project.owner.to_s
|
||||
gitlab_address = Redmine::Configuration['gitlab_address']
|
||||
gitlab_token = Gitlab.private_token
|
||||
# token值加密解密
|
||||
token = aes_encrypt("priEn3UwXfJs3Pmy", gitlab_token)
|
||||
# token值解密
|
||||
# gitlab_token = aes_dicrypt("priEn3UwXfJs3Pmy", token)
|
||||
@zip_path = Gitlab.endpoint.to_s + "/projects/" + @project.gpid.to_s + "/repository/archive?&private_token=" + token
|
||||
|
||||
@creator = @project.owner.to_s
|
||||
gitlab_address = Redmine::Configuration['gitlab_address']
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<div class="recordBanner mt3">
|
||||
<% if @changesets_latest_coimmit %>
|
||||
<% if @changesets_latest_coimmit && @changesets_latest_coimmit.try(:time) %>
|
||||
<div class="recordBanner mt3">
|
||||
<%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.try(:author_email))), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %>
|
||||
<%= link_to_user_mail(@changesets_latest_coimmit.try(:author_email), "fb fontGrey3 mr5 fl hidden maxwidth150 ml5") %>
|
||||
<div class="fl">提交于 <%= time_tag(@changesets_latest_coimmit.try(:time)) %> 前:</div>
|
||||
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.message %>"><%= @changesets_latest_coimmit.message %></div>
|
||||
<% end %>
|
||||
<% if @entry && @entry.kind == 'file' %>
|
||||
<%= render :partial => 'link_to_functions' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if @entry && @entry.kind == 'file' %>
|
||||
<%= render :partial => 'link_to_functions' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
|
@ -1,86 +1,70 @@
|
|||
<%#= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
|
||||
<div class="wrap-big">
|
||||
<div class="repository_con" style="line-height:1.9;">
|
||||
<% if @entries.nil? %>
|
||||
<%# 未提交代码提示 %>
|
||||
<div class=" repository-url light-well">
|
||||
<% if @entries.nil? && authorize_for('repositories', 'browse') %>
|
||||
<div class="page-title">
|
||||
该版本库还没有上传代码!
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @repository.type.to_s == "Repository::Gitlab" %>
|
||||
版本库地址:<%= @repos_url %>
|
||||
<% else %>
|
||||
版本库地址:<%= h @repository.url %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<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 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>
|
||||
<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 %>
|
||||
|
||||
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<%#= 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" %>
|
||||
<%#= stylesheet_link_tag "scm" %>
|
||||
<%# end %>
|
||||
|
||||
<% html_title(l(:label_repository)) -%>
|
||||
|
|
Loading…
Reference in New Issue