Resolve CE/EE diffs in project members

Part of single codebase changes.
This commit is contained in:
Luke Bennett 2019-05-21 18:50:06 +01:00
parent 785e55c23e
commit 55cccf2125
No known key found for this signature in database
GPG key ID: 402ED51FB5D306C2
3 changed files with 54 additions and 18 deletions

View file

@ -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)

View file

@ -1,29 +1,35 @@
- 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

View file

@ -11250,6 +11250,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 ""