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

26 lines
866 B
Plaintext
Raw Normal View History

<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_repository_new_repos) %></h2>
</div>
2014-08-07 11:20:24 +08:00
<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 %>