solidcrud 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 (70) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +1285 -0
  4. data/app/assets/javascripts/controllers/dashboard_controller.js +96 -0
  5. data/app/assets/javascripts/controllers/modal_controller.js +217 -0
  6. data/app/assets/javascripts/controllers/navigation_controller.js +117 -0
  7. data/app/assets/javascripts/controllers/notification_controller.js +85 -0
  8. data/app/assets/javascripts/controllers/search_controller.js +189 -0
  9. data/app/assets/javascripts/controllers/table_controller.js +272 -0
  10. data/app/assets/javascripts/solidcrud/application.js +9475 -0
  11. data/app/assets/stylesheets/solidcrud/_components.scss +267 -0
  12. data/app/assets/stylesheets/solidcrud/_forms.scss +69 -0
  13. data/app/assets/stylesheets/solidcrud/_layout.scss +149 -0
  14. data/app/assets/stylesheets/solidcrud/_tables.scss +90 -0
  15. data/app/assets/stylesheets/solidcrud/_variables.scss +21 -0
  16. data/app/assets/stylesheets/solidcrud/application.css +10 -0
  17. data/app/assets/stylesheets/solidcrud/application.css.map +1 -0
  18. data/app/assets/stylesheets/solidcrud/application.scss +10 -0
  19. data/app/assets/stylesheets/solidcrud/temp.css.map +1 -0
  20. data/app/assets/stylesheets/solidcrud/temp2.css.map +1 -0
  21. data/app/assets/stylesheets/solidcrud/webfonts/fa-brands-400.ttf +0 -0
  22. data/app/assets/stylesheets/solidcrud/webfonts/fa-brands-400.woff2 +0 -0
  23. data/app/assets/stylesheets/solidcrud/webfonts/fa-regular-400.ttf +0 -0
  24. data/app/assets/stylesheets/solidcrud/webfonts/fa-regular-400.woff2 +0 -0
  25. data/app/assets/stylesheets/solidcrud/webfonts/fa-solid-900.ttf +0 -0
  26. data/app/assets/stylesheets/solidcrud/webfonts/fa-solid-900.woff2 +0 -0
  27. data/app/assets/stylesheets/solidcrud/webfonts/fa-v4compatibility.ttf +0 -0
  28. data/app/assets/stylesheets/solidcrud/webfonts/fa-v4compatibility.woff2 +0 -0
  29. data/app/assets/stylesheets/webfonts/fa-brands-400.ttf +0 -0
  30. data/app/assets/stylesheets/webfonts/fa-brands-400.woff2 +0 -0
  31. data/app/assets/stylesheets/webfonts/fa-regular-400.ttf +0 -0
  32. data/app/assets/stylesheets/webfonts/fa-regular-400.woff2 +0 -0
  33. data/app/assets/stylesheets/webfonts/fa-solid-900.ttf +0 -0
  34. data/app/assets/stylesheets/webfonts/fa-solid-900.woff2 +0 -0
  35. data/app/assets/stylesheets/webfonts/fa-v4compatibility.ttf +0 -0
  36. data/app/assets/stylesheets/webfonts/fa-v4compatibility.woff2 +0 -0
  37. data/app/controllers/solidcrud/admin_controller.rb +215 -0
  38. data/app/controllers/solidcrud/application_controller.rb +19 -0
  39. data/app/controllers/solidcrud/assets_controller.rb +59 -0
  40. data/app/controllers/solidcrud/sessions_controller.rb +84 -0
  41. data/app/helpers/solidcrud/application_helper.rb +153 -0
  42. data/app/javascript/solidcrud/application.js +14 -0
  43. data/app/javascript/solidcrud/controllers/crud_controller.js +64 -0
  44. data/app/javascript/solidcrud/controllers/index.js +33 -0
  45. data/app/views/layouts/solidcrud/application.html.erb +70 -0
  46. data/app/views/solidcrud/admin/edit.html.erb +294 -0
  47. data/app/views/solidcrud/admin/index.html.erb +128 -0
  48. data/app/views/solidcrud/admin/model.html.erb +353 -0
  49. data/app/views/solidcrud/admin/new.html.erb +275 -0
  50. data/app/views/solidcrud/admin/shared/_dashboard_stats.html.erb +49 -0
  51. data/app/views/solidcrud/admin/shared/_edit_form_sidebar.html.erb +9 -0
  52. data/app/views/solidcrud/admin/shared/_flash_messages.html.erb +27 -0
  53. data/app/views/solidcrud/admin/shared/_full_sidebar.html.erb +56 -0
  54. data/app/views/solidcrud/admin/shared/_modal.html.erb +45 -0
  55. data/app/views/solidcrud/admin/shared/_new_form_sidebar.html.erb +6 -0
  56. data/app/views/solidcrud/admin/shared/_record_row.html.erb +35 -0
  57. data/app/views/solidcrud/admin/shared/_records_table.html.erb +85 -0
  58. data/app/views/solidcrud/sessions/new.html.erb +262 -0
  59. data/config/routes.rb +24 -0
  60. data/lib/generators/solidcrud/install/install_generator.rb +21 -0
  61. data/lib/generators/solidcrud/install/templates/INSTALL.md +80 -0
  62. data/lib/generators/solidcrud/install/templates/solidcrud.rb +31 -0
  63. data/lib/generators/solidcrud/install_generator.rb +17 -0
  64. data/lib/generators/solidcrud/templates/solidcrud.rb +4 -0
  65. data/lib/solidcrud/authentication.rb +143 -0
  66. data/lib/solidcrud/configuration.rb +64 -0
  67. data/lib/solidcrud/engine.rb +49 -0
  68. data/lib/solidcrud/version.rb +5 -0
  69. data/lib/solidcrud.rb +10 -0
  70. metadata +177 -0
