2011-12-30 07:54:42 +01:00
|
|
|
= render "project_head"
|
2012-01-28 15:47:55 +01:00
|
|
|
%h3 Edit Project
|
|
|
|
%hr
|
|
|
|
= render "projects/form"
|
2011-12-30 07:54:42 +01:00
|
|
|
%div{ :class => "ajax_loader", :style => "display:none;height:200px;"}
|
|
|
|
%center
|
|
|
|
= image_tag "ajax-loader.gif", :class => "append-bottom"
|
2012-01-28 15:47:55 +01:00
|
|
|
%h3.prepend-top Saving project & repository. Please wait...
|
2011-12-30 07:54:42 +01:00
|
|
|
|
|
|
|
:javascript
|
2012-01-28 15:47:55 +01:00
|
|
|
$(function(){
|
|
|
|
$("#project_name").live("change", function(){
|
|
|
|
var slug = slugify($(this).val());
|
|
|
|
$("#project_code").val(slug);
|
|
|
|
$("#project_path").val(slug);
|
|
|
|
});
|
2011-12-30 07:54:42 +01:00
|
|
|
});
|
|
|
|
|
2012-01-28 15:47:55 +01:00
|
|
|
function slugify(text) {
|
|
|
|
return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase();
|
|
|
|
}
|
|
|
|
|
2011-12-30 07:54:42 +01:00
|
|
|
$(function(){
|
2012-01-28 15:47:55 +01:00
|
|
|
$('.edit_project').live('ajax:before', function() {
|
|
|
|
$(this).hide();
|
|
|
|
$('.ajax_loader').show();
|
|
|
|
});
|
|
|
|
$('form #project_default_branch').chosen();
|
2011-12-30 07:54:42 +01:00
|
|
|
})
|