Skip to content
Snippets Groups Projects
Commit d059c69d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Move identities list to own controller action

parent 270b7ce8
No related branches found
No related tags found
No related merge requests found
class Admin::IdentitiesController < Admin::ApplicationController
before_action :user
before_action :identity
before_action :identity, except: :index
def index
@identities = @user.identities
end
 
def edit
end
 
def update
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
render :edit
end
Loading
Loading
@@ -16,9 +20,9 @@ class Admin::IdentitiesController < Admin::ApplicationController
def destroy
respond_to do |format|
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
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
Loading
Loading
%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
Loading
Loading
@@ -24,7 +24,7 @@
%li
%a{"data-toggle" => "tab", href: "#ssh-keys"} SSH keys
%li
%a{"data-toggle" => "tab", href: "#identities"} Identities
= link_to "Identities", admin_user_identities_path(@user)
 
.tab-content
#account.tab-pane.active
Loading
Loading
@@ -232,15 +232,3 @@
%i.fa.fa-times
#ssh-keys.tab-pane
= 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
Loading
Loading
@@ -149,7 +149,7 @@ Gitlab::Application.routes.draw do
namespace :admin do
resources :users, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ } do
resources :keys, only: [:show, :destroy]
resources :identities, only: [:edit, :update, :destroy]
resources :identities, only: [:index, :edit, :update, :destroy]
 
member do
put :team_update
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment