[manager] list superadmins

This commit is contained in:
Christophe Robillard 2021-04-13 15:54:42 +02:00
parent 2c50fb29e2
commit db48ea02aa
3 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,4 @@
module Manager
class SuperAdminsController < Manager::ApplicationController
end
end

View file

@ -0,0 +1,39 @@
require "administrate/base_dashboard"
class SuperAdminDashboard < Administrate::BaseDashboard
# ATTRIBUTE_TYPES
# a hash that describes the type of each of the model's fields.
#
# Each different type represents an Administrate::Field object,
# which determines how the attribute is displayed
# on pages throughout the dashboard.
ATTRIBUTE_TYPES = {
id: Field::Number,
email: Field::String,
encrypted_password: Field::String,
reset_password_sent_at: Field::DateTime,
remember_created_at: Field::DateTime,
sign_in_count: Field::Number,
current_sign_in_at: Field::DateTime,
last_sign_in_at: Field::DateTime,
current_sign_in_ip: Field::String,
last_sign_in_ip: Field::String,
created_at: Field::DateTime,
updated_at: Field::DateTime,
failed_attempts: Field::Number,
locked_at: Field::DateTime
}.freeze
# COLLECTION_ATTRIBUTES
# an array of attributes that will be displayed on the model's index page.
#
# By default, it's limited to four items to reduce clutter on index pages.
# Feel free to add, remove, or rearrange items.
COLLECTION_ATTRIBUTES = [:id, :email, :created_at, :updated_at, :reset_password_sent_at, :failed_attempts, :locked_at].freeze
# SHOW_PAGE_ATTRIBUTES
# an array of attributes that will be displayed on the model's show page.
SHOW_PAGE_ATTRIBUTES = [:id, :email, :created_at, :updated_at, :reset_password_sent_at, :failed_attempts, :locked_at].freeze
COLLECTION_FILTERS = {}.freeze
end

View file

@ -52,6 +52,8 @@ Rails.application.routes.draw do
resources :services, only: [:index, :show]
resources :super_admins, only: [:index, :show]
post 'demandes/create_administrateur'
post 'demandes/refuse_administrateur'