2012-01-27 23:51:02 +01:00
|
|
|
%h3 New Project
|
|
|
|
%hr
|
|
|
|
= render 'form'
|
|
|
|
%div{ :class => "ajax_loader", :style => "display:none;height:200px;"}
|
|
|
|
%center
|
|
|
|
= image_tag "ajax-loader.gif", :class => "append-bottom"
|
|
|
|
%h3.prepend-top Creating project & repository. Please wait for few minutes
|
2012-01-07 11:53:01 +01:00
|
|
|
|
|
|
|
:javascript
|
|
|
|
$(function(){
|
2012-01-27 23:51:02 +01:00
|
|
|
$("#project_name").live("change", function(){
|
2012-01-07 11:53:01 +01:00
|
|
|
var slug = slugify($(this).val());
|
|
|
|
$("#project_code").val(slug);
|
|
|
|
$("#project_path").val(slug);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
function slugify(text) {
|
|
|
|
return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase();
|
|
|
|
}
|
2012-01-27 23:51:02 +01:00
|
|
|
|
|
|
|
$(function(){
|
|
|
|
$('.new_project').live('ajax:before', function() {
|
|
|
|
$(this).hide();
|
|
|
|
$('.ajax_loader').show();
|
|
|
|
});
|
|
|
|
$('form #project_default_branch').chosen();
|
|
|
|
})
|