@@ -0,0 +1,70 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>SolidCRUD Admin</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
8
+
9
+ <!-- SolidCRUD Assets -->
10
+ <%= stylesheet_link_tag solidcrud_stylesheet_path, media: "all" %>
11
+ <%= javascript_include_tag solidcrud_javascript_path, defer: true %>
12
+ </head>
13
+
14
+ <body class="solidcrud-body">
15
+ <!-- Modern Navigation -->
16
+ <nav class="solidcrud-header">
17
+ <div class="solidcrud-container">
18
+ <div class="navbar">
19
+ <div class="navbar-brand">
20
+ <i class="far fa-cube icon-cubes"></i>
21
+ SolidCRUD Admin
22
+ </div>
23
+ <div class="navbar-nav">
24
+ <a href="<%= solidcrud.root_path %>" class="nav-link">
25
+ <i class="far fa-bars icon-list"></i>Available Models
26
+ </a>
27
+ <%= link_to solidcrud.logout_path,
28
+ method: :delete,
29
+ data: { turbo_method: :delete },
30
+ class: "nav-link" do %>
31
+ <i class="far fa-sign-out-alt icon-logout"></i>Logout
32
+ <% end %>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </nav>
37
+
38
+ <% if controller.controller_name == 'admin' %>
39
+ <%= yield %>
40
+ <% else %>
41
+ <div class="solidcrud-container solidcrud-main">
42
+ <!-- Flash Messages -->
43
+ <% if flash[:notice] %>
44
+ <div class="alert alert-success">
45
+ <i class="far fa-check icon-check"></i>
46
+ <%= flash[:notice] %>
47
+ </div>
48
+ <% end %>
49
+
50
+ <% if flash[:alert] %>
51
+ <div class="alert alert-danger">
52
+ <i class="far fa-times icon-error"></i>
53
+ <%= flash[:alert] %>
54
+ </div>
55
+ <% end %>
56
+
57
+ <div class="solidcrud-content">
58
+ <%= yield %>
59
+ </div>
60
+ </div>
61
+ <% end %>
62
+
63
+ <!-- Global Modal -->
64
+ <%= render 'solidcrud/admin/shared/modal' %>
65
+
66
+ <!-- Notification Container -->
67
+ <div id="notification-container" class="notification-container">
68
+ </div>
69
+ </body>
70
+ </html>
@@ -0,0 +1,294 @@
1
+ <div class="flex h-screen bg-gradient-to-br from-slate-50 to-slate-100">
2
+ <!-- Sidebar -->
3
+ <div class="w-64 bg-white shadow-xl border-r border-slate-200/50 flex flex-col" data-controller="navigation">
4
+ <!-- Logo/Brand -->
5
+ <div class="p-6 border-b border-slate-200/50">
6
+ <div class="flex items-center space-x-3">
7
+ <div class="w-10 h-10 bg-gradient-to-r from-blue-600 to-indigo-700 rounded-xl flex items-center justify-center shadow-lg">
8
+ <span class="text-white text-lg">🧊</span>
9
+ </div>
10
+ <div>
11
+ <h1 class="text-xl font-bold text-slate-900">SolidCRUD</h1>
12
+ <p class="text-xs text-slate-500">Admin Panel</p>
13
+ </div>
14
+ </div>
15
+ </div>
16
+
17
+ <!-- Navigation Menu -->
18
+ <nav class="flex-1 px-4 py-6 space-y-2 overflow-y-auto">
19
+ <!-- Dashboard -->
20
+ <a href="<%= solidcrud.root_path %>"
21
+ class="flex items-center space-x-3 px-4 py-3 text-slate-700 hover:bg-slate-50 rounded-xl transition-all duration-200 group"
22
+ data-navigation-target="link"
23
+ data-turbo-frame="_top">
24
+ <div class="w-8 h-8 bg-slate-100 rounded-lg flex items-center justify-center group-hover:bg-blue-100 transition-colors duration-200">
25
+ <span class="text-slate-600 group-hover:text-blue-600">📊</span>
26
+ </div>
27
+ <span class="font-medium">Dashboard</span>
28
+ </a>
29
+
30
+ <!-- Models Section -->
31
+ <div class="pt-4">
32
+ <h3 class="px-4 text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2">Models</h3>
33
+ <% @models.each do |model| %>
34
+ <a href="<%= solidcrud.admin_model_path(model.name) %>"
35
+ class="flex items-center space-x-3 px-4 py-3 text-slate-700 hover:bg-slate-50 rounded-xl transition-all duration-200 group <%= 'bg-blue-50 text-blue-700' if params[:controller] == 'solidcrud/admin' && params[:model_name] == model.name %>"
36
+ data-navigation-target="link"
37
+ data-turbo-frame="_top">
38
+ <div class="w-8 h-8 bg-slate-100 rounded-lg flex items-center justify-center group-hover:bg-blue-100 transition-colors duration-200">
39
+ <span class="text-slate-600 group-hover:text-blue-600">📋</span>
40
+ </div>
41
+ <span class="font-medium"><%= model.name.pluralize %></span>
42
+ </a>
43
+ <% end %>
44
+ </div>
45
+ </nav>
46
+
47
+ <!-- Footer -->
48
+ <div class="p-4 border-t border-slate-200/50">
49
+ <div class="text-xs text-slate-500 text-center">
50
+ Rails <%= Rails.version %> • SolidCRUD
51
+ </div>
52
+ </div>
53
+ </div>
54
+
55
+ <!-- Main Content Area -->
56
+ <div class="flex-1 flex flex-col overflow-hidden">
57
+ <!-- Content Header with Flash Messages -->
58
+ <div class="bg-white border-b border-slate-200/50 px-8 py-6">
59
+ <!-- Flash Messages -->
60
+ <% if flash[:notice] %>
61
+ <div class="mb-6 bg-green-50 border border-green-200 rounded-xl p-4">
62
+ <div class="flex items-start space-x-3">
63
+ <div class="flex-shrink-0">
64
+ <span class="text-green-500 text-lg">✓</span>
65
+ </div>
66
+ <div class="flex-1">
67
+ <p class="text-green-800 font-medium"><%= flash[:notice] %></p>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ <% end %>
72
+
73
+ <% if flash[:alert] %>
74
+ <div class="mb-6 bg-red-50 border border-red-200 rounded-xl p-4">
75
+ <div class="flex items-start space-x-3">
76
+ <div class="flex-shrink-0">
77
+ <span class="text-red-500 text-lg">⚠️</span>
78
+ </div>
79
+ <div class="flex-1">
80
+ <p class="text-red-800 font-medium"><%= flash[:alert] %></p>
81
+ </div>
82
+ </div>
83
+ </div>
84
+ <% end %>
85
+ </div>
86
+
87
+ <!-- Scrollable Content -->
88
+ <div class="flex-1 overflow-y-auto">
89
+ <div class="px-8 py-6">
90
+ <div class="mb-4 sm:mb-0">
91
+ <!-- Breadcrumb -->
92
+ <nav class="flex items-center space-x-2 text-sm text-slate-500 mb-2">
93
+ <a href="<%= solidcrud.root_path %>" class="hover:text-slate-700 transition-colors duration-200">
94
+ <span class="mr-1">🏠</span>Dashboard
95
+ </a>
96
+ <span class="text-slate-400">›</span>
97
+ <a href="<%= solidcrud.admin_model_path(@model_name) %>" class="hover:text-slate-700 transition-colors duration-200">
98
+ <%= @model_name.pluralize %>
99
+ </a>
100
+ <span class="text-slate-400">›</span>
101
+ <span class="text-slate-900 font-medium">Edit #<%= @record.id %></span>
102
+ </nav>
103
+
104
+ <div class="flex items-center space-x-4">
105
+ <div class="w-12 h-12 bg-gradient-to-r from-amber-500 to-orange-600 rounded-xl flex items-center justify-center shadow-lg">
106
+ <span class="text-white text-lg">✏️</span>
107
+ </div>
108
+ <div>
109
+ <h1 class="text-3xl font-bold text-slate-900">Edit <%= @model_name %> #<%= @record.id %></h1>
110
+ <p class="text-slate-600 mt-1">Update your <%= @model_name.downcase %> information</p>
111
+ </div>
112
+ </div>
113
+ </div>
114
+ </div>
115
+
116
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
117
+ <!-- Main Form -->
118
+ <div class="lg:col-span-2">
119
+ <!-- Information Cards -->
120
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
121
+ <!-- Record Info Card -->
122
+ <div class="bg-white rounded-2xl shadow-sm border border-slate-200/50 p-6">
123
+ <div class="flex items-center space-x-3 mb-4">
124
+ <div class="w-10 h-10 bg-gradient-to-r from-blue-500 to-indigo-600 rounded-xl flex items-center justify-center shadow-lg">
125
+ <span class="text-white">ℹ️</span>
126
+ </div>
127
+ <div>
128
+ <h6 class="text-lg font-semibold text-slate-900">Record Info</h6>
129
+ <p class="text-sm text-slate-600">Basic information</p>
130
+ </div>
131
+ </div>
132
+ <div class="space-y-3">
133
+ <div class="flex justify-between items-center">
134
+ <span class="text-sm text-slate-600">ID</span>
135
+ <span class="text-sm font-medium text-slate-900">#<%= @record.id %></span>
136
+ </div>
137
+ <div class="flex justify-between items-center">
138
+ <span class="text-sm text-slate-600">Created</span>
139
+ <span class="text-sm font-medium text-slate-900"><%= @record.created_at.strftime('%b %d, %Y') %></span>
140
+ </div>
141
+ <div class="flex justify-between items-center">
142
+ <span class="text-sm text-slate-600">Updated</span>
143
+ <span class="text-sm font-medium text-slate-900"><%= @record.updated_at.strftime('%b %d, %Y') %></span>
144
+ </div>
145
+ </div>
146
+ </div>
147
+
148
+ <!-- Model Stats Card -->
149
+ <div class="bg-white rounded-2xl shadow-sm border border-slate-200/50 p-6">
150
+ <div class="flex items-center space-x-3 mb-4">
151
+ <div class="w-10 h-10 bg-gradient-to-r from-green-500 to-emerald-600 rounded-xl flex items-center justify-center shadow-lg">
152
+ <span class="text-white">📊</span>
153
+ </div>
154
+ <div>
155
+ <h6 class="text-lg font-semibold text-slate-900">Model Stats</h6>
156
+ <p class="text-sm text-slate-600">Database overview</p>
157
+ </div>
158
+ </div>
159
+ <div class="space-y-3">
160
+ <div class="flex justify-between items-center">
161
+ <span class="text-sm text-slate-600">Total Records</span>
162
+ <span class="text-sm font-medium text-slate-900"><%= @model_klass.count %></span>
163
+ </div>
164
+ <div class="flex justify-between items-center">
165
+ <span class="text-sm text-slate-600">Fields</span>
166
+ <span class="text-sm font-medium text-slate-900"><%= @model_klass.column_names.size %></span>
167
+ </div>
168
+ <div class="flex justify-between items-center">
169
+ <span class="text-sm text-slate-600">Table</span>
170
+ <span class="text-sm font-medium text-slate-900"><%= @model_klass.table_name %></span>
171
+ </div>
172
+ </div>
173
+ </div>
174
+
175
+ <!-- Quick Actions Card -->
176
+ <div class="bg-white rounded-2xl shadow-sm border border-slate-200/50 p-6">
177
+ <div class="flex items-center space-x-3 mb-4">
178
+ <div class="w-10 h-10 bg-gradient-to-r from-purple-500 to-pink-600 rounded-xl flex items-center justify-center shadow-lg">
179
+ <span class="text-white">⚡</span>
180
+ </div>
181
+ <div>
182
+ <h6 class="text-lg font-semibold text-slate-900">Quick Actions</h6>
183
+ <p class="text-sm text-slate-600">Common tasks</p>
184
+ </div>
185
+ </div>
186
+ <div class="space-y-2">
187
+ <%= link_to solidcrud.admin_model_path(@model_name),
188
+ class: 'block w-full text-left px-3 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors duration-200' do %>
189
+ <span class="mr-2 text-slate-400">←</span>Back to List
190
+ <% end %>
191
+ <%= link_to solidcrud.new_admin_model_path(@model_name),
192
+ class: 'block w-full text-left px-3 py-2 text-sm text-slate-700 hover:bg-slate-50 rounded-lg transition-colors duration-200' do %>
193
+ <span class="mr-2 text-slate-400">+</span>Create New
194
+ <% end %>
195
+ <%= link_to solidcrud.admin_model_path(@model_name, id: @record.id),
196
+ method: :delete,
197
+ data: {
198
+ confirm: "Are you sure you want to delete this #{@model_name.downcase}?",
199
+ turbo_method: :delete
200
+ },
201
+ class: 'block w-full text-left px-3 py-2 text-sm text-red-600 hover:bg-red-50 rounded-lg transition-colors duration-200' do %>
202
+ <span class="mr-2 text-red-400">🗑️</span>Delete Record
203
+ <% end %>
204
+ </div>
205
+ </div>
206
+ </div>
207
+
208
+ <div class="bg-white rounded-2xl shadow-sm border border-slate-200/50 p-8">
209
+ <div class="flex items-center space-x-3 mb-8">
210
+ <div class="w-8 h-8 bg-amber-100 rounded-lg flex items-center justify-center">
211
+ <span class="text-amber-600">✏️</span>
212
+ </div>
213
+ <h6 class="text-xl font-semibold text-slate-900"><%= @model_name %> Details</h6>
214
+ </div>
215
+
216
+ <%= form_with model: @record, url: solidcrud.admin_model_path(@model_name, id: @record.id), method: :patch, local: true, class: 'space-y-6',
217
+ data: { turbo_frame: "_top" } do |f| %>
218
+ <% if @record.errors.any? %>
219
+ <div class="bg-red-50 border border-red-200 rounded-xl p-4">
220
+ <div class="flex items-start space-x-3">
221
+ <div class="flex-shrink-0">
222
+ <span class="text-red-500 text-lg">⚠️</span>
223
+ </div>
224
+ <div class="flex-1">
225
+ <h6 class="text-red-800 font-semibold mb-2">Please fix the following errors:</h6>
226
+ <ul class="text-red-700 text-sm space-y-1">
227
+ <% @record.errors.full_messages.each do |message| %>
228
+ <li>• <%= message %></li>
229
+ <% end %>
230
+ </ul>
231
+ </div>
232
+ </div>
233
+ </div>
234
+ <% end %>
235
+
236
+ <% editable_columns = @model_klass.column_names.reject { |c| ["id", "created_at", "updated_at"].include?(c) } %>
237
+ <% editable_columns.each do |col| %>
238
+ <% column_obj = @model_klass.columns_hash[col] %>
239
+ <div>
240
+ <%= f.label col, class: 'block text-sm font-semibold text-slate-700 mb-2' do %>
241
+ <span class="mr-2 text-slate-400"><%= column_icon(col) %></span>
242
+ <%= col.humanize %>
243
+ <% if column_obj&.null == false %>
244
+ <span class="text-red-500 ml-1">*</span>
245
+ <% end %>
246
+ <% end %>
247
+ <%= render_form_field(f, col, @model_klass) %>
248
+ <% if column_obj&.comment.present? %>
249
+ <p class="mt-1 text-sm text-slate-500"><%= column_obj.comment %></p>
250
+ <% end %>
251
+ </div>
252
+ <% end %>
253
+
254
+ <!-- Form Actions -->
255
+ <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between pt-6 border-t border-slate-200 space-y-4 sm:space-y-0">
256
+ <%= link_to solidcrud.admin_model_path(@model_name),
257
+ class: 'inline-flex items-center px-6 py-3 bg-slate-100 text-slate-700 font-medium rounded-xl hover:bg-slate-200 transition-all duration-200' do %>
258
+ <span class="mr-2">←</span>Cancel
259
+ <% end %>
260
+
261
+ <div class="flex items-center space-x-3">
262
+ <%= link_to solidcrud.admin_model_path(@model_name, id: @record.id),
263
+ method: :delete,
264
+ data: {
265
+ confirm: "Are you sure you want to delete this #{@model_name.downcase}?",
266
+ turbo_method: :delete
267
+ },
268
+ class: 'inline-flex items-center px-6 py-3 bg-red-100 text-red-700 font-medium rounded-xl hover:bg-red-200 transition-all duration-200' do %>
269
+ <span class="mr-2">🗑️</span>Delete
270
+ <% end %>
271
+
272
+ <%= f.submit "Update #{@model_name}",
273
+ class: 'inline-flex items-center px-8 py-3 bg-gradient-to-r from-amber-500 to-orange-600 text-white font-semibold rounded-xl shadow-lg hover:shadow-xl transition-all duration-200 hover:scale-105' do %>
274
+ <span class="mr-2">💾</span>Update <%= @model_name %>
275
+ <% end %>
276
+ </div>
277
+ </div>
278
+ <% end %>
279
+ </div>
280
+ </div>
281
+ </div>
282
+
283
+ <!-- Sidebar -->
284
+ <div class="bg-yellow-50 p-4 rounded-lg border-l-4 border-yellow-400">
285
+ <h4 class="text-sm font-medium text-yellow-800 mb-2">Editing Record</h4>
286
+ <p class="text-sm text-yellow-700">
287
+ Make changes to the <%= @model_klass.name %> record below.
288
+ </p>
289
+ <div class="mt-3">
290
+ <%= link_to 'Back to List', solidcrud.admin_model_path(@model_name), class: 'text-sm text-yellow-600 hover:text-yellow-800 underline' %>
291
+ </div>
292
+ </div>
293
+
294
+
@@ -0,0 +1,128 @@
1
+ <div class="flex h-screen bg-gradient-to-br from-slate-50 to-slate-100" data-controller="dashboard">
2
+ <!-- Sidebar -->
3
+ <div class="w-80 bg-white border-r border-slate-200/50 flex flex-col" data-controller="navigation">
4
+ <!-- Logo Section -->
5
+ <div class="p-6 border-b border-slate-200/50">
6
+ <div class="flex items-center space-x-3">
7
+ <div class="w-10 h-10 bg-gradient-to-r from-blue-500 to-purple-600 rounded-lg flex items-center justify-center">
8
+ <span class="text-white text-lg">■</span>
9
+ </div>
10
+ <div>
11
+ <h2 class="text-lg font-bold text-slate-900">SolidCRUD</h2>
12
+ <p class="text-xs text-slate-500">Admin Panel</p>
13
+ </div>
14
+ </div>
15
+ </div>
16
+
17
+ <!-- Navigation Menu -->
18
+ <nav class="flex-1 p-4">
19
+ <div class="space-y-1">
20
+ <a href="<%= solidcrud.root_path %>"
21
+ class="nav-item flex items-center space-x-3 px-4 py-3 text-slate-700 hover:bg-slate-100 rounded-xl transition-all duration-200 group"
22
+ data-path="/admin"
23
+ data-action="navigation#handleNavClick">
24
+ <div class="w-8 h-8 bg-slate-100 rounded-lg flex items-center justify-center group-hover:bg-blue-100 transition-colors duration-200">
25
+ <i class="far fa-chart-bar text-lg"></i>
26
+ </div>
27
+ <span class="font-medium">Dashboard</span>
28
+ </a>
29
+
30
+ <div class="pt-4">
31
+ <h3 class="px-4 text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2">Models</h3>
32
+ <div class="space-y-1">
33
+ <% @models.each do |model| %>
34
+ <a href="<%= solidcrud.admin_model_path(model.name) %>"
35
+ class="nav-item flex items-center space-x-3 px-4 py-3 text-slate-700 hover:bg-slate-100 rounded-xl transition-all duration-200 group"
36
+ data-path="/admin/<%= model.name %>"
37
+ data-action="navigation#handleNavClick">
38
+ <div class="w-8 h-8 bg-slate-100 rounded-lg flex items-center justify-center group-hover:bg-blue-100 transition-colors duration-200">
39
+ <i class="far fa-table text-lg"></i>
40
+ </div>
41
+ <div class="flex-1 min-w-0">
42
+ <div class="font-medium truncate"><%= model.name.pluralize %></div>
43
+ <div class="text-xs text-slate-500"><%= model.count %> records</div>
44
+ </div>
45
+ </a>
46
+ <% end %>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </nav>
51
+
52
+ <!-- Footer -->
53
+ <div class="p-4 border-t border-slate-200/50">
54
+ <div class="text-xs text-slate-500 text-center">
55
+ Rails <%= Rails.version %> • SolidCRUD
56
+ </div>
57
+ </div>
58
+ </div>
59
+
60
+ <!-- Main Content Area -->
61
+ <div class="flex-1 flex flex-col">
62
+ <!-- Welcome Header -->
63
+ <div class="p-8 bg-white border-b border-slate-200/50">
64
+ <div class="max-w-4xl">
65
+ <div class="flex items-center space-x-4 mb-4">
66
+ <div class="w-16 h-16 bg-gradient-to-r from-blue-500 to-purple-600 rounded-2xl flex items-center justify-center shadow-lg">
67
+ <i class="far fa-cube text-white text-3xl"></i>
68
+ </div>
69
+ <div>
70
+ <h1 class="text-4xl font-bold text-slate-900">Welcome to SolidCRUD</h1>
71
+ <p class="text-xl text-slate-600 mt-2">Powerful admin interface for your Rails application</p>
72
+ </div>
73
+ </div>
74
+
75
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mt-8">
76
+ <div class="bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-xl border border-blue-200/50">
77
+ <div class="flex items-center space-x-3 mb-3">
78
+ <div class="w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center">
79
+ <i class="far fa-database text-lg"></i>
80
+ </div>
81
+ <h3 class="text-lg font-semibold text-slate-900">Data Management</h3>
82
+ </div>
83
+ <p class="text-slate-600 text-sm">Easily manage your application data with our intuitive interface.</p>
84
+ </div>
85
+
86
+ <div class="bg-gradient-to-r from-purple-50 to-pink-50 p-6 rounded-xl border border-purple-200/50">
87
+ <div class="flex items-center space-x-3 mb-3">
88
+ <div class="w-10 h-10 bg-purple-100 rounded-lg flex items-center justify-center">
89
+ <i class="far fa-search text-lg"></i>
90
+ </div>
91
+ <h3 class="text-lg font-semibold text-slate-900">Advanced Search</h3>
92
+ </div>
93
+ <p class="text-slate-600 text-sm">Find and filter records quickly with powerful search capabilities.</p>
94
+ </div>
95
+
96
+ <div class="bg-gradient-to-r from-green-50 to-emerald-50 p-6 rounded-xl border border-green-200/50">
97
+ <div class="flex items-center space-x-3 mb-3">
98
+ <div class="w-10 h-10 bg-green-100 rounded-lg flex items-center justify-center">
99
+ <i class="far fa-chart-line text-lg"></i>
100
+ </div>
101
+ <h3 class="text-lg font-semibold text-slate-900">Real-time Updates</h3>
102
+ </div>
103
+ <p class="text-slate-600 text-sm">Dashboard updates automatically with live data and Turbo Streams.</p>
104
+ </div>
105
+ </div>
106
+ </div>
107
+ </div>
108
+
109
+ <!-- Quick Stats -->
110
+ <div class="flex-1 p-8">
111
+ <div class="max-w-4xl">
112
+ <div class="flex items-center justify-between mb-6">
113
+ <h2 class="text-2xl font-bold text-slate-900">System Overview</h2>
114
+ <button data-action="dashboard#refresh" class="inline-flex items-center px-4 py-2 bg-blue-500 text-white font-medium rounded-lg hover:bg-blue-600 transition-all duration-200">
115
+ <i class="far fa-sync-alt mr-2 text-lg"></i>Refresh
116
+ </button>
117
+ </div>
118
+
119
+ <div id="dashboard-stats">
120
+ <%= render 'solidcrud/admin/shared/dashboard_stats',
121
+ models_count: @models&.count || 0,
122
+ rails_version: Rails.version,
123
+ database_adapter: ActiveRecord::Base.connection.adapter_name %>
124
+ </div>
125
+ </div>
126
+ </div>
127
+ </div>
128
+ </div>