Show enabled features for admins in manager
This commit is contained in:
parent
5fd1c28007
commit
482b306920
6 changed files with 31 additions and 7 deletions
|
@ -15,6 +15,7 @@ class AdministrateurDashboard < Administrate::BaseDashboard
|
|||
procedures: Field::HasMany.with_options(limit: 20),
|
||||
registration_state: Field::String.with_options(searchable: false),
|
||||
current_sign_in_at: Field::DateTime,
|
||||
features: FeaturesField
|
||||
}.freeze
|
||||
|
||||
# COLLECTION_ATTRIBUTES
|
||||
|
@ -38,6 +39,7 @@ class AdministrateurDashboard < Administrate::BaseDashboard
|
|||
:updated_at,
|
||||
:registration_state,
|
||||
:current_sign_in_at,
|
||||
:features,
|
||||
:procedures,
|
||||
].freeze
|
||||
|
||||
|
|
4
app/fields/features_field.rb
Normal file
4
app/fields/features_field.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
require "administrate/field/base"
|
||||
|
||||
class FeaturesField < Administrate::Field::Base
|
||||
end
|
7
app/views/fields/features_field/_show.html.haml
Normal file
7
app/views/fields/features_field/_show.html.haml
Normal file
|
@ -0,0 +1,7 @@
|
|||
%table
|
||||
- Flipflop.feature_set.features.each do |feature|
|
||||
- if !feature.group || feature.group.key != :production
|
||||
%tr
|
||||
%td= feature.title
|
||||
%td
|
||||
= check_box_tag "Enabled", "enabled", field.data[feature.name], disabled: true
|
Loading…
Add table
Add a link
Reference in a new issue