Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
dd24c3d4
Commit
dd24c3d4
authored
Mar 09, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve user block/unblock UI in admin area
parent
e89ffd54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
38 deletions
+43
-38
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+2
-2
app/views/admin/users/show.html.haml
app/views/admin/users/show.html.haml
+41
-36
No files found.
app/controllers/admin/users_controller.rb
View file @
dd24c3d4
...
...
@@ -24,7 +24,7 @@ class Admin::UsersController < Admin::ApplicationController
def
block
if
user
.
block
redirect_to
:back
,
alert
:
"Successfully blocked"
redirect_to
:back
,
notice
:
"Successfully blocked"
else
redirect_to
:back
,
alert:
"Error occurred. User was not blocked"
end
...
...
@@ -32,7 +32,7 @@ class Admin::UsersController < Admin::ApplicationController
def
unblock
if
user
.
activate
redirect_to
:back
,
alert
:
"Successfully unblocked"
redirect_to
:back
,
notice
:
"Successfully unblocked"
else
redirect_to
:back
,
alert:
"Error occurred. User was not unblocked"
end
...
...
app/views/admin/users/show.html.haml
View file @
dd24c3d4
...
...
@@ -108,45 +108,50 @@
.col-md-6
-
unless
@user
==
current_user
-
if
@user
.
blocked?
.alert.alert-info
%h4
This user is blocked
%p
Blocking user has the following effects:
%ul
%li
User will not be able to login
%li
User will not be able to access git repositories
%li
User will be removed from joined projects and groups
%li
Personal projects will be left
%li
Owned groups will be left
%br
=
link_to
'Unblock user'
,
unblock_admin_user_path
(
@user
),
method: :put
,
class:
"btn btn-new"
,
data:
{
confirm:
'Are you sure?'
}
.panel.panel-info
.panel-heading
This user is blocked
.panel-body
%p
Blocking user has the following effects:
%ul
%li
User will not be able to login
%li
User will not be able to access git repositories
%li
User will be removed from joined projects and groups
%li
Personal projects will be left
%li
Owned groups will be left
%br
=
link_to
'Unblock user'
,
unblock_admin_user_path
(
@user
),
method: :put
,
class:
"btn btn-info"
,
data:
{
confirm:
'Are you sure?'
}
-
else
.alert.alert-warning
%h4
Block this user
%p
Blocking user has the following effects:
.panel.panel-warning
.panel-heading
Block this user
.panel-body
%p
Blocking user has the following effects:
%ul
%li
User will not be able to login
%li
User will not be able to access git repositories
%li
User will be removed from joined projects and groups
%li
Personal projects will be left
%li
Owned groups will be left
%br
=
link_to
'Block user'
,
block_admin_user_path
(
@user
),
data:
{
confirm:
'USER WILL BE BLOCKED! Are you sure?'
},
method: :put
,
class:
"btn btn-warning"
.panel.panel-danger
.panel-heading
Remove user
.panel-body
%p
Deleting a user has the following effects:
%ul
%li
User will not be able to login
%li
User will not be able to access git repositories
%li
User will be removed from joined projects and groups
%li
Personal projects will be left
%li
Owned groups will be left
%li
All user content like authored issues, snippets, comments will be removed
-
rp
=
@user
.
personal_projects
.
count
-
unless
rp
.
zero?
%li
#{
pluralize
rp
,
'personal project'
}
will be removed and cannot be restored
-
if
@user
.
solo_owned_groups
.
present?
%li
Next groups with all content will be removed:
%strong
#{
@user
.
solo_owned_groups
.
map
(
&
:name
).
join
(
', '
)
}
%br
=
link_to
'Block user'
,
block_admin_user_path
(
@user
),
data:
{
confirm:
'USER WILL BE BLOCKED! Are you sure?'
},
method: :put
,
class:
"btn btn-remove"
.alert.alert-danger
%h4
Remove user
%p
Deleting a user has the following effects:
%ul
%li
All user content like authored issues, snippets, comments will be removed
-
rp
=
@user
.
personal_projects
.
count
-
unless
rp
.
zero?
%li
#{
pluralize
rp
,
'personal project'
}
will be removed and cannot be restored
-
if
@user
.
solo_owned_groups
.
present?
%li
Next groups with all content will be removed:
%strong
#{
@user
.
solo_owned_groups
.
map
(
&
:name
).
join
(
', '
)
}
%br
=
link_to
'Remove user'
,
[
:admin
,
@user
],
data:
{
confirm:
"USER
#{
@user
.
name
}
WILL BE REMOVED! Are you sure?"
},
method: :delete
,
class:
"btn btn-remove"
=
link_to
'Remove user'
,
[
:admin
,
@user
],
data:
{
confirm:
"USER
#{
@user
.
name
}
WILL BE REMOVED! Are you sure?"
},
method: :delete
,
class:
"btn btn-remove"
#profile
.tab-pane
.row
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment