_form.html.haml 1.88 KB
Newer Older
gitlabhq's avatar
gitlabhq committed
1 2
= form_for [:admin, @admin_project] do |f|
  -if @admin_project.errors.any?
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
3
    .alert-message.block-message.error
gitlabhq's avatar
gitlabhq committed
4 5 6 7
      %ul
        - @admin_project.errors.full_messages.each do |msg|
          %li= msg

8
  .clearfix
9
    = f.label :name
10 11
    .input= f.text_field :name
  .clearfix
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
12 13 14 15
    = f.label :path do 
      Path
    .input
      .input-prepend
16
        %span.add-on= "#{GIT_HOST["git_user"]}@#{GIT_HOST["host"]}:"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
17
        = f.text_field :path, :placeholder => "example_project", :disabled => !@admin_project.new_record?
18
  .clearfix
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
19 20 21 22
    = f.label :code do 
      Code
    .input
      .input-prepend
23
        %span.add-on= web_app_url
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
24
        = f.text_field :code, :placeholder => "example"
25

26 27 28 29
  - unless @admin_project.new_record?
    .clearfix
      = f.label :owner_id
      .input= f.select :owner_id, User.all.map { |user| [user.name, user.id] }
30

31
    - if @admin_project.repo_exists?  
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
      .clearfix
        = f.label :default_branch, "Default Branch"
        .input= f.select(:default_branch, @admin_project.heads.map(&:name), {}, :style => "width:210px;")

    .well
      %h5 Features

      .clearfix
        = f.label :issues_enabled, "Issues"
        .input= f.check_box :issues_enabled

      .clearfix
        = f.label :merge_requests_enabled, "Merge Requests"
        .input= f.check_box :merge_requests_enabled

      .clearfix
        = f.label :wall_enabled, "Wall"
        .input= f.check_box :wall_enabled

51
  .clearfix
52
    = f.label :description
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
53
    .input= f.text_area :description, :class => "xxlarge"
gitlabhq's avatar
gitlabhq committed
54
  .clear
55
  %br
gitlabhq's avatar
gitlabhq committed
56
  .actions
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
57 58 59
    = f.submit 'Save', :class => "btn primary"
    = link_to 'Cancel', [:admin, @admin_project], :class => "btn"
    = link_to 'Destroy', [:admin, @admin_project], :confirm => 'Are you sure?', :method => :delete, :class => "btn danger right"
60 61 62 63

:javascript
  $(function(){
    taggifyForm();
64
    $('#project_owner_id').chosen();
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
65
    $('#project_default_branch').chosen();
66
  })