summaryrefslogtreecommitdiff
path: root/app/views/admin/projects/_form.html.haml
blob: 84cd030ec0913bc26b910a3897ccfefed74bddb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
= form_for [:admin, @admin_project] do |f|
  -if @admin_project.errors.any?
    .alert-message.block-message.error
      %ul
        - @admin_project.errors.full_messages.each do |msg|
          %li= msg

  .clearfix
    = f.label :name
    .input= f.text_field :name
  .clearfix
    = f.label :path do 
      Path
    .input
      .input-prepend
        %span.add-on= "#{GIT_HOST["git_user"]}@#{GIT_HOST["host"]}:"
        = f.text_field :path, :placeholder => "example_project", :disabled => !@admin_project.new_record?
  .clearfix
    = f.label :code do 
      Code
    .input
      .input-prepend
        %span.add-on= web_app_url
        = f.text_field :code, :placeholder => "example"

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

    - if @admin_project.repo_exists?  
      .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

  .clearfix
    = f.label :description
    .input= f.text_area :description, :class => "xxlarge"
  .clear
  %br
  .actions
    = 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"

:javascript
  $(function(){
    taggifyForm();
    $('#project_owner_id').chosen();
    $('#project_default_branch').chosen();
  })