_form.html.haml 1.72 KB
Newer Older
1
= form_for(@project, remote: true) do |f|
2 3 4
  - if @project.errors.any?
    .alert-message.block-message.error
      %ul
5 6
        - @project.errors.full_messages.each do |msg|
          %li= msg
7 8 9
  .clearfix.project_name_holder
    = f.label :name do
      Project name is
10
    .input
11
      = f.text_field :name, placeholder: "Example Project", class: "xxlarge"
12 13
  %fieldset
    %legend  Advanced settings:
14
    .control-group
15
      = f.label :path do
16
        Path
17 18 19 20 21 22 23 24 25 26 27 28
      .controls
        = text_field_tag :ppath, @project.path_to_repo, class: "xlarge", disabled: true

    .control-group
      = f.label :namespace_id do
        %span Namespace
      .controls
        = f.select :namespace_id, namespaces_options(@project.namespace_id), {}, {class: 'chosen'}
         
        %span.cred Be careful. Changing project namespace can have unintended side effects

    - unless @project.heads.empty?
29 30
      .clearfix
        = f.label :default_branch, "Default Branch"
31
        .input= f.select(:default_branch, @project.heads.map(&:name), {}, style: "width:210px;")
32

33 34
  %fieldset
    %legend Features:
35

36 37 38
    .clearfix
      = f.label :issues_enabled, "Issues"
      .input= f.check_box :issues_enabled
39

40 41 42
    .clearfix
      = f.label :merge_requests_enabled, "Merge Requests"
      .input= f.check_box :merge_requests_enabled
43

44 45 46
    .clearfix
      = f.label :wall_enabled, "Wall"
      .input= f.check_box :wall_enabled
47

48 49 50
    .clearfix
      = f.label :wiki_enabled, "Wiki"
      .input= f.check_box :wiki_enabled
51

52
  %br
53

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
54
  .actions
55
    = f.submit 'Save', class: "btn save-btn"
56
    = link_to 'Cancel', @project, class: "btn"
57 58
    - unless @project.new_record?
      .right
59
        = link_to 'Remove', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger"