socialforge/app/views/shixuns/_settings_repository.html.erb

83 lines
2.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="task-pd15-box task-setting-tab">
<div class="alert alert-blue mb15" id="warning_frame">
<button data-dismiss="alert" class="task-close fr" type="button" onclick="close_waring_frame();">×</button>
温馨提示:每个项目只能创建一个版本库。
</div>
<%= error_messages_for 'project' %>
<% if @repository.nil? %>
<div class=" sy_new_tchbox clear" style="margin-left:0; margin-right:0;" >
<%= labelled_form_for :repository, @repository, :url => shixun_repositories_path(@shixun), :html => {:method => "post", :autocomplete => 'off'} do |f| %>
<ul class="pro_newsetting_con mb15" >
<li class="mb10 clear">
<label class=" fl" style="line-height:40px;"><span class="c_red f12">*</span>&nbsp;版本库名称&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :identifier, :no_label => true, :class => "panel-form-width-690 panel-form-height-30 fl", :style => "width:830px;", :id => "shixun_identifier" %>
<span style="display: none" class="c_orange ml100" id="valid_repository_name">版本库名是无效的</span>
</li>
<li class="clear">
<label class=" fl" style="width:100px;">&nbsp;&nbsp;</label>
<p class=" fl c_grey pro_new_grey">1.长度必须在1到254个字符之间<br/>
2.仅限使用小写字母a-z、数字、破折号-和下划线_<br>
3.一旦保存,标识无法修改</p>
</li>
</ul>
<a href="javascript:void(0)" onclick="project_repository_commit();" class=" task-btn task-btn-green fr">保存</a>
<a href="javascript:void(0)" onclick="cancel_for_create();" class=" task-btn fr mr10">取消</a>
<% end %>
</div>
<% else %>
<table class="sy_new_table" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>版本库名</th>
<th>管理系统</th>
<th>库路径</th>
</tr>
</thead>
<tbody>
<tr>
<th><%= @repository.identifier %></th>
<th>Git</th>
<th><%= h @repos_url %></th>
</tr>
</tbody>
</table>
<% end %>
</div>
<script>
function pro_st_show_ku()
{
$("#pro_st_edit_ku").toggle();
}
function cancel_for_create()
{
$("#shixun_identifier").val('');
}
function project_repository_commit()
{
if(regex_repoistory_name())
{
$("#new_repository").submit();
}
}
function regex_repoistory_name()
{
var name = $.trim($("#shixun_identifier").val());
if(/^[a-zA-Z0-9_\-]*[a-zA-Z_\-]+[a-zA-Z0-9_\-]*$/.test(name))
{
$("#valid_repository_name").hide();
return true;
}
else
{
$("#valid_repository_name").show();
return false;
}
}
</script>