edit.html.haml 770 Bytes
Newer Older
1
= render "project_head"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2
3
4
%h3 Edit Project
%hr
= render "projects/form"
5
6
7
%div{ :class => "ajax_loader",  :style => "display:none;height:200px;"}
  %center
    = image_tag "ajax-loader.gif", :class => "append-bottom"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
8
    %h3.prepend-top Saving project & repository. Please wait...
9
10

:javascript
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
11
12
13
14
15
16
  $(function(){
    $("#project_name").live("change", function(){
      var slug = slugify($(this).val());
      $("#project_code").val(slug);
      $("#project_path").val(slug);
    });
17
18
  });

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
19
20
21
22
  function slugify(text) {
    return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase();
  }

23
  $(function(){
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
24
25
26
27
28
    $('.edit_project').live('ajax:before', function() {
      $(this).hide();
      $('.ajax_loader').show();
    });
    $('form #project_default_branch').chosen();
29
  })