26 lines
866 B
Plaintext
26 lines
866 B
Plaintext
<div class="project_r_h">
|
|
<h2 class="project_h2"><%= l(:label_repository_new_repos) %></h2>
|
|
</div>
|
|
<script type="text/javascript">
|
|
//var re=new RegExp(strRegex);
|
|
function createVersion(){
|
|
var re =new RegExp("^(https|http|file|svn)[?:]{1}/{1}/{1}.*$");
|
|
var strRegex = /^([https|http|file|svn]:){1}.*$/;
|
|
var name = $("#url_text_field").val();
|
|
if(name == "")
|
|
{
|
|
alert("URL不能为空");
|
|
return;
|
|
}
|
|
else if(!re.test(name))
|
|
{
|
|
alert("URL路径不正确");
|
|
return;
|
|
}
|
|
$("#repository-form").submit();
|
|
}
|
|
</script>
|
|
<%= labelled_form_for :repository, @repository, :url => project_repositories_path(@project), :html => {:id => 'repository-form'} do |f| %>
|
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
|
<% end %>
|