socialforge/app/views/repositories/show.html.erb

99 lines
6.2 KiB
Plaintext
Raw Normal View History

2016-07-06 16:07:17 +08:00
<%#= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
2016-09-26 11:20:49 +08:00
<div class="project_r_h" style="width:730px;">
2016-03-11 14:39:17 +08:00
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
2016-06-28 17:39:58 +08:00
<% unless @entries.nil? %>
<a href="<%= @zip_path %>" class="btn_zipdown fr" 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 fr" %>
<% 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 fr" %>
<% end %>
2016-07-01 17:50:08 +08:00
<% end %>
2016-06-28 17:39:58 +08:00
<% end %>
<!--quality_analysis-->
<% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %>
<%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fr" %>
<% end %>
2016-03-11 14:39:17 +08:00
</div>
<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 %>
2016-07-06 16:07:17 +08:00
<% if @repository.type.to_s == "Repository::Gitlab" %>
2016-03-11 14:39:17 +08:00
版本库地址:<%= @repos_url %>
<% else %>
版本库地址:<%= h @repository.url %>
<% end %>
<div class="cl"></div>
</div>
<% else %>
<%= render :partial => 'navigation' %>
<div class="fl c_grey02 mt5 mr5">克隆网址:</div>
2016-07-06 16:07:17 +08:00
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%= @repos_url.to_s.lstrip %></textarea>
2016-03-11 14:39:17 +08:00
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
2016-04-12 16:00:54 +08:00
<div class="fl mt5 ml15">
2016-04-21 10:42:06 +08:00
<%=link_to "代码统计", stats_repository_project_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :creator => @creator, :default_branch => @g_default_branch ), :class => "fl vl_zip" %>
2016-04-12 16:00:54 +08:00
</div>
2016-07-06 16:07:17 +08:00
2016-03-11 14:39:17 +08:00
<% if User.current.id != @project.user_id %>
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :target => "_blank", :confirm=>"平台将为您创建一个新的同名项目和版本库,请问是否继续?" %>
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span>
</div>
<% end %>
<div class="cl"></div>
2016-07-06 16:07:17 +08:00
2016-09-26 11:20:49 +08:00
<div class="recordBanner mt10" style="width:730px;">
2016-03-11 14:39:17 +08:00
<% if @changesets && !@changesets.empty? %>
<% 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") %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=link_to user_commit_rep(@changesets_latest_coimmit.author_email), user_path(user_commit_rep(@changesets_latest_coimmit.author_email)) %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<% else %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=@changesets_latest_coimmit.author_email %></div>
2016-03-11 14:39:17 +08:00
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<%end%>
<% end %>
<span class="fr mr5 "><font class="fb ml2 mr2 vl_branch mt2">
<%= @repository.branches.count %></font> 个分支
</span>
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
<%=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}"} %></font> 提交
</span>
</div>
<% end %>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
2016-07-06 16:37:19 +08:00
<%= render :partial => 'dir_list' %>
2016-03-11 14:39:17 +08:00
<% end %>
2016-09-28 11:43:10 +08:00
<a href="<%= Setting.protocol + "://" %><%=Setting.host_name %>/forums/1/memos/1232" >如何提交代码</a>
<div class="fr">
2016-09-27 13:37:34 +08:00
<a style="color: #7f7f7f;">导出统计结果:</a>
2016-09-27 15:10:52 +08:00
<%= link_to "最近一周", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "week" } %> <a style="color: #7f7f7f;">|</a>
<%= link_to "最近一月", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "month" } %>
</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>-->
2016-03-11 14:39:17 +08:00
</div>
2016-07-06 16:07:17 +08:00
<%# content_for :header_tags do %>
<%#= stylesheet_link_tag "scm" %>
<%# end %>
2016-03-11 14:39:17 +08:00
<% html_title(l(:label_repository)) -%>
2016-09-26 11:20:49 +08:00
<script>
$(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
2016-09-27 13:37:34 +08:00
</script>