Class: Panda::Core::Configuration
- Inherits:
-
Object
- Object
- Panda::Core::Configuration
- Defined in:
- lib/panda/core/configuration.rb
Instance Attribute Summary collapse
-
#additional_user_params ⇒ Object
Returns the value of attribute additional_user_params.
-
#admin_dashboard_widgets ⇒ Object
Returns the value of attribute admin_dashboard_widgets.
-
#admin_navigation_items ⇒ Object
Returns the value of attribute admin_navigation_items.
-
#admin_path ⇒ Object
Returns the value of attribute admin_path.
-
#admin_title ⇒ Object
Returns the value of attribute admin_title.
-
#authentication_providers ⇒ Object
Returns the value of attribute authentication_providers.
-
#authorization_policy ⇒ Object
Returns the value of attribute authorization_policy.
-
#available_themes ⇒ Object
Returns the value of attribute available_themes.
-
#cache_store ⇒ Object
Returns the value of attribute cache_store.
-
#dashboard_redirect_path ⇒ Object
Returns the value of attribute dashboard_redirect_path.
-
#default_theme ⇒ Object
Returns the value of attribute default_theme.
-
#initial_admin_breadcrumb ⇒ Object
Returns the value of attribute initial_admin_breadcrumb.
-
#login_logo_path ⇒ Object
Returns the value of attribute login_logo_path.
-
#login_page_title ⇒ Object
Returns the value of attribute login_page_title.
-
#mailer_default_url_options ⇒ Object
Returns the value of attribute mailer_default_url_options.
-
#mailer_sender ⇒ Object
Returns the value of attribute mailer_sender.
-
#parent_controller ⇒ Object
Returns the value of attribute parent_controller.
-
#parent_mailer ⇒ Object
Returns the value of attribute parent_mailer.
-
#session_token_cookie ⇒ Object
Returns the value of attribute session_token_cookie.
-
#storage_provider ⇒ Object
Returns the value of attribute storage_provider.
-
#user_associations ⇒ Object
Returns the value of attribute user_associations.
-
#user_attributes ⇒ Object
Returns the value of attribute user_attributes.
-
#user_class ⇒ Object
Returns the value of attribute user_class.
-
#user_identity_class ⇒ Object
Returns the value of attribute user_identity_class.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/panda/core/configuration.rb', line 29 def initialize @user_class = "Panda::Core::User" @user_identity_class = "Panda::Core::UserIdentity" @storage_provider = :active_storage @cache_store = :memory_store @parent_controller = "ActionController::API" @parent_mailer = "ActionMailer::Base" @mailer_sender = "support@example.com" @mailer_default_url_options = {host: "localhost:3000"} @session_token_cookie = :panda_session @authentication_providers = {} @admin_path = "/admin" @default_theme = "default" # Hook system for extending admin UI with sensible defaults @admin_navigation_items = ->(user) { items = [ { label: "Dashboard", path: @admin_path, icon: "fa-solid fa-house" } ] # Add CMS navigation if available if defined?(Panda::CMS) items << { label: "Content", path: "#{@admin_path}/cms", icon: "fa-solid fa-file-lines" } end items << { label: "My Profile", path: "#{@admin_path}/my_profile/edit", icon: "fa-solid fa-user" } items } @admin_dashboard_widgets = ->(user) { [] } @user_attributes = [] @user_associations = [] @authorization_policy = ->(user, action, resource) { user.admin? } # Profile and UI customization @additional_user_params = [] @available_themes = [["Default", "default"], ["Sky", "sky"]] @login_logo_path = nil @login_page_title = "Panda Admin" @admin_title = "Panda Admin" @initial_admin_breadcrumb = nil # Proc that returns [label, path] @dashboard_redirect_path = nil # Path to redirect to after login (defaults to admin_root_path) end |
Instance Attribute Details
#additional_user_params ⇒ Object
Returns the value of attribute additional_user_params.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def additional_user_params @additional_user_params end |
#admin_dashboard_widgets ⇒ Object
Returns the value of attribute admin_dashboard_widgets.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def @admin_dashboard_widgets end |
#admin_navigation_items ⇒ Object
Returns the value of attribute admin_navigation_items.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def @admin_navigation_items end |
#admin_path ⇒ Object
Returns the value of attribute admin_path.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def admin_path @admin_path end |
#admin_title ⇒ Object
Returns the value of attribute admin_title.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def admin_title @admin_title end |
#authentication_providers ⇒ Object
Returns the value of attribute authentication_providers.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def authentication_providers @authentication_providers end |
#authorization_policy ⇒ Object
Returns the value of attribute authorization_policy.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def @authorization_policy end |
#available_themes ⇒ Object
Returns the value of attribute available_themes.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def available_themes @available_themes end |
#cache_store ⇒ Object
Returns the value of attribute cache_store.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def cache_store @cache_store end |
#dashboard_redirect_path ⇒ Object
Returns the value of attribute dashboard_redirect_path.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def dashboard_redirect_path @dashboard_redirect_path end |
#default_theme ⇒ Object
Returns the value of attribute default_theme.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def default_theme @default_theme end |
#initial_admin_breadcrumb ⇒ Object
Returns the value of attribute initial_admin_breadcrumb.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def @initial_admin_breadcrumb end |
#login_logo_path ⇒ Object
Returns the value of attribute login_logo_path.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def login_logo_path @login_logo_path end |
#login_page_title ⇒ Object
Returns the value of attribute login_page_title.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def login_page_title @login_page_title end |
#mailer_default_url_options ⇒ Object
Returns the value of attribute mailer_default_url_options.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def @mailer_default_url_options end |
#mailer_sender ⇒ Object
Returns the value of attribute mailer_sender.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def mailer_sender @mailer_sender end |
#parent_controller ⇒ Object
Returns the value of attribute parent_controller.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def parent_controller @parent_controller end |
#parent_mailer ⇒ Object
Returns the value of attribute parent_mailer.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def parent_mailer @parent_mailer end |
#session_token_cookie ⇒ Object
Returns the value of attribute session_token_cookie.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def @session_token_cookie end |
#storage_provider ⇒ Object
Returns the value of attribute storage_provider.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def storage_provider @storage_provider end |
#user_associations ⇒ Object
Returns the value of attribute user_associations.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def user_associations @user_associations end |
#user_attributes ⇒ Object
Returns the value of attribute user_attributes.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def user_attributes @user_attributes end |
#user_class ⇒ Object
Returns the value of attribute user_class.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def user_class @user_class end |
#user_identity_class ⇒ Object
Returns the value of attribute user_identity_class.
4 5 6 |
# File 'lib/panda/core/configuration.rb', line 4 def user_identity_class @user_identity_class end |