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
Léo-Paul Géneau
gitlab-ce
Commits
6b24c375
Commit
6b24c375
authored
Feb 13, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style admin -> users page. Search by username too
parent
fd5dc597
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
53 deletions
+57
-53
app/models/user.rb
app/models/user.rb
+1
-1
app/views/admin/users/index.html.haml
app/views/admin/users/index.html.haml
+56
-52
No files found.
app/models/user.rb
View file @
6b24c375
...
@@ -138,7 +138,7 @@ class User < ActiveRecord::Base
...
@@ -138,7 +138,7 @@ class User < ActiveRecord::Base
end
end
def
search
query
def
search
query
where
(
"name LIKE :query
or email
LIKE :query"
,
query:
"%
#{
query
}
%"
)
where
(
"name LIKE :query
OR email LIKE :query OR username
LIKE :query"
,
query:
"%
#{
query
}
%"
)
end
end
end
end
...
...
app/views/admin/users/index.html.haml
View file @
6b24c375
...
@@ -3,56 +3,60 @@
...
@@ -3,56 +3,60 @@
=
link_to
'New User'
,
new_admin_user_path
,
class:
"btn btn-small pull-right"
=
link_to
'New User'
,
new_admin_user_path
,
class:
"btn btn-small pull-right"
%br
%br
=
form_tag
admin_users_path
,
method: :get
,
class:
'form-inline'
do
.row
=
text_field_tag
:name
,
params
[
:name
],
class:
"xlarge"
.span3
=
submit_tag
"Search"
,
class:
"btn submit btn-primary"
.admin-filter
%ul
.nav.nav-tabs
=
form_tag
admin_users_path
,
method: :get
,
class:
'form-inline'
do
%li
{
class:
"#{'active' unless params[:filter]}"
}
=
search_field_tag
:name
,
params
[
:name
],
placeholder:
'Name, email or username'
,
class:
'search-text-input span2'
=
link_to
admin_users_path
do
=
button_tag
type:
'submit'
,
class:
'btn'
do
Active
%i
.icon-search
%span
.badge
=
User
.
active
.
count
%ul
.nav.nav-pills.nav-stacked
%li
{
class:
"#{'active' if params[:filter] == "
admins
"}"
}
%li
{
class:
"#{'active' unless params[:filter]}"
}
=
link_to
admin_users_path
(
filter:
"admins"
)
do
=
link_to
admin_users_path
do
Admins
Active
%span
.badge
=
User
.
admins
.
count
%small
.pull-right
=
User
.
active
.
count
%li
{
class:
"#{'active' if params[:filter] == "
blocked
"}"
}
%li
{
class:
"#{'active' if params[:filter] == "
admins
"}"
}
=
link_to
admin_users_path
(
filter:
"blocked"
)
do
=
link_to
admin_users_path
(
filter:
"admins"
)
do
Blocked
Admins
%span
.badge
=
User
.
blocked
.
count
%small
.pull-right
=
User
.
admins
.
count
%li
{
class:
"#{'active' if params[:filter] == "
wop
"}"
}
%li
{
class:
"#{'active' if params[:filter] == "
blocked
"}"
}
=
link_to
admin_users_path
(
filter:
"wop"
)
do
=
link_to
admin_users_path
(
filter:
"blocked"
)
do
Without projects
Blocked
%span
.badge
=
User
.
without_projects
.
count
%small
.pull-right
=
User
.
blocked
.
count
%li
{
class:
"#{'active' if params[:filter] == "
wop
"}"
}
=
link_to
admin_users_path
(
filter:
"wop"
)
do
Without projects
%small
.pull-right
=
User
.
without_projects
.
count
%hr
=
link_to
'Reset'
,
admin_users_path
,
class:
"btn btn-cancel"
%table
.span9
%thead
.ui-box
%tr
%h5
.title
%th
Admin
Users (
#{
@admin_users
.
total_count
}
)
%th
%ul
.well-list
Name
-
@admin_users
.
each
do
|
user
|
%i
.icon-sort-down
%li
%th
Username
-
if
user
.
blocked?
%th
Email
%i
.icon-lock.cred
%th
Projects
-
else
%th
Edit
%i
.icon-user.cgreen
%th
.cred
Danger Zone!
=
link_to
user
.
name
,
[
:admin
,
user
]
-
if
user
.
admin?
-
@admin_users
.
each
do
|
user
|
%strong
.cred
(Admin)
%tr
-
if
user
==
current_user
%td
=
check_box_tag
"admin"
,
1
,
user
.
admin
,
disabled: :disabled
%span
.cred
It's you!
%td
=
link_to
user
.
name
,
[
:admin
,
user
]
.pull-right
%td
=
user
.
username
%span
.light
%td
=
user
.
email
%i
.icon-envelope
%td
=
user
.
users_projects
.
count
=
mail_to
user
.
email
,
user
.
email
,
class:
'light'
%td
=
link_to
'Edit'
,
edit_admin_user_path
(
user
),
id:
"edit_
#{
dom_id
(
user
)
}
"
,
class:
"btn btn-small"
%td
.bgred
=
link_to
'Edit'
,
edit_admin_user_path
(
user
),
id:
"edit_
#{
dom_id
(
user
)
}
"
,
class:
"btn btn-small"
-
if
user
==
current_user
-
unless
user
==
current_user
%span
.cred
It's you!
-
if
user
.
blocked
-
else
=
link_to
'Unblock'
,
unblock_admin_user_path
(
user
),
method: :put
,
class:
"btn btn-small success"
-
if
user
.
blocked
-
else
=
link_to
'Unblock'
,
unblock_admin_user_path
(
user
),
method: :put
,
class:
"btn btn-small success"
=
link_to
'Block'
,
block_admin_user_path
(
user
),
confirm:
'USER WILL BE BLOCKED! Are you sure?'
,
method: :put
,
class:
"btn btn-small btn-remove"
-
else
=
link_to
'Destroy'
,
[
:admin
,
user
],
confirm:
"USER
#{
user
.
name
}
WILL BE REMOVED! Are you sure?"
,
method: :delete
,
class:
"btn btn-small btn-remove"
=
link_to
'Block'
,
block_admin_user_path
(
user
),
confirm:
'USER WILL BE BLOCKED! Are you sure?'
,
method: :put
,
class:
"btn btn-small btn-remove"
%li
.bottom
=
link_to
'Destroy'
,
[
:admin
,
user
],
confirm:
"USER
#{
user
.
name
}
WILL BE REMOVED! Are you sure?"
,
method: :delete
,
class:
"btn btn-small btn-remove"
=
paginate
@admin_users
,
theme:
"gitlab"
=
paginate
@admin_users
,
theme:
"admin"
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