easy-admin-rails 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +8 -0
  5. data/app/assets/builds/easy_admin.base.js +43505 -0
  6. data/app/assets/builds/easy_admin.base.js.map +7 -0
  7. data/app/assets/builds/easy_admin.css +6141 -0
  8. data/app/assets/config/easy_admin_manifest.js +1 -0
  9. data/app/assets/images/jsoneditor-icons.svg +749 -0
  10. data/app/assets/stylesheets/easy_admin/application.tailwind.css +390 -0
  11. data/app/components/easy_admin/base_component.rb +35 -0
  12. data/app/components/easy_admin/batch_action_bar_component.rb +125 -0
  13. data/app/components/easy_admin/batch_action_form_component.rb +124 -0
  14. data/app/components/easy_admin/combined_filters_component.rb +232 -0
  15. data/app/components/easy_admin/confirmation_modal_component.rb +61 -0
  16. data/app/components/easy_admin/context_menu_component.rb +161 -0
  17. data/app/components/easy_admin/dashboards/base_card_component.rb +152 -0
  18. data/app/components/easy_admin/dashboards/card_error_component.rb +23 -0
  19. data/app/components/easy_admin/dashboards/card_factory.rb +90 -0
  20. data/app/components/easy_admin/dashboards/card_stream_component.rb +22 -0
  21. data/app/components/easy_admin/dashboards/cards/base_card_component.rb +54 -0
  22. data/app/components/easy_admin/dashboards/cards/chart_card_component.rb +175 -0
  23. data/app/components/easy_admin/dashboards/cards/custom_card_component.rb +50 -0
  24. data/app/components/easy_admin/dashboards/cards/metric_card_component.rb +164 -0
  25. data/app/components/easy_admin/dashboards/cards/table_card_component.rb +148 -0
  26. data/app/components/easy_admin/dashboards/chart_card_component.rb +44 -0
  27. data/app/components/easy_admin/dashboards/metric_card_component.rb +56 -0
  28. data/app/components/easy_admin/dashboards/refresh_stream_component.rb +279 -0
  29. data/app/components/easy_admin/dashboards/show_component.rb +163 -0
  30. data/app/components/easy_admin/dashboards/table_card_component.rb +52 -0
  31. data/app/components/easy_admin/date_picker_component.rb +188 -0
  32. data/app/components/easy_admin/fields/base_component.rb +101 -0
  33. data/app/components/easy_admin/fields/belongs_to_edit_modal_component.rb +117 -0
  34. data/app/components/easy_admin/fields/form/belongs_to_component.rb +82 -0
  35. data/app/components/easy_admin/fields/form/boolean_component.rb +100 -0
  36. data/app/components/easy_admin/fields/form/date_component.rb +55 -0
  37. data/app/components/easy_admin/fields/form/datetime_component.rb +55 -0
  38. data/app/components/easy_admin/fields/form/email_component.rb +55 -0
  39. data/app/components/easy_admin/fields/form/file_component.rb +190 -0
  40. data/app/components/easy_admin/fields/form/has_many_component.rb +416 -0
  41. data/app/components/easy_admin/fields/form/json_component.rb +81 -0
  42. data/app/components/easy_admin/fields/form/number_component.rb +55 -0
  43. data/app/components/easy_admin/fields/form/select_component.rb +326 -0
  44. data/app/components/easy_admin/fields/form/text_component.rb +55 -0
  45. data/app/components/easy_admin/fields/form/textarea_component.rb +54 -0
  46. data/app/components/easy_admin/fields/index/belongs_to_component.rb +93 -0
  47. data/app/components/easy_admin/fields/index/boolean_component.rb +29 -0
  48. data/app/components/easy_admin/fields/index/date_component.rb +13 -0
  49. data/app/components/easy_admin/fields/index/datetime_component.rb +13 -0
  50. data/app/components/easy_admin/fields/index/email_component.rb +24 -0
  51. data/app/components/easy_admin/fields/index/filters/base_component.rb +48 -0
  52. data/app/components/easy_admin/fields/index/filters/boolean_component.rb +96 -0
  53. data/app/components/easy_admin/fields/index/filters/date_component.rb +182 -0
  54. data/app/components/easy_admin/fields/index/filters/number_component.rb +30 -0
  55. data/app/components/easy_admin/fields/index/filters/select_component.rb +101 -0
  56. data/app/components/easy_admin/fields/index/filters/string_component.rb +32 -0
  57. data/app/components/easy_admin/fields/index/json_component.rb +23 -0
  58. data/app/components/easy_admin/fields/index/number_component.rb +20 -0
  59. data/app/components/easy_admin/fields/index/select_component.rb +25 -0
  60. data/app/components/easy_admin/fields/index/text_component.rb +20 -0
  61. data/app/components/easy_admin/fields/inline_edit_modal_component.rb +135 -0
  62. data/app/components/easy_admin/fields/inline_edit_trigger_component.rb +144 -0
  63. data/app/components/easy_admin/fields/show/belongs_to_component.rb +93 -0
  64. data/app/components/easy_admin/fields/show/boolean_component.rb +21 -0
  65. data/app/components/easy_admin/fields/show/date_component.rb +13 -0
  66. data/app/components/easy_admin/fields/show/datetime_component.rb +13 -0
  67. data/app/components/easy_admin/fields/show/email_component.rb +19 -0
  68. data/app/components/easy_admin/fields/show/file_component.rb +304 -0
  69. data/app/components/easy_admin/fields/show/has_many_component.rb +192 -0
  70. data/app/components/easy_admin/fields/show/json_component.rb +45 -0
  71. data/app/components/easy_admin/fields/show/number_component.rb +20 -0
  72. data/app/components/easy_admin/fields/show/select_component.rb +25 -0
  73. data/app/components/easy_admin/fields/show/text_component.rb +17 -0
  74. data/app/components/easy_admin/fields/show/textarea_component.rb +26 -0
  75. data/app/components/easy_admin/filters_component.rb +120 -0
  76. data/app/components/easy_admin/form_tabs_component.rb +166 -0
  77. data/app/components/easy_admin/infinite_scroll_component.rb +82 -0
  78. data/app/components/easy_admin/lazy_chart_card_component.rb +128 -0
  79. data/app/components/easy_admin/lazy_metric_card_component.rb +76 -0
  80. data/app/components/easy_admin/modal_frame_component.rb +26 -0
  81. data/app/components/easy_admin/navbar_component.rb +226 -0
  82. data/app/components/easy_admin/notification_component.rb +83 -0
  83. data/app/components/easy_admin/pagination_component.rb +188 -0
  84. data/app/components/easy_admin/quick_filters_component.rb +65 -0
  85. data/app/components/easy_admin/resource_pagination_component.rb +14 -0
  86. data/app/components/easy_admin/resources/index_component.rb +211 -0
  87. data/app/components/easy_admin/resources/index_frame_component.rb +88 -0
  88. data/app/components/easy_admin/resources/show_page_actions_component.rb +324 -0
  89. data/app/components/easy_admin/resources/table_cell_component.rb +145 -0
  90. data/app/components/easy_admin/resources/table_component.rb +206 -0
  91. data/app/components/easy_admin/resources/table_row_component.rb +160 -0
  92. data/app/components/easy_admin/row_action_form_component.rb +127 -0
  93. data/app/components/easy_admin/scopes_component.rb +224 -0
  94. data/app/components/easy_admin/settings_sidebar_component.rb +140 -0
  95. data/app/components/easy_admin/show_layout_component.rb +600 -0
  96. data/app/components/easy_admin/sidebar_component.rb +174 -0
  97. data/app/components/easy_admin/turbo/response_component.rb +40 -0
  98. data/app/components/easy_admin/turbo/stream_component.rb +28 -0
  99. data/app/controllers/easy_admin/application_controller.rb +66 -0
  100. data/app/controllers/easy_admin/batch_actions_controller.rb +166 -0
  101. data/app/controllers/easy_admin/confirmation_modal_controller.rb +20 -0
  102. data/app/controllers/easy_admin/dashboard_controller.rb +6 -0
  103. data/app/controllers/easy_admin/dashboards_controller.rb +123 -0
  104. data/app/controllers/easy_admin/passwords_controller.rb +15 -0
  105. data/app/controllers/easy_admin/registrations_controller.rb +52 -0
  106. data/app/controllers/easy_admin/resources_controller.rb +907 -0
  107. data/app/controllers/easy_admin/row_actions_controller.rb +216 -0
  108. data/app/controllers/easy_admin/sessions_controller.rb +32 -0
  109. data/app/controllers/easy_admin/settings_controller.rb +94 -0
  110. data/app/helpers/easy_admin/application_helper.rb +4 -0
  111. data/app/helpers/easy_admin/dashboards_helper.rb +121 -0
  112. data/app/helpers/easy_admin/fields_helper.rb +27 -0
  113. data/app/helpers/easy_admin/pagy_helper.rb +30 -0
  114. data/app/helpers/easy_admin/resources_helper.rb +39 -0
  115. data/app/javascript/easy_admin/application.js +12 -0
  116. data/app/javascript/easy_admin/controllers/batch_modal_controller.js +66 -0
  117. data/app/javascript/easy_admin/controllers/batch_selection_controller.js +223 -0
  118. data/app/javascript/easy_admin/controllers/chart_controller.js +216 -0
  119. data/app/javascript/easy_admin/controllers/collapsible_filters_controller.js +118 -0
  120. data/app/javascript/easy_admin/controllers/confirmation_modal_controller.js +64 -0
  121. data/app/javascript/easy_admin/controllers/context_menu_controller.js +227 -0
  122. data/app/javascript/easy_admin/controllers/date_picker_controller.js +309 -0
  123. data/app/javascript/easy_admin/controllers/dropdown_controller.js +63 -0
  124. data/app/javascript/easy_admin/controllers/event_emitter_controller.js +19 -0
  125. data/app/javascript/easy_admin/controllers/file_controller.js +121 -0
  126. data/app/javascript/easy_admin/controllers/form_tabs_controller.js +100 -0
  127. data/app/javascript/easy_admin/controllers/has_many_search_controller.js +76 -0
  128. data/app/javascript/easy_admin/controllers/infinite_scroll_controller.js +174 -0
  129. data/app/javascript/easy_admin/controllers/ios_alert_controller.js +195 -0
  130. data/app/javascript/easy_admin/controllers/jsoneditor_controller.js +88 -0
  131. data/app/javascript/easy_admin/controllers/modal_controller.js +75 -0
  132. data/app/javascript/easy_admin/controllers/navbar_scroll_controller.js +76 -0
  133. data/app/javascript/easy_admin/controllers/notification_controller.js +48 -0
  134. data/app/javascript/easy_admin/controllers/row_action_controller.js +124 -0
  135. data/app/javascript/easy_admin/controllers/row_modal_controller.js +59 -0
  136. data/app/javascript/easy_admin/controllers/select_field_controller.js +618 -0
  137. data/app/javascript/easy_admin/controllers/settings_button_controller.js +8 -0
  138. data/app/javascript/easy_admin/controllers/settings_sidebar_controller.js +186 -0
  139. data/app/javascript/easy_admin/controllers/sidebar_controller.js +102 -0
  140. data/app/javascript/easy_admin/controllers/sidebar_mobile_controller.js +23 -0
  141. data/app/javascript/easy_admin/controllers/sidebar_nav_controller.js +96 -0
  142. data/app/javascript/easy_admin/controllers/table_controller.js +28 -0
  143. data/app/javascript/easy_admin/controllers/table_row_controller.js +16 -0
  144. data/app/javascript/easy_admin/controllers/toggle_switch_controller.js +22 -0
  145. data/app/javascript/easy_admin/controllers/turbo_stream_redirect.js +9 -0
  146. data/app/javascript/easy_admin/controllers.js +54 -0
  147. data/app/javascript/easy_admin.base.js +4 -0
  148. data/app/models/easy_admin/admin_user.rb +53 -0
  149. data/app/models/easy_admin/application_record.rb +5 -0
  150. data/app/views/easy_admin/dashboard/index.html.erb +3 -0
  151. data/app/views/easy_admin/dashboards/show.html.erb +7 -0
  152. data/app/views/easy_admin/passwords/edit.html.erb +42 -0
  153. data/app/views/easy_admin/passwords/new.html.erb +41 -0
  154. data/app/views/easy_admin/registrations/new.html.erb +65 -0
  155. data/app/views/easy_admin/resources/_redirect.turbo_stream.erb +3 -0
  156. data/app/views/easy_admin/resources/_table_rows.html.erb +46 -0
  157. data/app/views/easy_admin/resources/edit.html.erb +151 -0
  158. data/app/views/easy_admin/resources/index.html.erb +12 -0
  159. data/app/views/easy_admin/resources/index.turbo_stream.erb +139 -0
  160. data/app/views/easy_admin/resources/index_frame.html.erb +142 -0
  161. data/app/views/easy_admin/resources/new.html.erb +100 -0
  162. data/app/views/easy_admin/resources/show.html.erb +31 -0
  163. data/app/views/easy_admin/sessions/new.html.erb +55 -0
  164. data/app/views/easy_admin/settings/_form.html.erb +51 -0
  165. data/app/views/easy_admin/settings/index.html.erb +53 -0
  166. data/app/views/layouts/easy_admin/application.html.erb +48 -0
  167. data/app/views/layouts/easy_admin/auth.html.erb +34 -0
  168. data/config/initializers/easy_admin_card_factory.rb +27 -0
  169. data/config/initializers/pagy.rb +15 -0
  170. data/config/initializers/rack_mini_profiler.rb +67 -0
  171. data/config/routes.rb +70 -0
  172. data/db/migrate/20250101000001_create_easy_admin_admin_users.rb +45 -0
  173. data/lib/easy-admin.rb +32 -0
  174. data/lib/easy_admin/action.rb +159 -0
  175. data/lib/easy_admin/batch_action.rb +134 -0
  176. data/lib/easy_admin/configuration.rb +75 -0
  177. data/lib/easy_admin/dashboard.rb +110 -0
  178. data/lib/easy_admin/dashboard_registry.rb +30 -0
  179. data/lib/easy_admin/delete_action.rb +22 -0
  180. data/lib/easy_admin/engine.rb +54 -0
  181. data/lib/easy_admin/field.rb +118 -0
  182. data/lib/easy_admin/resource.rb +806 -0
  183. data/lib/easy_admin/resource_registry.rb +22 -0
  184. data/lib/easy_admin/types/json_type.rb +25 -0
  185. data/lib/easy_admin/version.rb +3 -0
  186. data/lib/generators/easy_admin/auth_generator.rb +69 -0
  187. data/lib/generators/easy_admin/card/card_generator.rb +94 -0
  188. data/lib/generators/easy_admin/card/templates/card_component.rb.erb +127 -0
  189. data/lib/generators/easy_admin/card/templates/card_component_spec.rb.erb +122 -0
  190. data/lib/generators/easy_admin/install/templates/easy_admin.rb +31 -0
  191. data/lib/generators/easy_admin/install_generator.rb +25 -0
  192. data/lib/generators/easy_admin/rbac/rbac_generator.rb +244 -0
  193. data/lib/generators/easy_admin/rbac/templates/add_rbac_to_admin_users.rb +23 -0
  194. data/lib/generators/easy_admin/rbac/templates/super_admin.rb +34 -0
  195. data/lib/generators/easy_admin/resource_generator.rb +43 -0
  196. data/lib/generators/easy_admin/templates/AUTH_README +35 -0
  197. data/lib/generators/easy_admin/templates/README +27 -0
  198. data/lib/generators/easy_admin/templates/create_easy_admin_admin_users.rb +45 -0
  199. data/lib/generators/easy_admin/templates/devise.rb +267 -0
  200. data/lib/generators/easy_admin/templates/easy_admin.rb +24 -0
  201. data/lib/generators/easy_admin/templates/resource.rb +29 -0
  202. data/lib/tasks/easy_admin_tasks.rake +4 -0
  203. metadata +445 -0
