diff --git a/src/api/app/controllers/webui/groups_controller.rb b/src/api/app/controllers/webui/groups_controller.rb index b1a4c3d41f1a..f97a08a38902 100644 --- a/src/api/app/controllers/webui/groups_controller.rb +++ b/src/api/app/controllers/webui/groups_controller.rb @@ -8,7 +8,9 @@ def index @groups = Group.all.includes(:groups_users, :users) end - def show; end + def show + switch_to_webui2 + end def new authorize Group, :create? diff --git a/src/api/app/views/webui2/webui/groups/_breadcrumb_items.html.haml b/src/api/app/views/webui2/webui/groups/_breadcrumb_items.html.haml new file mode 100644 index 000000000000..f8ed28446e07 --- /dev/null +++ b/src/api/app/views/webui2/webui/groups/_breadcrumb_items.html.haml @@ -0,0 +1,5 @@ += render partial: 'webui/main/breadcrumb_items' +%li.breadcrumb-item + = link_to 'Groups', groups_path +%li.breadcrumb-item.active{ 'aria-current' => 'page' } + = @group diff --git a/src/api/app/views/webui2/webui/groups/show.html.haml b/src/api/app/views/webui2/webui/groups/show.html.haml new file mode 100644 index 000000000000..beea3b5a1144 --- /dev/null +++ b/src/api/app/views/webui2/webui/groups/show.html.haml @@ -0,0 +1,56 @@ +- @pagetitle = "Group #{@group.title}" + +.card + %div + %ul.nav.nav-tabs.pt-2.px-3.flex-nowrap.collapsible{ 'role': 'tablist' } + %li.nav-item + %a.active.nav-link.text-nowrap{ aria: { controls: 'reviews-in', selected: 'true' }, + data: { toggle: 'tab' }, href: '#reviews-in', role: 'tab' } + Incoming Reviews + %li.nav-item + %a.nav-link.text-nowrap{ aria: { controls: 'requests-in' }, data: { toggle: 'tab' }, href: '#requests-in', role: 'tab' } + Incoming Requests + %li.nav-item + %a.nav-link.text-nowrap{ aria: { controls: 'all-requests' }, data: { toggle: 'tab' }, href: '#all-requests', role: 'tab' } + All Requests + %li.nav-item + %a.nav-link.text-nowrap{ aria: { controls: 'group-members' }, data: { toggle: 'tab' }, href: '#group-members', role: 'tab' } + Group Members + + .card-body.tab-content + .tab-pane.show.active#reviews-in{ aria: { controls: 'reviews-in' }, role: 'tabpanel' } + %h3 Incoming Reviews + = render(partial: 'webui2/shared/requests_table', locals: { id: 'reviews_in_table', source_url: group_requests_path(@group) }) + + .tab-pane#requests-in{ aria: { controls: 'requests-in' }, role: 'tabpanel' } + %h3 Incoming Requests + = render(partial: 'webui2/shared/requests_table', locals: { id: 'requests_in_table', source_url: group_requests_path(@group) }) + + .tab-pane#all-requests{ aria: { controls: 'all-requests' }, role: 'tabpanel' } + %h3 All Requests + = render(partial: 'webui2/shared/requests_table', locals: { id: 'all_requests_table', source_url: group_requests_path(@group) }) + + .tab-pane#group-members{ aria: { controls: 'group-members' }, role: 'tabpanel' } + %h3 Group Members + %table.responsive.table.table-striped.table-bordered#group-members-table{ width: '100%' } + %thead + %tr + %th Login Name + %tbody + - if @group.users.any? + - @group.users.each do |user| + %tr + %td= link_to(user.login, user_show_path(user)) + - else + %tr + %td This group does not contain users. + - if User.current.is_admin? || @group.group_maintainers.where(user: User.current).exists? + = link_to group_edit_title_path(title: @group) do + %i.fas.fa-edit + Edit group members + += content_for :ready_function do + :plain + $('#group-members-table').DataTable({ + responsive: true + });