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
iv
gitlab-ce
Commits
d059c69d
Commit
d059c69d
authored
Jun 19, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move identities list to own controller action
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
270b7ce8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
18 deletions
+25
-18
app/controllers/admin/identities_controller.rb
app/controllers/admin/identities_controller.rb
+8
-4
app/views/admin/identities/index.html.haml
app/views/admin/identities/index.html.haml
+15
-0
app/views/admin/users/show.html.haml
app/views/admin/users/show.html.haml
+1
-13
config/routes.rb
config/routes.rb
+1
-1
No files found.
app/controllers/admin/identities_controller.rb
View file @
d059c69d
class
Admin::IdentitiesController
<
Admin
::
ApplicationController
class
Admin::IdentitiesController
<
Admin
::
ApplicationController
before_action
:user
before_action
:user
before_action
:identity
before_action
:identity
,
except: :index
def
index
@identities
=
@user
.
identities
end
def
edit
def
edit
end
end
def
update
def
update
if
@identity
.
update_attributes
(
identity_params
)
if
@identity
.
update_attributes
(
identity_params
)
redirect_to
admin_user_path
(
@user
),
notice:
'User identity was successfully updated.'
redirect_to
admin_user_
identities_
path
(
@user
),
notice:
'User identity was successfully updated.'
else
else
render
:edit
render
:edit
end
end
...
@@ -16,9 +20,9 @@ class Admin::IdentitiesController < Admin::ApplicationController
...
@@ -16,9 +20,9 @@ class Admin::IdentitiesController < Admin::ApplicationController
def
destroy
def
destroy
respond_to
do
|
format
|
respond_to
do
|
format
|
if
@identity
.
destroy
if
@identity
.
destroy
format
.
html
{
redirect_to
[
:admin
,
user
]
,
notice:
'User identity was successfully removed.'
}
format
.
html
{
redirect_to
admin_user_identities_path
(
@user
)
,
notice:
'User identity was successfully removed.'
}
else
else
format
.
html
{
redirect_to
[
:admin
,
user
]
,
alert:
'Failed to remove user identity.'
}
format
.
html
{
redirect_to
admin_user_identities_path
(
@user
)
,
alert:
'Failed to remove user identity.'
}
end
end
end
end
end
end
...
...
app/views/admin/identities/index.html.haml
0 → 100644
View file @
d059c69d
%h3
.page-title
Identities for
=
link_to
@user
.
name
,
[
:admin
,
@user
]
%hr
-
if
@identities
.
present?
%table
.table
%thead
%tr
%th
Provider
%th
Id
%th
=
render
@identities
-
else
%h4
This user has no identities
app/views/admin/users/show.html.haml
View file @
d059c69d
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
%li
%li
%a
{
"data-toggle"
=>
"tab"
,
href:
"#ssh-keys"
}
SSH keys
%a
{
"data-toggle"
=>
"tab"
,
href:
"#ssh-keys"
}
SSH keys
%li
%li
%a
{
"data-toggle"
=>
"tab"
,
href:
"#identities"
}
Identities
=
link_to
"Identities"
,
admin_user_identities_path
(
@user
)
.tab-content
.tab-content
#account
.tab-pane.active
#account
.tab-pane.active
...
@@ -232,15 +232,3 @@
...
@@ -232,15 +232,3 @@
%i
.fa.fa-times
%i
.fa.fa-times
#ssh-keys
.tab-pane
#ssh-keys
.tab-pane
=
render
'profiles/keys/key_table'
,
admin:
true
=
render
'profiles/keys/key_table'
,
admin:
true
#identities
.tab-pane
-
if
@user
.
identities
.
present?
%table
.table
%thead
%tr
%th
Provider
%th
Id
%th
=
render
@user
.
identities
-
else
%h4
This user has no identities
config/routes.rb
View file @
d059c69d
...
@@ -149,7 +149,7 @@ Gitlab::Application.routes.draw do
...
@@ -149,7 +149,7 @@ Gitlab::Application.routes.draw do
namespace
:admin
do
namespace
:admin
do
resources
:users
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-]+/
}
do
resources
:users
,
constraints:
{
id:
/[a-zA-Z.\/0-9_\-]+/
}
do
resources
:keys
,
only:
[
:show
,
:destroy
]
resources
:keys
,
only:
[
:show
,
:destroy
]
resources
:identities
,
only:
[
:edit
,
:update
,
:destroy
]
resources
:identities
,
only:
[
:
index
,
:
edit
,
:update
,
:destroy
]
member
do
member
do
put
:team_update
put
:team_update
...
...
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