summaryrefslogtreecommitdiff
path: root/app/views/admin/users/show.html.haml
blob: 4cca8ed7a4ec6bca22cf7f69d167d98cf039434a (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
%h3
  = @admin_user.name
  - if @admin_user.blocked
    %small Blocked
  - if @admin_user.admin
    %small Administrator
  = link_to 'Edit', edit_admin_user_path(@admin_user), class: "btn small right"

%br

%table.zebra-striped.table-bordered
  %tr
    %td
      %b
        Email:
    %td
      = @admin_user.email
  %tr
    %td
      %b
        Admin:
        %td= check_box_tag "admin", 1, @admin_user.admin, disabled: :disabled
  %tr
    %td
      %b
        Blocked:
        %td= check_box_tag "blocked", 1, @admin_user.blocked, disabled: :disabled
  %tr
    %td
      %b
        Projects limit:
    %td
      = @admin_user.projects_limit
  - unless @admin_user.skype.empty?
    %tr
      %td
        %b
          Skype:
      %td
        = @admin_user.skype
  - unless @admin_user.linkedin.empty?
    %tr
      %td
        %b
          Linkedin:
      %td
        = @admin_user.linkedin
  - unless @admin_user.twitter.empty?
    %tr
      %td
        %b
          Twitter:
      %td
        = @admin_user.twitter

%br
%h3 Add User to Projects
%br
= form_tag team_update_admin_user_path(@admin_user), class: "bulk_import", method: :put  do
  %table.table-bordered
    %thead
      %tr
        %th Projects
        %th Project Access:

    %tr
      %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name),  multiple: true
      %td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select"

    %tr
      %td= submit_tag 'Add', class: "btn primary"
      %td
        Read more about project permissions
        %strong= link_to "here", help_permissions_path, class: "vlink"
%br

- if @admin_user.projects.present?
  %h3 Projects
  %br

  %table.zebra-striped.table-bordered
    %tr
      %thead
        %th Name
        %th Project Access
        %th
        %th

    - @admin_user.users_projects.each do |tm|
      - project = tm.project
      %tr
        %td= link_to project.name, admin_project_path(project)
        %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), class: "medium project-access-select", disabled: :disabled
        %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small"
        %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn small danger"

:css
  form select {
    width:150px;
  }

  #project_ids {
    width:300px;
  }

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