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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
fc43c4e7
Commit
fc43c4e7
authored
Jun 03, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restyle admin/user page
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
87e0fe6f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
175 additions
and
121 deletions
+175
-121
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+2
-1
app/views/admin/users/show.html.haml
app/views/admin/users/show.html.haml
+166
-115
app/views/users/_projects.html.haml
app/views/users/_projects.html.haml
+1
-1
app/views/users/show.html.haml
app/views/users/show.html.haml
+6
-4
No files found.
app/controllers/admin/users_controller.rb
View file @
fc43c4e7
...
@@ -8,7 +8,8 @@ class Admin::UsersController < Admin::ApplicationController
...
@@ -8,7 +8,8 @@ class Admin::UsersController < Admin::ApplicationController
end
end
def
show
def
show
@projects
=
user
.
authorized_projects
@personal_projects
=
user
.
personal_projects
@joined_projects
=
user
.
projects
.
joined
(
@user
)
end
end
def
new
def
new
...
...
app/views/admin/users/show.html.haml
View file @
fc43c4e7
%h3
.page-title
%h3
.page-title
%span
.cgray
User:
User:
=
@user
.
name
=
@user
.
name
-
if
@user
.
blocked?
-
if
@user
.
blocked?
%span
.cred
(Blocked)
%span
.cred
(Blocked)
...
@@ -11,112 +11,144 @@
...
@@ -11,112 +11,144 @@
%i
.icon-edit
%i
.icon-edit
Edit
Edit
%hr
%hr
%ul
.nav.nav-tabs
%li
.active
%a
{
"data-toggle"
=>
"tab"
,
href:
"#account"
}
Account
%li
%a
{
"data-toggle"
=>
"tab"
,
href:
"#profile"
}
Profile
%li
%a
{
"data-toggle"
=>
"tab"
,
href:
"#groups"
}
Groups
%li
%a
{
"data-toggle"
=>
"tab"
,
href:
"#projects"
}
Projects
.row
.tab-content
.col-md-6
#account
.tab-pane.active
.panel.panel-default
.row
.panel-heading
.col-md-6
Account:
.panel.panel-default
.pull-right
.panel-heading
=
image_tag
avatar_icon
(
@user
.
email
,
32
),
class:
"avatar s32"
Account:
%ul
.well-list
%ul
.well-list
%li
%li
%span
.light
Name:
%span
.light
Name:
%strong
=
@user
.
name
%strong
=
@user
.
name
%li
%li
%span
.light
Username:
%span
.light
Username:
%strong
%strong
=
@user
.
username
=
@user
.
username
%li
%li
%span
.light
Email:
%span
.light
Email:
%strong
%strong
=
mail_to
@user
.
email
=
mail_to
@user
.
email
%li
-
@user
.
emails
.
each
do
|
email
|
%span
.light
Can create groups:
%li
%strong
%span
.light
Secondary email:
=
@user
.
can_create_group
?
"Yes"
:
"No"
%strong
=
email
.
email
%li
%span
.light
Personal projects limit:
%strong
=
@user
.
projects_limit
%li
%span
.light
Member since:
%strong
=
@user
.
created_at
.
stamp
(
"Nov 12, 2031"
)
-
if
@user
.
confirmed_at
%li
%span
.light
Confirmed at:
%strong
=
@user
.
confirmed_at
.
stamp
(
"Nov 12, 2031"
)
-
else
%li
%span
.light
Confirmed:
%strong
.cred
No
%li
%li
%span
.light
Last sign-in at:
%span
.light
Can create groups:
%strong
%strong
-
if
@user
.
last_sign_in_at
=
@user
.
can_create_group
?
"Yes"
:
"No"
=
@user
.
last_sign_in_at
.
stamp
(
"Nov 12, 2031"
)
%li
%span
.light
Personal projects limit:
%strong
=
@user
.
projects_limit
%li
%span
.light
Member since:
%strong
=
@user
.
created_at
.
stamp
(
"Nov 12, 2031"
)
-
if
@user
.
confirmed_at
%li
%span
.light
Confirmed at:
%strong
=
@user
.
confirmed_at
.
stamp
(
"Nov 12, 2031"
)
-
else
-
else
never
%li
%span
.light
Confirmed:
%strong
.cred
No
%li
%span
.light
Last sign-in at:
%strong
-
if
@user
.
last_sign_in_at
=
@user
.
last_sign_in_at
.
stamp
(
"Nov 12, 2031"
)
-
else
never
-
if
@user
.
ldap_user?
-
if
@user
.
ldap_user?
%li
%li
%span
.light
LDAP uid:
%span
.light
LDAP uid:
%strong
%strong
=
@user
.
extern_uid
=
@user
.
extern_uid
-
if
@user
.
created_by
-
if
@user
.
created_by
%li
%li
%span
.light
Created by:
%span
.light
Created by:
%strong
%strong
=
link_to
@user
.
created_by
.
name
,
[
:admin
,
@user
.
created_by
]
=
link_to
@user
.
created_by
.
name
,
[
:admin
,
@user
.
created_by
]
-
unless
@user
==
current_user
.col-md-6
-
if
@user
.
blocked?
-
unless
@user
==
current_user
.alert.alert-info
-
if
@user
.
blocked?
%h4
This user is blocked
.alert.alert-info
%p
Blocking user has the following effects:
%h4
This user is blocked
%ul
%p
Blocking user has the following effects:
%li
User will not be able to login
%ul
%li
User will not be able to access git repositories
%li
User will not be able to login
%li
User will be removed from joined projects and groups
%li
User will not be able to access git repositories
%li
Personal projects will be left
%li
User will be removed from joined projects and groups
%li
Owned groups will be left
%li
Personal projects will be left
%br
%li
Owned groups will be left
=
link_to
'Unblock user'
,
unblock_admin_user_path
(
@user
),
method: :put
,
class:
"btn btn-new"
,
data:
{
confirm:
'Are you sure?'
}
%br
-
else
=
link_to
'Unblock user'
,
unblock_admin_user_path
(
@user
),
method: :put
,
class:
"btn btn-new"
,
data:
{
confirm:
'Are you sure?'
}
.alert.alert-warning
-
else
%h4
Block this user
.alert.alert-warning
%p
Blocking user has the following effects:
%h4
Block this user
%ul
%p
Blocking user has the following effects:
%li
User will not be able to login
%ul
%li
User will not be able to access git repositories
%li
User will not be able to login
%li
User will be removed from joined projects and groups
%li
User will not be able to access git repositories
%li
Personal projects will be left
%li
User will be removed from joined projects and groups
%li
Owned groups will be left
%li
Personal projects will be left
%br
%li
Owned groups will be left
=
link_to
'Block user'
,
block_admin_user_path
(
@user
),
data:
{
confirm:
'USER WILL BE BLOCKED! Are you sure?'
},
method: :put
,
class:
"btn btn-remove"
%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
.alert.alert-danger
%h4
%h4
Remove user
Remove user
%p
Deleting a user has the following effects:
%p
Deleting a user has the following effects:
%ul
%ul
%li
All user content like authored issues, snippets, comments will be removed
%li
All user content like authored issues, snippets, comments will be removed
-
rp
=
@user
.
personal_projects
.
count
-
rp
=
@user
.
personal_projects
.
count
-
unless
rp
.
zero?
-
unless
rp
.
zero?
%li
#{
pluralize
rp
,
'personal project'
}
will be removed and cannot be restored
%li
#{
pluralize
rp
,
'personal project'
}
will be removed and cannot be restored
-
if
@user
.
solo_owned_groups
.
present?
-
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"
#profile
.tab-pane
.row
.col-md-6
.panel.panel-default
.panel-heading
=
@user
.
name
%ul
.well-list
%li
=
image_tag
avatar_icon
(
@user
.
email
,
60
),
class:
"avatar s60"
%li
%li
Next groups with all content will be removed:
%span
.light
Profile page:
%strong
#{
@user
.
solo_owned_groups
.
map
(
&
:name
).
join
(
', '
)
}
%strong
%br
=
link_to
user_path
(
@user
)
do
=
link_to
'Remove user'
,
[
:admin
,
@user
],
data:
{
confirm:
"USER
#{
@user
.
name
}
WILL BE REMOVED! Are you sure?"
},
method: :delete
,
class:
"btn btn-remove"
=
@user
.
username
.col-md-6
=
render
'users/profile'
,
user:
@user
.col-md-6
#groups
.tab-pane
-
if
@user
.
users_groups
.
present?
-
if
@user
.
users_groups
.
present?
.panel.panel-default
.panel.panel-default
.panel-heading
Groups:
.panel-heading
Groups:
...
@@ -131,23 +163,42 @@
...
@@ -131,23 +163,42 @@
-
unless
user_group
.
owner?
-
unless
user_group
.
owner?
=
link_to
group_users_group_path
(
group
,
user_group
),
data:
{
confirm:
remove_user_from_group_message
(
group
,
@user
)
},
method: :delete
,
remote:
true
,
class:
"btn-tiny btn btn-remove"
,
title:
'Remove user from group'
do
=
link_to
group_users_group_path
(
group
,
user_group
),
data:
{
confirm:
remove_user_from_group_message
(
group
,
@user
)
},
method: :delete
,
remote:
true
,
class:
"btn-tiny btn btn-remove"
,
title:
'Remove user from group'
do
%i
.icon-remove.icon-white
%i
.icon-remove.icon-white
-
else
.nothing-here-block
This user has no groups.
.panel.panel-default
#projects
.tab-pane
.panel-heading
Projects (
#{
@projects
.
count
}
)
-
if
@user
.
groups
.
any?
%ul
.well-list
.panel.panel-default
-
@projects
.
sort_by
(
&
:name_with_namespace
).
each
do
|
project
|
.panel-heading
Group projects
-
tm
=
project
.
team
.
find_tm
(
@user
.
id
)
%ul
.well-list
%li
.users_project
-
@user
.
groups
.
each
do
|
group
|
=
link_to
admin_project_path
(
project
),
class:
dom_class
(
project
)
do
%li
=
project
.
name_with_namespace
%strong
=
group
.
name
–
access to
#{
pluralize
(
group
.
projects
.
count
,
'project'
)
}
-
if
tm
.row
.pull-right
.col-md-6
-
if
tm
.
owner?
=
render
'users/projects'
,
projects:
@personal_projects
%span
.light
Owner
-
else
.col-md-6
%span
.light
=
tm
.
human_access
.panel.panel-default
.panel-heading
Joined projects (
#{
@joined_projects
.
count
}
)
%ul
.well-list
-
@joined_projects
.
sort_by
(
&
:name_with_namespace
).
each
do
|
project
|
-
tm
=
project
.
team
.
find_tm
(
@user
.
id
)
%li
.users_project
.list-item-name
=
link_to
admin_project_path
(
project
),
class:
dom_class
(
project
)
do
=
project
.
name_with_namespace
-
if
tm
.pull-right
-
if
tm
.
owner?
%span
.light
Owner
-
else
%span
.light
=
tm
.
human_access
-
if
tm
.
respond_to?
:project
-
if
tm
.
respond_to?
:project
=
link_to
project_team_member_path
(
project
,
@user
),
data:
{
confirm:
remove_from_project_team_message
(
project
,
@user
)
},
remote:
true
,
method: :delete
,
class:
"btn-tiny btn btn-remove"
,
title:
'Remove user from project'
do
=
link_to
project_team_member_path
(
project
,
@user
),
data:
{
confirm:
remove_from_project_team_message
(
project
,
@user
)
},
remote:
true
,
method: :delete
,
class:
"btn-tiny btn btn-remove"
,
title:
'Remove user from project'
do
%i
.icon-remove
%i
.icon-remove
app/views/users/_projects.html.haml
View file @
fc43c4e7
.panel.panel-default
.panel.panel-default
.panel-heading
Personal projects
.panel-heading
Personal projects
%ul
.well-list
%ul
.well-list
-
@
projects
.
each
do
|
project
|
-
projects
.
each
do
|
project
|
%li
%li
=
link_to_project
project
=
link_to_project
project
app/views/users/show.html.haml
View file @
fc43c4e7
...
@@ -13,12 +13,14 @@
...
@@ -13,12 +13,14 @@
%br
%br
%small
member since
#{
@user
.
created_at
.
stamp
(
"Nov 12, 2031"
)
}
%small
member since
#{
@user
.
created_at
.
stamp
(
"Nov 12, 2031"
)
}
.clearfix
.clearfix
%h4
Groups:
=
render
'groups'
,
groups:
@groups
-
if
@groups
.
any?
%hr
%h4
Groups:
=
render
'groups'
,
groups:
@groups
%hr
%h4
User Activity:
%h4
User Activity:
=
render
@events
=
render
@events
.col-md-4
.col-md-4
=
render
'profile'
,
user:
@user
=
render
'profile'
,
user:
@user
-
if
@projects
.
present?
-
if
@projects
.
present?
=
render
'projects'
=
render
'projects'
,
projects:
@projects
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