studio-engine 0.6.2 → 0.7.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/app/controllers/concerns/studio/admin_models.rb +1 -0
- data/app/helpers/studio/admin_models_table_helper.rb +42 -0
- data/lib/studio/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 251aa22a7a41f33e6cab5a4f1f1c38a714aa4a14f2f4b08567c27340e1563f24
|
|
4
|
+
data.tar.gz: 2f8b5ec4901d403c1ffdaf42dee430c69f1c31625c926e8deb43c021a41eb6a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c8fa01470ce96a17550dac1d2d70db086b1acf0c6f6ed97a8b31679f2f3559dbb8549687bb79e806b2148a058ab700154bc330f4b94eb6b4216480fb0831d67
|
|
7
|
+
data.tar.gz: 4ae572b5cadc0734b1ef69a8d0ec0d4331c57f3545be08e850dcd2b0d53c0f6d30d5e1b2d287a65542d46dec4b1d803cad6611471f24c533143118daa0fc75b4
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ The format is [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). This pro
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## v0.7.0 (2026-06-20)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **`admin_model_table` helper** (`Studio::AdminModelsTableHelper`) — a shared
|
|
11
|
+
shell for `/admin/models` tables (overflow wrapper, `thead`, hover rows,
|
|
12
|
+
colspan empty state). Each consumer `_<key>_table` partial now declares only
|
|
13
|
+
its columns via `headers:` plus a per-row block; the helper is exposed
|
|
14
|
+
automatically through the `Studio::AdminModels` concern. Removes the duplicated
|
|
15
|
+
table boilerplate across mcritchie-studio and turf-monster.
|
|
16
|
+
|
|
7
17
|
## v0.6.2 (2026-06-19)
|
|
8
18
|
|
|
9
19
|
### Added
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Studio
|
|
4
|
+
# Shared shell for /admin/models tables. Renders the overflow wrapper + thead +
|
|
5
|
+
# tbody + empty state so each consumer `_<key>_table` partial only declares its
|
|
6
|
+
# columns. Exposed to consumer admin/models views via the AdminModels concern.
|
|
7
|
+
#
|
|
8
|
+
# <%= admin_model_table(records, key: "users", min_width: 760,
|
|
9
|
+
# headers: ["User", "Role", "Created"], empty: "No users found.") do |user| %>
|
|
10
|
+
# <td class="px-4 py-3"><%= user.display_name %></td>
|
|
11
|
+
# <td class="px-4 py-3"><%= user.role %></td>
|
|
12
|
+
# <td class="px-4 py-3"><%= time_ago_in_words(user.created_at) %> ago</td>
|
|
13
|
+
# <% end %>
|
|
14
|
+
#
|
|
15
|
+
# The block yields each record and returns that row's <td> cells. Output matches
|
|
16
|
+
# the long-standing markup (id="models-<key>-table", overflow wrapper, hover
|
|
17
|
+
# rows, colspan empty state) so existing view assertions keep passing.
|
|
18
|
+
module AdminModelsTableHelper
|
|
19
|
+
def admin_model_table(records, key:, headers:, min_width: 940, empty: "No records found.", &row)
|
|
20
|
+
header_row = content_tag(:tr, safe_join(headers.map { |label|
|
|
21
|
+
content_tag(:th, label, class: "px-4 py-3 text-left font-semibold")
|
|
22
|
+
}))
|
|
23
|
+
|
|
24
|
+
body =
|
|
25
|
+
if records.any?
|
|
26
|
+
safe_join(records.map { |record|
|
|
27
|
+
content_tag(:tr, capture(record, &row), class: "hover:bg-surface-alt/60 transition")
|
|
28
|
+
})
|
|
29
|
+
else
|
|
30
|
+
content_tag(:tr, content_tag(:td, empty,
|
|
31
|
+
colspan: headers.size, class: "px-4 py-10 text-center text-muted"))
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
table = content_tag(:table,
|
|
35
|
+
content_tag(:thead, header_row, class: "bg-surface-alt text-muted text-xs uppercase tracking-wide") +
|
|
36
|
+
content_tag(:tbody, body, class: "divide-y divide-subtle"),
|
|
37
|
+
id: "models-#{key}-table", class: "w-full min-w-[#{min_width}px] text-sm")
|
|
38
|
+
|
|
39
|
+
content_tag(:div, table, class: "overflow-x-auto")
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
data/lib/studio/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: studio-engine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex McRitchie
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -158,6 +158,7 @@ files:
|
|
|
158
158
|
- app/controllers/solana_sessions_controller.rb
|
|
159
159
|
- app/controllers/studio/local_emails_controller.rb
|
|
160
160
|
- app/controllers/theme_settings_controller.rb
|
|
161
|
+
- app/helpers/studio/admin_models_table_helper.rb
|
|
161
162
|
- app/helpers/studio_email_delivery_helper.rb
|
|
162
163
|
- app/helpers/studio_theme_helper.rb
|
|
163
164
|
- app/jobs/error_log_cleanup_job.rb
|