2015-04-16 14:59:05 +08:00
|
|
|
|
<script>
|
|
|
|
|
function pro_st_show_ku()
|
|
|
|
|
{
|
|
|
|
|
$("#pro_st_edit_ku").toggle();
|
|
|
|
|
}
|
|
|
|
|
</script>
|
2015-04-17 12:44:27 +08:00
|
|
|
|
<%= str = error_messages_for 'repository' %>
|
2015-04-13 18:27:05 +08:00
|
|
|
|
<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %>
|
|
|
|
|
<% ip = RepositoriesHelper::REPO_IP_ADDRESS %><!--Added by tanxianbo For formatting project's path-->
|
2015-11-02 19:14:55 +08:00
|
|
|
|
<%# 提示 %>
|
|
|
|
|
<% if @project.repositories.count>1 %>
|
|
|
|
|
<div class="flash notice">
|
|
|
|
|
项目管理员您好!近日平台完成了版本库升级,以后每个项目将唯一的对应一个版本库。请您按照以下步骤完成项目版本库的更新:
|
|
|
|
|
<p>1. 点击下面的"创建版本库按钮",为本项目创建一个新的版本库;</p>
|
2015-11-02 19:27:23 +08:00
|
|
|
|
<p>2. 从本项目的历史版本库中选择一个您将使用的版本库,将其完整的克隆(clone)到本地(需要提供您之前设置的版本库口令),然后推送(push)到新建的版本库(注意不能仅推送代码,否则之前各开发者的提交记录将丢失)。</p>
|
2015-11-02 19:14:55 +08:00
|
|
|
|
<p>3. 本项目的历史版本库将在您新建版本库的一周内自动隐藏,如果您以后需要这些版本库,请与网站联系,我们将为您提供这些版本库的所有数据。</p>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2015-11-02 15:04:17 +08:00
|
|
|
|
<%# 新建版本库 %>
|
2015-11-02 16:41:15 +08:00
|
|
|
|
<% if @project.repositories.count == 0 || rep_is_gitlab?(@project) %>
|
|
|
|
|
<div style="padding-bottom: 40px">
|
2015-11-02 15:04:17 +08:00
|
|
|
|
<a href="javascript:viod(0)" class="pic_add fl mr5" onclick="pro_st_show_ku();"></a>
|
|
|
|
|
<a href="javascript:viod(0)" class="c_blue fl" onclick="pro_st_show_ku();">
|
|
|
|
|
<% course_tag = @project.project_type %>
|
|
|
|
|
<% if User.current.allowed_to?(:manage_repository, @project) %>
|
|
|
|
|
<!--newrepo_project_repository_path(@project, :course => course_tag) -->
|
|
|
|
|
<%= link_to l(:label_repository_new_repos),"#" , :onclick=>"pro_st_show_ku();", :class => 'c_blue fl' %></p>
|
|
|
|
|
<% end %>
|
|
|
|
|
</a>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
|
|
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %>
|
|
|
|
|
<div id="pro_st_edit_ku" class="pro_st_edit_ku">
|
|
|
|
|
<ul>
|
2015-11-02 16:41:15 +08:00
|
|
|
|
<li style="display: none">
|
2015-11-02 15:04:17 +08:00
|
|
|
|
<label class="label02"><%=l(:label_scm)%>:</label>
|
|
|
|
|
<%= select_tag('repository_scm',
|
|
|
|
|
options_for_select(["Git"],@repository.class.name.demodulize),
|
2015-11-02 16:41:15 +08:00
|
|
|
|
:data => {:remote => true, :method => 'get'}) %>
|
2015-11-02 15:04:17 +08:00
|
|
|
|
<% if @repository && ! @repository.class.scm_available %>
|
|
|
|
|
<span class="c_grey"><%= l(:text_scm_command_not_available) %></span>
|
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
|
|
|
|
<li >
|
|
|
|
|
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
|
|
|
|
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
2015-11-02 19:20:59 +08:00
|
|
|
|
<span class="f14"><span class="c_red">*</span><%=l(:label_repository_name)%>:</span>
|
2015-11-02 15:04:17 +08:00
|
|
|
|
<%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
|
|
|
|
|
<% unless @repository.identifier_frozen? %>
|
|
|
|
|
<span class="c_grey"><%=l(:text_length_between,:min=>1,:max=>254)<<l(:text_project_identifier_info) %></span>
|
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</ul>
|
2015-11-02 19:20:59 +08:00
|
|
|
|
<a href="#" onclick="$('#repository-form').submit();" class="blue_btn fl "><%=l(:lable_project_rep_create) %></a>
|
|
|
|
|
<a href="<%= settings_project_path(@project, :tab => 'repositories')%>" class="grey_btn fl "><%=l(:button_cancel)%></a>
|
2015-11-02 15:04:17 +08:00
|
|
|
|
</div><!--pro_st_edit_issues end-->
|
|
|
|
|
<% end %>
|
2015-11-02 16:41:15 +08:00
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
2015-11-02 15:04:17 +08:00
|
|
|
|
|
|
|
|
|
|
2015-11-02 16:41:15 +08:00
|
|
|
|
<% if @project.repositories.any? %>
|
|
|
|
|
<%= render :partial => 'projects/settings/rep_gitlab', :locals => {:project => @project, :ip => "ip", :project_path_cut => "project_path_cut" } %>
|
|
|
|
|
<%#= render :partial => 'projects/settings/rep_forge', :locals => {:project => @project, :ip => "ip", :project_path_cut => "project_path_cut" } %>
|
|
|
|
|
<div class="rep_history_title">历史版本库</div>
|
|
|
|
|
<table class="pro_table">
|
|
|
|
|
<tbody>
|
|
|
|
|
<% rep_forge(@project).sort.each do |repository| %>
|
|
|
|
|
<tr class="<%= cycle 'pro_table_on_forge', '' %>">
|
|
|
|
|
<td class="w150"><span class="rep_history_grey" title="<%= repository.identifier %>">
|
2015-11-02 13:53:35 +08:00
|
|
|
|
<%= repository.identifier %></span></td>
|
2015-11-02 16:41:15 +08:00
|
|
|
|
<td class="w150"><span class="rep_history_grey"><%=h repository.scm_name %></span></td>
|
|
|
|
|
<%if repository.scm_name=="Git"%>
|
2015-11-05 14:31:43 +08:00
|
|
|
|
<% rep_url = "http://" + repository.login.to_s + '_'+ repository.identifier.to_s + "@" + ip.to_s + h( repository.url.slice(project_path_cut, repository.url.length)) %>
|
2015-11-06 14:57:16 +08:00
|
|
|
|
<td class="w362 pl5" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis; text-align: left">
|
2015-11-02 13:53:35 +08:00
|
|
|
|
<span class="rep_history_grey">
|
2015-11-05 14:31:43 +08:00
|
|
|
|
<textarea id="copy_rep_content2_<%= repository.id %>" class="cloneUrl2 fl" type="input" ><%= rep_url %></textarea>
|
|
|
|
|
<a href="javascript:void(0);" onclick="jsCopy2(<%= repository.id %>)"><span class="vl_copy2" title="点击复制版本库地址"></span></a>
|
|
|
|
|
<%#= rep_url %>
|
2015-11-02 13:53:35 +08:00
|
|
|
|
</span>
|
2015-11-02 16:41:15 +08:00
|
|
|
|
</td><!--Modified by tanxianbo-->
|
|
|
|
|
<%else %>
|
|
|
|
|
<td class="w360" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h truncate(repository.url,:length=>10) %></td>
|
|
|
|
|
<% end %>
|
|
|
|
|
</tr>
|
|
|
|
|
<% end %>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<% else %>
|
|
|
|
|
<p class="nodata">温馨提示:<%= l(:label_repository_no_data) %></p>
|
|
|
|
|
<% end %>
|
2015-04-11 16:17:36 +08:00
|
|
|
|
|
2015-04-16 14:59:05 +08:00
|
|
|
|
|
2015-10-14 17:37:22 +08:00
|
|
|
|
|
|
|
|
|
|