@@ -0,0 +1,267 @@
1
+ # EasyAdmin Devise Configuration
2
+ Devise.setup do |config|
3
+ # The secret key used by Devise. Devise uses this key to generate
4
+ # random tokens. Changing this key will render invalid all existing
5
+ # confirmation, reset password and unlock tokens in the database.
6
+ config.secret_key = Rails.application.secret_key_base
7
+
8
+ # ==> Mailer Configuration
9
+ # Configure the e-mail address which will be shown in Devise::Mailer,
10
+ # note that it will be overwritten if you use your own mailer class
11
+ # with default "from" parameter.
12
+ config.mailer_sender = 'noreply@example.com'
13
+
14
+ # Configure the class responsible to send e-mails.
15
+ config.mailer = 'Devise::Mailer'
16
+
17
+ # Configure the parent class responsible to send e-mails.
18
+ config.parent_mailer = 'ActionMailer::Base'
19
+
20
+ # ==> ORM configuration
21
+ # Load and configure the ORM. Supports :active_record (default) and
22
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
23
+ # available as additional gems.
24
+ require 'devise/orm/active_record'
25
+
26
+ # ==> Configuration for any authentication mechanism
27
+ # Configure which keys are used when authenticating a user. The default is
28
+ # just :email. You can configure it to use [:username, :subdomain], so for
29
+ # authenticating a user, both parameters are required. Remember that those
30
+ # parameters are used only when authenticating and not when retrieving from
31
+ # session. If you need permissions, you should implement that in a before filter.
32
+ # You can also supply a hash where the value is a boolean determining whether
33
+ # or not authentication should be aborted when the value is not present.
34
+ config.authentication_keys = [:email]
35
+
36
+ # Configure parameters from the request object used for authentication. Each entry
37
+ # given should be a request method and it will automatically be passed to the
38
+ # find_for_authentication method and considered in your model lookup. For instance,
39
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
40
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
41
+ # config.request_keys = []
42
+
43
+ # Configure which authentication keys should be case-insensitive.
44
+ # These keys will be downcased upon creating or modifying a user and when used
45
+ # to authenticate or find a user. Default is :email.
46
+ config.case_insensitive_keys = [:email]
47
+
48
+ # Configure which authentication keys should have whitespace stripped.
49
+ # These keys will have whitespace before and after removed upon creating or
50
+ # modifying a user and when used to authenticate or find a user. Default is :email.
51
+ config.strip_whitespace_keys = [:email]
52
+
53
+ # Tell if authentication through request.params is enabled. True by default.
54
+ # It can be set to an array that will enable params authentication only for the
55
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
56
+ # enable it only for database (email + password) authentication.
57
+ # config.params_authenticatable = true
58
+
59
+ # Tell if authentication through HTTP Auth is enabled. False by default.
60
+ # It can be set to an array that will enable http authentication only for the
61
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
62
+ # enable it only for database authentication.
63
+ # For API-only applications to support authentication "out-of-the-box", you will likely want to
64
+ # enable this with :database unless you are using a custom strategy.
65
+ # The supported strategies are:
66
+ # :database = Support basic authentication with authentication key + password
67
+ # config.http_authenticatable = false
68
+
69
+ # If 401 status code should be returned for AJAX requests. True by default.
70
+ # config.http_authenticatable_on_xhr = true
71
+
72
+ # The realm used in Http Basic Authentication. 'Application' by default.
73
+ # config.http_authentication_realm = 'Application'
74
+
75
+ # It will change confirmation, password recovery and other workflows
76
+ # to behave the same regardless if the e-mail provided was right or wrong.
77
+ # Does not affect registerable.
78
+ # config.paranoid = true
79
+
80
+ # By default Devise will store the user in session. You can skip storage for
81
+ # particular strategies by setting this option.
82
+ # Notice that if you are skipping storage for all authentication paths, you
83
+ # may want to disable generating routes to Devise's sessions controller by
84
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
85
+ config.skip_session_storage = [:http_auth]
86
+
87
+ # By default, Devise cleans up the CSRF token on authentication to
88
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
89
+ # requests for sign in and sign up, you need to get a new CSRF token
90
+ # from the server. You can disable this option at your own risk.
91
+ # config.clean_up_csrf_token_on_authentication = true
92
+
93
+ # When false, Devise will not attempt to reload routes on eager load.
94
+ # This can reduce the time taken to boot the app but routes may not be
95
+ # fully loaded and not accessible.
96
+ # config.reload_routes = true
97
+
98
+ # ==> Configuration for :database_authenticatable
99
+ # For bcrypt, this is the cost for hashing the password and defaults to 12. If
100
+ # using other algorithms, it defaults to whatever the default value is for that
101
+ # algorithm.
102
+ # You can change the cost if you are using your own Devise-compatible algorithm,
103
+ # otherwise use the default value.
104
+ # config.stretches = Rails.env.test? ? 1 : 12
105
+
106
+ # Set up a pepper to generate the hashed password.
107
+ # config.pepper = 'your_pepper_here'
108
+
109
+ # Send a notification to the original email when the user's email is changed.
110
+ # config.send_email_changed_notification = false
111
+
112
+ # Send a notification email when the user's password is changed.
113
+ # config.send_password_change_notification = false
114
+
115
+ # ==> Configuration for :confirmable
116
+ # A period that the user is allowed to access the website even without
117
+ # confirming their account. For instance, if set to 2.days, the user will be
118
+ # able to access the website for two days without confirming their account,
119
+ # access will be blocked just in the third day.
120
+ # You can also set it to nil, which will allow the user to access the website
121
+ # without confirming their account.
122
+ # Default is 0.days, meaning the user cannot access the website without
123
+ # confirming their account.
124
+ # config.allow_unconfirmed_access_for = 2.days
125
+
126
+ # A period that the user is allowed to confirm their account before their
127
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
128
+ # their account within 3 days after the mail was sent, but on the 4th day
129
+ # their account can't be confirmed with the token any more.
130
+ # Default is nil, meaning there is no restriction on how long a user can take
131
+ # before confirming their account.
132
+ # config.confirm_within = 3.days
133
+
134
+ # If true, requires any email changes to be confirmed (exactly the same way as
135
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
136
+ # db field (see migrations). Until confirmed, new email is stored in
137
+ # unconfirmed_email column, and copied to email column on successful confirmation.
138
+ config.reconfirmable = true
139
+
140
+ # Defines which key will be used when confirming an account
141
+ # config.confirmation_keys = [:email]
142
+
143
+ # ==> Configuration for :rememberable
144
+ # The time the user will be remembered without asking for credentials again.
145
+ # config.remember_for = 2.weeks
146
+
147
+ # Invalidates all the remember me tokens when the user signs out.
148
+ config.expire_all_remember_me_on_sign_out = true
149
+
150
+ # If true, extends the user's remember period when remembered via cookie.
151
+ # config.extend_remember_period = false
152
+
153
+ # Options to be passed to the created cookie. For instance, you can set
154
+ # secure: true in order to force SSL only cookies.
155
+ # config.rememberable_options = {}
156
+
157
+ # ==> Configuration for :validatable
158
+ # Range for password length.
159
+ config.password_length = 6..128
160
+
161
+ # Email regex used to validate email formats. It simply asserts that
162
+ # one (and only one) @ exists in the given string. This is mainly
163
+ # to give user feedback and not to assert the e-mail validity.
164
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
165
+
166
+ # ==> Configuration for :timeoutable
167
+ # The time you want to timeout the user session without activity. After this
168
+ # time the user will be asked for credentials again. Default is 30 minutes.
169
+ # config.timeout_in = 30.minutes
170
+
171
+ # ==> Configuration for :lockable
172
+ # Defines which strategy will be used to lock an account.
173
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
174
+ # :none = No lock strategy. You should define your own strategy.
175
+ config.lock_strategy = :failed_attempts
176
+
177
+ # Defines which key will be used when locking and unlocking an account
178
+ # config.unlock_keys = [:email]
179
+
180
+ # Defines which strategy will be used to unlock an account.
181
+ # :email = Sends an unlock link to the user email
182
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
183
+ # :both = Enables both strategies
184
+ # :none = No unlock strategy. You should define your own strategy.
185
+ config.unlock_strategy = :both
186
+
187
+ # Number of authentication tries before locking an account if lock_strategy
188
+ # is failed attempts.
189
+ config.maximum_attempts = 20
190
+
191
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
192
+ config.unlock_in = 1.hour
193
+
194
+ # Warn on the last attempt before the account is locked.
195
+ config.last_attempt_warning = true
196
+
197
+ # ==> Configuration for :recoverable
198
+ #
199
+ # Defines which key will be used when recovering the password for an account
200
+ # config.reset_password_keys = [:email]
201
+
202
+ # Time interval you can reset your password with a reset password key.
203
+ # Don't put a too small interval or your users won't have the time to
204
+ # change their passwords.
205
+ config.reset_password_within = 6.hours
206
+
207
+ # When set to false, does not sign a user in automatically after their password is
208
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
209
+ # config.sign_in_after_reset_password = true
210
+
211
+ # ==> Configuration for :encryptable
212
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
213
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
214
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
215
+ # for default behavior) and :restful_authentication_sha1 (then you should set
216
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
217
+ #
218
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
219
+ # config.encryptor = :sha512
220
+
221
+ # ==> Scopes configuration
222
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
223
+ # "users/sessions/new". It's turned off by default because it's slower if you
224
+ # are using only default views.
225
+ config.scoped_views = true
226
+
227
+ # Configure the default scope given to Warden. By default it's the first
228
+ # devise role declared in your routes (usually :user).
229
+ # config.default_scope = :user
230
+
231
+ # Set this configuration to false if you want /users/sign_out to sign out
232
+ # only the current scope. By default, Devise signs out all scopes.
233
+ # config.sign_out_all_scopes = true
234
+
235
+ # ==> Navigation configuration
236
+ # Lists the formats that should be treated as navigational. Formats like
237
+ # :html should redirect to the sign in page when the user does not have
238
+ # access, but formats like :xml or :json, should return 401.
239
+ #
240
+ # If you have any extra navigational formats, like :iphone or :mobile, you
241
+ # should add them to the navigational formats lists.
242
+ #
243
+ # The "*/*" below is required to match Internet Explorer requests.
244
+ # config.navigational_formats = ['*/*', :html, :turbo_stream]
245
+
246
+ # The default HTTP method used to sign out a resource. Default is :delete.
247
+ config.sign_out_via = :delete
248
+
249
+ # ==> OmniAuth
250
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
251
+ # up on your models and hooks.
252
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
253
+
254
+ # ==> Warden configuration
255
+ # If you want to use other strategies, that are not supported by Devise, or
256
+ # change the failure app, you can configure them inside the config.warden block.
257
+ #
258
+ # config.warden do |manager|
259
+ # manager.intercept_401 = false
260
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
261
+ # end
262
+
263
+ # ==> Mountable engine configurations
264
+ # When using Devise with extensions (such as ConfirmEmail) in other engines, please
265
+ # define setting such as config.router_name = :my_engine in the engine's initializer.
266
+ config.router_name = :easy_admin
267
+ end
@@ -0,0 +1,24 @@
1
+ EasyAdmin.configure do |config|
2
+ # Set the application name shown in the sidebar
3
+ config.app_name = "EasyAdmin"
4
+
5
+ # Configure sidebar navigation
6
+ config.sidebar do
7
+ item "Dashboard", "/easy_admin", icon: "📊", active: true
8
+
9
+ group "Content", icon: "📝" do
10
+ item "Posts", "/easy_admin/posts", icon: "📄"
11
+ item "Pages", "/easy_admin/pages", icon: "📑"
12
+ item "Media", "/easy_admin/media", icon: "🖼️"
13
+ end
14
+
15
+ group "Users", icon: "👥", expanded: true do
16
+ item "All Users", "/easy_admin/users", icon: "👤"
17
+ item "Roles", "/easy_admin/roles", icon: "🔐"
18
+ item "Permissions", "/easy_admin/permissions", icon: "🛡️"
19
+ end
20
+
21
+ item "Analytics", "/easy_admin/analytics", icon: "📈"
22
+ item "Settings", "/easy_admin/settings", icon: "⚙️"
23
+ end
24
+ end
@@ -0,0 +1,29 @@
1
+ class <%= resource_class_name %> < EasyAdmin::Resource
2
+ # Uncomment and customize fields as needed
3
+
4
+ id_field
5
+
6
+ # Example field definitions:
7
+ # text_field :name, required: true, searchable: true
8
+ # email_field :email, required: true, searchable: true
9
+ # textarea_field :description
10
+ # number_field :price, format: :currency
11
+ # boolean_field :active
12
+ # date_field :created_at, readonly: true
13
+ # select_field :status, options: ['draft', 'published', 'archived']
14
+
15
+ # Add your <%= model_class_name %> fields here:
16
+ <% begin -%>
17
+ <% model_class = model_class_name.constantize -%>
18
+ <% model_class.column_names.each do |column| -%>
19
+ <% next if ['id', 'created_at', 'updated_at'].include?(column) -%>
20
+ <% column_type = model_class.column_for_attribute(column).type -%>
21
+ # <%= case column_type when :string then 'text_field' when :text then 'textarea_field' when :integer then 'number_field' when :boolean then 'boolean_field' when :date then 'date_field' when :datetime then 'datetime_field' else 'text_field' end %> :<%= column %>
22
+ <% end -%>
23
+ <% rescue NameError -%>
24
+ # Could not find model <%= model_class_name %>. Add fields manually.
25
+ <% end -%>
26
+
27
+ text_field :created_at, readonly: true
28
+ text_field :updated_at, readonly: true
29
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :easy_admin do
3
+ # # Task goes here
4
+ # end