Commit ff7766b9 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'project-members-scb' into 'master'

Resolve CE/EE diffs in project members

Closes gitlab-ee#10496

See merge request gitlab-org/gitlab-ce!28550
parents e2126185 55cccf21
......@@ -319,6 +319,30 @@ module ProjectsHelper
Ability.allowed?(current_user, :admin_project_member, @project)
end
def project_can_be_shared?
!membership_locked? || @project.allowed_to_share_with_group?
end
def membership_locked?
false
end
def share_project_description(project)
share_with_group = project.allowed_to_share_with_group?
share_with_members = !membership_locked?
description =
if share_with_group && share_with_members
_("You can invite a new member to <strong>%{project_name}</strong> or invite another group.")
elsif share_with_group
_("You can invite another group to <strong>%{project_name}</strong>.")
elsif share_with_members
_("You can invite a new member to <strong>%{project_name}</strong>.")
end
description.html_safe % { project_name: project.name }
end
private
def get_project_nav_tabs(project, current_user)
......
- page_title _("Members")
- can_admin_project_members = can?(current_user, :admin_project_member, @project)
.row.prepend-top-default
.col-lg-12
%h4
= _("Project members")
- if can?(current_user, :admin_project_member, @project)
%p
= _("You can invite a new member to <strong>%{project_name}</strong> or invite another group.").html_safe % { project_name: sanitize(@project.name, tags: []) }
- else
%p
= _("Members can be added by project <i>Maintainers</i> or <i>Owners</i>").html_safe
- if project_can_be_shared?
%h4
= _("Project members")
- if can_admin_project_members
%p= share_project_description(@project)
- else
%p
= _("Members can be added by project <i>Maintainers</i> or <i>Owners</i>").html_safe
.light
- if can?(current_user, :admin_project_member, @project)
%ul.nav-links.nav.nav-tabs.gitlab-tabs{ role: 'tablist' }
%li.nav-tab{ role: 'presentation' }
%a.nav-link.active{ href: '#invite-member-pane', id: 'invite-member-tab', data: { toggle: 'tab' }, role: 'tab' }= _("Invite member")
- if @project.allowed_to_share_with_group?
- if can_admin_project_members && project_can_be_shared?
- if !membership_locked? && @project.allowed_to_share_with_group?
%ul.nav-links.nav.nav-tabs.gitlab-tabs{ role: 'tablist' }
%li.nav-tab{ role: 'presentation' }
%a.nav-link.active{ href: '#invite-member-pane', id: 'invite-member-tab', data: { toggle: 'tab' }, role: 'tab' }= _("Invite member")
%li.nav-tab{ role: 'presentation', class: ('active' if membership_locked?) }
%a.nav-link{ href: '#invite-group-pane', id: 'invite-group-tab', data: { toggle: 'tab' }, role: 'tab' }= _("Invite group")
.tab-content.gitlab-tab-content
.tab-pane.active{ id: 'invite-member-pane', role: 'tabpanel' }
= render 'projects/project_members/new_project_member', tab_title: _('Invite member')
.tab-pane{ id: 'invite-group-pane', role: 'tabpanel' }
= render 'projects/project_members/new_project_group', tab_title: _('Invite group')
.tab-content.gitlab-tab-content
.tab-pane.active{ id: 'invite-member-pane', role: 'tabpanel' }
= render 'projects/project_members/new_project_member', tab_title: _('Invite member')
.tab-pane{ id: 'invite-group-pane', role: 'tabpanel', class: ('active' if membership_locked?) }
= render 'projects/project_members/new_project_group', tab_title: _('Invite group')
- elsif !membership_locked?
.invite-member= render 'projects/project_members/new_project_member', tab_title: _('Invite member')
- elsif @project.allowed_to_share_with_group?
.invite-group= render 'projects/project_members/new_project_group', tab_title: _('Invite group')
= render 'shared/members/requests', membership_source: @project, requesters: @requesters
.clearfix
......
......@@ -11286,6 +11286,12 @@ msgstr ""
msgid "You can invite a new member to <strong>%{project_name}</strong> or invite another group."
msgstr ""
msgid "You can invite a new member to <strong>%{project_name}</strong>."
msgstr ""
msgid "You can invite another group to <strong>%{project_name}</strong>."
msgstr ""
msgid "You can move around the graph by using the arrow keys."
msgstr ""
......
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