Commit 1abfc073 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix performance issue for "Share project with other groups" page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 0ebfe61b
......@@ -79,6 +79,8 @@ class Dispatcher
new ProjectFork()
when 'users:show'
new User()
when 'projects:group_links:index'
new GroupsSelect()
switch path.first()
when 'admin'
......
......@@ -4,9 +4,6 @@ class Projects::GroupLinksController < Projects::ApplicationController
def index
@group_links = project.project_group_links.all
@available_groups = Group.all
@available_groups -= project.invited_groups
@available_groups -= [project.group]
end
def create
......
......@@ -20,8 +20,8 @@
%i.icon-remove
disable sharing
- if @available_groups.present?
.available-groups
.available-groups
%h4
Can be shared with
%div
......@@ -29,7 +29,7 @@
.form-group
= label_tag :group_id, 'Group', class: 'control-label'
.col-sm-10
= select_tag :group_id, options_from_collection_for_select(@available_groups, :id, :name), class: 'select2'
= groups_select_tag(:group_id)
.form-group
= label_tag :group_access, 'Max access level', class: 'control-label'
.col-sm-10
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment