Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 12:55:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 12:55:51 +0300
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /app/views/admin/users
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'app/views/admin/users')
-rw-r--r--app/views/admin/users/_approve_user.html.haml7
-rw-r--r--app/views/admin/users/_ban_user.html.haml9
-rw-r--r--app/views/admin/users/_block_user.html.haml8
-rw-r--r--app/views/admin/users/_head.html.haml63
-rw-r--r--app/views/admin/users/_reject_pending_user.html.haml7
-rw-r--r--app/views/admin/users/_user_activation_effects.html.haml6
-rw-r--r--app/views/admin/users/_user_approve_effects.html.haml11
-rw-r--r--app/views/admin/users/_user_detail_note.html.haml4
-rw-r--r--app/views/admin/users/_user_reject_effects.html.haml10
-rw-r--r--app/views/admin/users/keys.html.haml1
-rw-r--r--app/views/admin/users/projects.html.haml2
-rw-r--r--app/views/admin/users/show.html.haml129
12 files changed, 47 insertions, 210 deletions
diff --git a/app/views/admin/users/_approve_user.html.haml b/app/views/admin/users/_approve_user.html.haml
deleted file mode 100644
index f61c9fa4b80..00000000000
--- a/app/views/admin/users/_approve_user.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-.card.border-info
- .card-header.gl-bg-blue-500.gl-text-white
- = s_('AdminUsers|This user has requested access')
- .card-body
- = render partial: 'admin/users/user_approve_effects'
- %br
- = link_to s_('AdminUsers|Approve user'), approve_admin_user_path(user), method: :put, class: "btn gl-button btn-info", data: { confirm: s_('AdminUsers|Are you sure?'), qa_selector: 'approve_user_button' }
diff --git a/app/views/admin/users/_ban_user.html.haml b/app/views/admin/users/_ban_user.html.haml
deleted file mode 100644
index 229c88adb7f..00000000000
--- a/app/views/admin/users/_ban_user.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-- if ban_feature_available?
- .card.border-warning
- .card-header.bg-warning.gl-text-white
- = s_('AdminUsers|Ban user')
- .card-body
- = user_ban_effects
- %br
- %button.btn.gl-button.btn-warning.js-confirm-modal-button{ data: user_ban_data(user) }
- = s_('AdminUsers|Ban user')
diff --git a/app/views/admin/users/_block_user.html.haml b/app/views/admin/users/_block_user.html.haml
deleted file mode 100644
index 29029986345..00000000000
--- a/app/views/admin/users/_block_user.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-.card.border-warning
- .card-header.bg-warning.text-white
- = s_('AdminUsers|Block this user')
- .card-body
- = user_block_effects
- %br
- %button.btn.gl-button.btn-warning.js-confirm-modal-button{ data: user_block_data(user, s_('AdminUsers|You can always unblock their account, their data will remain intact.')) }
- = s_('AdminUsers|Block user')
diff --git a/app/views/admin/users/_head.html.haml b/app/views/admin/users/_head.html.haml
index be04e87f8b9..b7b712e078d 100644
--- a/app/views/admin/users/_head.html.haml
+++ b/app/views/admin/users/_head.html.haml
@@ -1,33 +1,38 @@
-%h3.page-title
- = @user.name
- - if @user.blocked_pending_approval?
- %span.cred
- = s_('AdminUsers|(Pending approval)')
- - elsif @user.banned?
- %span.cred
- = s_('AdminUsers|(Banned)')
- - elsif @user.blocked?
- %span.cred
- = s_('AdminUsers|(Blocked)')
- - if @user.internal?
- %span.cred
- = s_('AdminUsers|(Internal)')
- - if @user.admin
- %span.cred
- = s_('AdminUsers|(Admin)')
- - if @user.deactivated?
- %span.cred
- = s_('AdminUsers|(Deactivated)')
- = render_if_exists 'admin/users/auditor_user_badge'
- = render_if_exists 'admin/users/gma_user_badge'
+.gl-display-flex.gl-flex-wrap.gl-justify-content-space-between.gl-align-items-center.gl-py-3.gl-mb-5.gl-border-b-solid.gl-border-gray-100.gl-border-b-1
+ .gl-my-3
+ %h3.page-title.gl-m-0
+ = @user.name
+ - if @user.blocked_pending_approval?
+ %span.cred
+ = s_('AdminUsers|(Pending approval)')
+ - elsif @user.banned?
+ %span.cred
+ = s_('AdminUsers|(Banned)')
+ - elsif @user.blocked?
+ %span.cred
+ = s_('AdminUsers|(Blocked)')
+ - if @user.internal?
+ %span.cred
+ = s_('AdminUsers|(Internal)')
+ - if @user.admin
+ %span.cred
+ = s_('AdminUsers|(Admin)')
+ - if @user.deactivated?
+ %span.cred
+ = s_('AdminUsers|(Deactivated)')
+ = render_if_exists 'admin/users/auditor_user_badge'
+ = render_if_exists 'admin/users/gma_user_badge'
- .float-right
- - if impersonation_enabled? && @user != current_user && @user.can?(:log_in)
- = link_to _('Impersonate'), impersonate_admin_user_path(@user), method: :post, class: "btn btn-info gl-button btn-grouped", data: { qa_selector: 'impersonate_user_link' }
- = link_to edit_admin_user_path(@user), class: "btn btn-default gl-button btn-grouped" do
- = sprite_icon('pencil-square', css_class: 'gl-icon gl-button-icon')
- = _('Edit')
-%hr
+ .gl-my-3.gl-display-flex.gl-flex-wrap.gl-my-n2.gl-mx-n2
+ .gl-p-2
+ #js-admin-user-actions{ data: admin_user_actions_data_attributes(@user) }
+ - if @user != current_user
+ .gl-p-2
+ - if impersonation_enabled? && @user.can?(:log_in)
+ = link_to _('Impersonate'), impersonate_admin_user_path(@user), method: :post, class: "btn btn-default gl-button", data: { qa_selector: 'impersonate_user_link' }
+ - if can_force_email_confirmation?(@user)
+ %button.btn.gl-button.btn-info.js-confirm-modal-button{ data: confirm_user_data(@user) }
+ = _('Confirm user')
%ul.nav-links.nav.nav-tabs
= nav_link(path: 'users#show') do
= link_to _("Account"), admin_user_path(@user)
diff --git a/app/views/admin/users/_reject_pending_user.html.haml b/app/views/admin/users/_reject_pending_user.html.haml
deleted file mode 100644
index 17108427330..00000000000
--- a/app/views/admin/users/_reject_pending_user.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-.card.border-danger
- .card-header.bg-danger.gl-text-white
- = s_('AdminUsers|This user has requested access')
- .card-body
- = render partial: 'admin/users/user_reject_effects'
- %br
- = link_to s_('AdminUsers|Reject request'), reject_admin_user_path(user), method: :delete, class: "btn gl-button btn-danger", data: { confirm: s_('AdminUsers|Are you sure?') }
diff --git a/app/views/admin/users/_user_activation_effects.html.haml b/app/views/admin/users/_user_activation_effects.html.haml
deleted file mode 100644
index 244836dac11..00000000000
--- a/app/views/admin/users/_user_activation_effects.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-%p
- = s_('AdminUsers|Reactivating a user will:')
-%ul
- %li
- = s_('AdminUsers|Restore user access to the account, including web, Git and API.')
- = render_if_exists 'admin/users/user_activation_effects_on_seats'
diff --git a/app/views/admin/users/_user_approve_effects.html.haml b/app/views/admin/users/_user_approve_effects.html.haml
deleted file mode 100644
index 54e51bf3467..00000000000
--- a/app/views/admin/users/_user_approve_effects.html.haml
+++ /dev/null
@@ -1,11 +0,0 @@
-%p
- = s_('AdminUsers|Approved users can:')
-%ul
- %li
- = s_('AdminUsers|Log in')
- %li
- = s_('AdminUsers|Access Git repositories')
- %li
- = s_('AdminUsers|Access the API')
- %li
- = s_('AdminUsers|Be added to groups and projects')
diff --git a/app/views/admin/users/_user_detail_note.html.haml b/app/views/admin/users/_user_detail_note.html.haml
index 4f2a682c5ca..cc4827327c9 100644
--- a/app/views/admin/users/_user_detail_note.html.haml
+++ b/app/views/admin/users/_user_detail_note.html.haml
@@ -1,7 +1,7 @@
- if @user.note.present?
- text = @user.note
- .card.border-info
- .card-header.bg-info.text-white
+ .card
+ .card-header
= _('Admin Note')
.card-body
%p= text
diff --git a/app/views/admin/users/_user_reject_effects.html.haml b/app/views/admin/users/_user_reject_effects.html.haml
deleted file mode 100644
index 17b6862b0cc..00000000000
--- a/app/views/admin/users/_user_reject_effects.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-%p
- = s_('AdminUsers|Rejected users:')
-%ul
- %li
- = s_('AdminUsers|Cannot sign in or access instance information')
- %li
- = s_('AdminUsers|Will be deleted')
-%p
- - link_start = '<a href="%{url}">'.html_safe % { url: help_page_path("user/profile/account/delete_account", anchor: "associated-records") }
- = s_('AdminUsers|For more information, please refer to the %{link_start}user account deletion documentation.%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
diff --git a/app/views/admin/users/keys.html.haml b/app/views/admin/users/keys.html.haml
index 5f9d11af7c1..28024ae084f 100644
--- a/app/views/admin/users/keys.html.haml
+++ b/app/views/admin/users/keys.html.haml
@@ -3,3 +3,4 @@
- page_title _("SSH Keys"), @user.name, _("Users")
= render 'admin/users/head'
= render 'profiles/keys/key_table', admin: true
+= render partial: 'admin/users/modals'
diff --git a/app/views/admin/users/projects.html.haml b/app/views/admin/users/projects.html.haml
index 3ff726e1945..8c56e888dcc 100644
--- a/app/views/admin/users/projects.html.haml
+++ b/app/views/admin/users/projects.html.haml
@@ -48,3 +48,5 @@
- if member.respond_to? :project
= link_to project_project_member_path(project, member), data: { confirm: remove_member_message(member) }, remote: true, method: :delete, class: "btn btn-sm btn-danger gl-button btn-icon gl-ml-3", title: _('Remove user from project') do
= sprite_icon('close', size: 16, css_class: 'gl-icon')
+
+= render partial: 'admin/users/modals'
diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml
index 08c1e089f21..ad8d9d1f04f 100644
--- a/app/views/admin/users/show.html.haml
+++ b/app/views/admin/users/show.html.haml
@@ -16,8 +16,10 @@
%strong
= link_to user_path(@user) do
= @user.username
- = render 'admin/users/profile', user: @user
-
+ -# Rendered on mobile only so order of cards can be different on desktop vs mobile
+ .gl-md-display-none
+ = render 'admin/users/profile', user: @user
+ = render 'admin/users/user_detail_note'
.card
.card-header
= _('Account:')
@@ -139,123 +141,8 @@
= render 'shared/custom_attributes', custom_attributes: @user.custom_attributes
- .col-md-6
- - unless @user == current_user
- - if can_force_email_confirmation?(@user)
- .gl-card.border-info.gl-mb-5
- .gl-card-header.bg-info.text-white
- = _('Confirm user')
- .gl-card-body
- - if @user.unconfirmed_email.present?
- - email = " (#{@user.unconfirmed_email})"
- %p= _('This user has an unconfirmed email address %{email}. You may force a confirmation.') % { email: email }
- %br
- = link_to _('Confirm user'), confirm_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: _('Are you sure?'), qa_selector: 'confirm_user_button' }
-
- = render 'admin/users/user_detail_note'
-
- - unless @user.internal?
- - if @user.deactivated?
- .gl-card.border-info.gl-mb-5
- .gl-card-header.bg-info.text-white
- = _('Reactivate this user')
- .gl-card-body
- = render partial: 'admin/users/user_activation_effects'
- %br
- %button.btn.gl-button.btn-info.js-confirm-modal-button{ data: user_activation_data(@user) }
- = s_('AdminUsers|Activate user')
- - elsif @user.can_be_deactivated?
- .gl-card.border-warning.gl-mb-5
- .gl-card-header.bg-warning.text-white
- = _('Deactivate this user')
- .gl-card-body
- = user_deactivation_effects
- %br
- %button.btn.gl-button.btn-warning.js-confirm-modal-button{ data: user_deactivation_data(@user, s_('AdminUsers|You can always re-activate their account, their data will remain intact.')) }
- = s_('AdminUsers|Deactivate user')
- - if @user.blocked?
- - if @user.blocked_pending_approval?
- = render 'admin/users/approve_user', user: @user
- = render 'admin/users/reject_pending_user', user: @user
- - elsif @user.banned?
- .gl-card.border-info.gl-mb-5
- .gl-card-header.gl-bg-blue-500.gl-text-white
- = _('This user is banned')
- .gl-card-body
- %p= _('A banned user cannot:')
- %ul
- %li= _('Log in')
- %li= _('Access Git repositories')
- - link_start = '<a href="%{url}" target="_blank">'.html_safe % { url: help_page_path("user/admin_area/moderate_users", anchor: "ban-a-user") }
- = s_('AdminUsers|Learn more about %{link_start}banned users.%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
- %p
- %button.btn.gl-button.btn-info.js-confirm-modal-button{ data: user_unban_data(@user) }
- = s_('AdminUsers|Unban user')
- - else
- .gl-card.border-info.gl-mb-5
- .gl-card-header.gl-bg-blue-500.gl-text-white
- = _('This user is blocked')
- .gl-card-body
- %p= _('A blocked user cannot:')
- %ul
- %li= _('Log in')
- %li= _('Access Git repositories')
- %br
- %button.btn.gl-button.btn-info.js-confirm-modal-button{ data: user_unblock_data(@user) }
- = s_('AdminUsers|Unblock user')
- - elsif !@user.internal?
- = render 'admin/users/block_user', user: @user
- = render 'admin/users/ban_user', user: @user
-
- - if @user.access_locked?
- .card.border-info.gl-mb-5
- .card-header.bg-info.text-white
- = _('This account has been locked')
- .card-body
- %p= _('This user has been temporarily locked due to excessive number of failed logins. You may manually unlock the account.')
- %br
- = link_to _('Unlock user'), unlock_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: _('Are you sure?') }
- - if !@user.blocked_pending_approval?
- .gl-card.border-danger.gl-mb-5
- .gl-card-header.bg-danger.text-white
- = s_('AdminUsers|Delete user')
- .gl-card-body
- - if @user.can_be_removed? && can?(current_user, :destroy_user, @user)
- %p= _('Deleting a user has the following effects:')
- = render 'users/deletion_guidance', user: @user
- %br
- %button.js-delete-user-modal-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete',
- delete_user_url: admin_user_path(@user),
- block_user_url: block_admin_user_path(@user),
- username: sanitize_name(@user.name) } }
- = s_('AdminUsers|Delete user')
- - else
- - if @user.solo_owned_groups.present?
- %p
- = _('This user is currently an owner in these groups:')
- %strong= @user.solo_owned_groups.map(&:name).join(', ')
- %p
- = _('You must transfer ownership or delete these groups before you can delete this user.')
- - else
- %p
- = _("You don't have access to delete this user.")
-
- .gl-card.border-danger
- .gl-card-header.bg-danger.text-white
- = s_('AdminUsers|Delete user and contributions')
- .gl-card-body
- - if can?(current_user, :destroy_user, @user)
- %p
- - link_to_ghost_user = link_to(_("system ghost user"), help_page_path("user/profile/account/delete_account"))
- = _("This option deletes the user and any contributions that would usually be moved to the %{link_to_ghost_user}. As well as the user's personal projects, groups owned solely by the user, and projects in them, will also be removed. Commits to other projects are unaffected.").html_safe % { link_to_ghost_user: link_to_ghost_user }
- %br
- %button.js-delete-user-modal-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete-with-contributions',
- delete_user_url: admin_user_path(@user, hard_delete: true),
- block_user_url: block_admin_user_path(@user),
- username: @user.name } }
- = s_('AdminUsers|Delete user and contributions')
- - else
- %p
- = _("You don't have access to delete this user.")
-
+ -# Rendered on desktop only so order of cards can be different on desktop vs mobile
+ .col-md-6.gl-display-none.gl-md-display-block
+ = render 'admin/users/profile', user: @user
+ = render 'admin/users/user_detail_note'
= render partial: 'admin/users/modals'