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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc7a335b47486105708b2b7739c6a567e1486c6a68b2bf6d2e5e5abd8bc8d6a1
4
- data.tar.gz: a0ab08402099d51e7fa059f6171cd83a7ad175c7a6ba2ae983e59dba9a36672f
3
+ metadata.gz: 251aa22a7a41f33e6cab5a4f1f1c38a714aa4a14f2f4b08567c27340e1563f24
4
+ data.tar.gz: 2f8b5ec4901d403c1ffdaf42dee430c69f1c31625c926e8deb43c021a41eb6a9
5
5
  SHA512:
6
- metadata.gz: f4b8203aa82fb630a33c0c12b3cc77f2f51cfe3cbbb8328354c6743a43643758403d570ecfb78569b386b614ca12cedeb29b81b1c122b1f1104fa7ab3ba83998
7
- data.tar.gz: e568830a6432462d083ad833d75f999a9447f3547f97a83fbb7b9f9ea9fdfcdc2b05566e0f77159b72bb4a84d8395e5aaeef61e3a1ebbae7f931167bcf36df9b
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
@@ -13,6 +13,7 @@ module Studio
13
13
 
14
14
  included do
15
15
  before_action :set_model_config, only: :show
16
+ helper Studio::AdminModelsTableHelper
16
17
  helper_method :team_sort_url, :team_sort_indicator, :team_sport_emoji,
17
18
  :team_record_json, :admin_models_table_partial
18
19
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Studio
2
- VERSION = "0.6.2"
2
+ VERSION = "0.7.0"
3
3
  end
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.6.2
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-19 00:00:00.000000000 Z
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