summaryrefslogtreecommitdiff
path: root/app/views/admin/projects/show.html.haml
blob: cc83add6db4245569c24eaf79f3fb76b9cddd263 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
- unless notice.nil?
  %p#notice= notice


%h2= @admin_project.name

%table.round-borders
  %tr
    %td
      %b
        Name:
    %td
      = @admin_project.name    
  %tr
    %td
      %b
        Code:
    %td
      = @admin_project.code
  %tr
    %td
      %b
        Path:
    %td
      = @admin_project.path
  %tr
    %td
      %b
        Description:
    %td
      = @admin_project.description
  %tr
    %td{:colspan => 2}
      = link_to 'Edit', edit_admin_project_path(@admin_project), :class => "grey-button"


.span-14

  %h2 Team

  = form_tag team_update_admin_project_path(@admin_project), :class => "bulk_import", :method => :put  do 
    %table
      %thead
        %tr
          %th Users
          %th Project Access:
          %th Repo Access:

      %tr
        %td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name),  :multiple => true
        %td= select_tag :project_access, options_for_select(Project.access_options), :class => "project-access-select"
        %td= select_tag :repo_access, options_for_select(Repository.access_options), :class => "repo-access-select"

      %tr
        %td{ :colspan => 3 }
          = submit_tag 'Add', :class => "positive-button"

  %table.round-borders
    %thead
      %tr
        %th Name
        %th Added
        %th Project Access
        %th Repository Access
        %th

    - @admin_project.users_projects.each do |tm|
      %tr
        %td
          = link_to tm.user_name, admin_team_member_path(tm)
        %td= time_ago_in_words(tm.updated_at) + " ago"
        %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), :class => "project-access-select", :disabled => :disabled
        %td= select_tag :tm_repo_access, options_for_select(Repository.access_options, tm.repo_access), :class => "repo-access-select", :disabled => :disabled
        %td= link_to 'Destroy', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete

:css 
  form select { 
    width:150px;
  }

  #user_ids {
    width:300px;
  }

  
:javascript 
  $('select#user_ids').chosen();
  $('select#repo_access').chosen();
  $('select#project_access').chosen();