_form.html.haml 2.09 KB
Newer Older
gitlabhq's avatar
gitlabhq committed
1 2
= form_for(@project, :remote => true) do |f|
  %div.form_content
gitlabhq's avatar
gitlabhq committed
3
    - unless @project.new_record?
4
      %h2.icon
gitlabhq's avatar
gitlabhq committed
5 6
        %span
        = @project.name
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
7
      .clear
gitlabhq's avatar
gitlabhq committed
8 9 10 11 12 13 14 15
    - if @project.errors.any?
      #error_explanation
        %h2
          = pluralize(@project.errors.count, "error")
          prohibited this project from being saved:
        %ul
          - @project.errors.full_messages.each do |msg|
            %li= msg
gitlabhq's avatar
gitlabhq committed
16
    %table
gitlabhq's avatar
gitlabhq committed
17 18 19 20 21 22
      %tr
        %td= f.label :name
        %td= f.text_field :name, :placeholder => "Example Project"
      %tr
        %td
          .left= f.label :path
23
          %cite.right= "git@#{GIT_HOST["host"]}:"
gitlabhq's avatar
gitlabhq committed
24 25 26
        %td
          = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
      %tr
Nihad Abbasov's avatar
Nihad Abbasov committed
27
        %td
gitlabhq's avatar
gitlabhq committed
28
          .left= f.label :code
29
          %cite.right= "http://#{GIT_HOST["host"]}/"
gitlabhq's avatar
gitlabhq committed
30
        %td= f.text_field :code, :placeholder => "example"
Aleksei Kvitinskii's avatar
Aleksei Kvitinskii committed
31

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
32
      - unless @project.new_record? || @project.heads.empty?  
33 34 35 36
        %tr
          %td= f.label :default_branch, "Default Branch"
          %td= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;")

37
      -#%tr
Aleksei Kvitinskii's avatar
Aleksei Kvitinskii committed
38 39
        %td= f.label :tag_list
        %td= f.text_area :tag_list, :placeholder => "project tags", :style => "height:50px", :id => :tag_field
gitlabhq's avatar
gitlabhq committed
40 41 42
      %tr
        %td= f.label :description
        %td= f.text_area :description, :placeholder => "project description", :style => "height:50px"
Aleksei Kvitinskii's avatar
Aleksei Kvitinskii committed
43

gitlabhq's avatar
gitlabhq committed
44
    %br
gitlabhq's avatar
gitlabhq committed
45
    .actions
gitlabhq's avatar
gitlabhq committed
46
      = f.submit :class => "button"
gitlabhq's avatar
gitlabhq committed
47 48 49 50 51 52

  %div{ :class => "ajax_loader",  :style => "display:none;height:200px;"}
    %center
      = image_tag "ajax-loader.gif", :class => "append-bottom"
      - if @project.new_record?
        %h3.prepend-top Creating project & repository. Please wait for few minutes
Nihad Abbasov's avatar
Nihad Abbasov committed
53
      - else
gitlabhq's avatar
gitlabhq committed
54
        %h3.prepend-top Updating project & repository. Please wait for few minutes
Aleksei Kvitinskii's avatar
Aleksei Kvitinskii committed
55

gitlabhq's avatar
gitlabhq committed
56
:javascript
Nihad Abbasov's avatar
Nihad Abbasov committed
57 58
  $('.new_project, .edit_project').bind('ajax:before', function() {
    $(this).find(".form_content").hide();
gitlabhq's avatar
gitlabhq committed
59
    $('.ajax_loader').show();
Nihad Abbasov's avatar
Nihad Abbasov committed
60
  });
Aleksei Kvitinskii's avatar
Aleksei Kvitinskii committed
61 62 63

:javascript
  $(function(){
64
    taggifyForm();
65
    $('form #project_default_branch').chosen();
66
  })