-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move group members' table to a partial
The show file is a bit more readable now.
- Loading branch information
Showing
2 changed files
with
24 additions
and
23 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/api/app/views/webui2/shared/_group_members_table.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.obs-dataTable | ||
%table.table.table-striped.table-bordered.w-100#group-members-table | ||
%thead | ||
%tr | ||
%th Login Name | ||
%th | ||
%tbody | ||
- if group.users.any? | ||
- group.users.each do |user| | ||
%tr | ||
%td= link_to(user, user_show_path(user)) | ||
%td.text-nowrap | ||
= link_to('#', data: { toggle: 'modal', target: "#delete-group-user-#{user.id}-modal" }) do | ||
%i.fas.fa-times-circle.text-danger{ title: "Remove user '#{user}' from '#{group}' group." } | ||
= render(partial: 'remove_user_modal', locals: { group: group, user: user }) | ||
- else | ||
%tr | ||
%td{ colspan: 2 } This group does not contain users. | ||
- if policy(group).update? | ||
= link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#add-user-modal' }, id: 'add-user') do | ||
%i.fas.fa-plus-circle.text-primary | ||
Add User | ||
= render(partial: 'add_user_modal', locals: { group: group }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters