Commit ccf76831 authored by Phil Hughes's avatar Phil Hughes

Updated groups member UI to match

parent a56216c8
...@@ -127,12 +127,12 @@ ...@@ -127,12 +127,12 @@
break; break;
case 'groups:group_members:index': case 'groups:group_members:index':
new gl.MemberExpirationDate(); new gl.MemberExpirationDate();
new GroupMembers(); new gl.Members();
new UsersSelect(); new UsersSelect();
break; break;
case 'projects:project_members:index': case 'projects:project_members:index':
new gl.MemberExpirationDate(); new gl.MemberExpirationDate();
new gl.ProjectMembers(); new gl.Members();
new UsersSelect(); new UsersSelect();
break; break;
case 'groups:new': case 'groups:new':
......
(function() {
this.GroupMembers = (function() {
function GroupMembers() {
$('li.group_member').bind('ajax:success', function() {
return $(this).fadeOut();
});
}
return GroupMembers;
})();
}).call(this);
((w) => { ((w) => {
w.gl = w.gl || {}; w.gl = w.gl || {};
class ProjectMembers { class Members {
constructor() { constructor() {
this.removeListeners(); this.removeListeners();
this.addListeners(); this.addListeners();
...@@ -41,5 +41,5 @@ ...@@ -41,5 +41,5 @@
} }
} }
gl.ProjectMembers = ProjectMembers; gl.Members = Members;
})(window); })(window);
= form_for @group_member, url: group_group_members_path(@group), html: { class: 'form-horizontal users-group-form' } do |f| = form_for @group_member, url: group_group_members_path(@group), html: { class: 'users-project-form users-group-form' } do |f|
.form-group .row
= f.label :user_ids, "People", class: 'control-label' .col-md-4.col-lg-6
.col-sm-10 = users_select_tag(:user_ids, multiple: true, class: 'input-full', scope: :all, email_user: true)
= users_select_tag(:user_ids, multiple: true, class: 'input-large', scope: :all, email_user: true) .help-block.append-bottom-10
.help-block
Search for users by name, username, or email, or invite new ones using their email address. Search for users by name, username, or email, or invite new ones using their email address.
.form-group .col-md-3.col-lg-2
= f.label :access_level, "Group Access", class: 'control-label' = select_tag :access_level, options_for_select(GroupMember.access_level_roles, @group_member.access_level), class: "form-control project-access-select"
.col-sm-10 .help-block.append-bottom-10
= select_tag :access_level, options_for_select(GroupMember.access_level_roles, @group_member.access_level), class: "project-access-select select2" = link_to "Read more", help_page_path("user/permissions"), class: "vlink"
.help-block about role permissions
Read more about role permissions
%strong= link_to "here", help_page_path("user/permissions"), class: "vlink"
.form-group .col-md-3.col-lg-2
= f.label :expires_at, 'Access expiration date', class: 'control-label'
.col-sm-10
.clearable-input .clearable-input
= text_field_tag :expires_at, nil, class: 'form-control js-access-expiration-date', placeholder: 'Select access expiration date' = text_field_tag :expires_at, nil, class: 'form-control js-access-expiration-date', placeholder: 'Expiration date'
%i.clear-icon.js-clear-input %i.clear-icon.js-clear-input
.help-block .help-block.append-bottom-10
On this date, the user(s) will automatically lose access to this group and all of its projects. On this date, the user(s) will automatically lose access to this group and all of its projects.
.form-actions .col-md-2
= f.submit 'Add users to group', class: "btn btn-create" = f.submit 'Add to group', class: "btn btn-create btn-block"
- page_title "Members" - page_title "Members"
.group-members-page.prepend-top-default .project-members-page.prepend-top-default
%h4
Members
%hr
- if can?(current_user, :admin_group_member, @group) - if can?(current_user, :admin_group_member, @group)
.panel.panel-default .project-members-new.append-bottom-default
.panel-heading %h5.clearfix
Add new user to group Add new user to
.panel-body %strong= @group.name
%p.light = render "new_group_member"
Members of group have access to all group projects.
.new-group-member-holder
= render "new_group_member"
= render 'shared/members/requests', membership_source: @group, requesters: @requesters = render 'shared/members/requests', membership_source: @group, requesters: @requesters
.append-bottom-default.clearfix
%h5.member.existing-title
Existing users
= form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form' do
.form-group
= search_field_tag :search, params[:search], { placeholder: 'Find existing members by name', class: 'form-control', spellcheck: false }
%button.member-search-btn{ type: "submit", "aria-label" => "Submit search" }
= icon("search")
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
Users with access to
%strong #{@group.name} %strong #{@group.name}
group members
%span.badge= @members.total_count %span.badge= @members.total_count
.controls
= form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form' do
.form-group
= search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control', spellcheck: false }
= button_tag class: 'btn', title: 'Search' do
= icon("search")
%ul.content-list %ul.content-list
= render partial: 'shared/members/member', collection: @members, as: :member = render partial: 'shared/members/member', collection: @members, as: :member
= paginate @members, theme: 'gitlab' = paginate @members, theme: 'gitlab'
:javascript
$('form.member-search-form').on('submit', function(event) {
event.preventDefault();
Turbolinks.visit(this.action + '?' + $(this).serialize());
});
- page_title "Members" - page_title "Members"
.project-members-page.js-project-members-page.prepend-top-default .project-members-page.prepend-top-default
%h4.clearfix %h4.clearfix
Members Members
= link_to "Import", import_namespace_project_project_members_path(@project.namespace, @project), class: "btn btn-default pull-right hidden-xs", title: "Import members from another project" = link_to "Import", import_namespace_project_project_members_path(@project.namespace, @project), class: "btn btn-default pull-right hidden-xs", title: "Import members from another project"
......
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