/
index.html.haml
76 lines (73 loc) · 3.64 KB
/
index.html.haml
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
:ruby
@pagetitle = if @token.description.blank?
'Users of the token'
else
"Users of the '#{@token.description}' token"
end
.card.mb-3
.card-body
#involved-users
%h3 Users
- if @users.present?
%table.responsive.table.table-sm.table-bordered.table-hover.w-100#user-table
%thead
%tr
%td Username
- if User.session
%td
%tbody
- @users.each do |user|
%tr
%td.align-middle
= image_tag_for(user, size: 20)
= link_to(display_name(user), user_or_group_path(user))
- if User.session
%td.text-nowrap
= link_to('#', class: 'text-light ml-auto',
data: { toggle: 'modal',
target: '#delete-user-from-token-modal',
action: token_user_path(token_id: @token.id, id: user.id),
confirmation_text: "Please confirm you want to remove this user #{user.login} from the token." }) do
%i.fa.fa-times-circle.text-danger{ title: 'Remove user from token' }
.pt-4
= render(partial: 'webui/users/tokens/users/add_user_to_token_dialog', locals: { token: @token })
= link_to('#', data: { toggle: 'modal', target: '#add-user-to-token-modal' }, id: 'add-user-to-token') do
%i.fas.fa-plus-circle.text-primary
Add User
.card-body
#involved-groups
%h3 Groups
- if @groups.present?
%table.responsive.table.table-sm.table-bordered.table-hover.w-100#group-table
%thead
%tr
%td Name
- if User.session
%td
%tbody
- @groups.each do |group|
%tr
%td.align-middle
= image_tag_for(group, size: 20)
= link_to(display_name(group), user_or_group_path(group))
- if User.session
%td.text-nowrap
= link_to('#', class: 'text-light ml-auto',
data: { toggle: 'modal',
target: '#delete-group-from-token-modal',
action: token_group_path(token_id: @token.id, id: group.id),
confirmation_text: "Please confirm you want to remove this group '#{group.title}' from the token." }) do
%i.fa.fa-times-circle.text-danger{ title: 'Remove group from token' }
.pt-4
= render(partial: 'webui/users/tokens/users/add_group_to_token_dialog', locals: { token: @token })
= link_to('#', data: { toggle: 'modal', target: '#add-group-to-token-modal' }, id: 'add-group-to-token') do
%i.fas.fa-plus-circle.text-primary
Add Group
= render DeleteConfirmationDialogComponent.new(modal_id: 'delete-user-from-token-modal',
method: :delete,
options: { remote: false,
modal_title: 'Do you really want to remove this user?' })
= render DeleteConfirmationDialogComponent.new(modal_id: 'delete-group-from-token-modal',
method: :delete,
options: { remote: false,
modal_title: 'Do you really want to remove this group?' })