backstage 0.1.9 → 0.1.10

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: 3c718b48851548675ae86452a060e6b6c18a21e712e4ea9cfb3f68379ce2828c
4
- data.tar.gz: ddc6fa00de9252402b7b4c5c86cac775f320d5ffd8d1457d07c909da72373575
3
+ metadata.gz: d8d5018436566611adae93216ace1303f8ae4ed22af25015099291bf4b042290
4
+ data.tar.gz: 14af0f649cdb30c48cc3aaae389892f5e533894e1ab61339f342b55316be7367
5
5
  SHA512:
6
- metadata.gz: 20732846dea13229b3c45c2dccea6b689401bf627031ca9da44774e9738421def5fdd4cb2a53d46783ec53185fedc76742246ea40123883ac1822ab114086286
7
- data.tar.gz: fb271699d1ed51adf18b1891f0d9989d3660ab7cfeea1606f57cc882ef8bfbd73a6bc7a3613acff14c901413044c4476c348c4638b36c6bfe70afd4cd0582bb2
6
+ metadata.gz: 71d2b10bbb890c1a372a23bfde83eb78aa7e8773485dcbbcc48db3d1b438e485a16ebea095f1f322a461939af9e8d57cf8bcd6271a6062fc197793489e9bbe04
7
+ data.tar.gz: 7f767a0c986971fb1916194fc969df576d3fd2b315d39f1196fe92c65ccd4fbf90b356f267072a9bda02e59a2bbd17b1f3d16c2db6f122327ed92f934d3bd482
data/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.10] — 2026-05-25
11
+
12
+ ### Fixed
13
+
14
+ - Dashboard pages now use the same windowed pagination (5 pages around current + first/last links) as resource index pages; pagination logic extracted into a shared `backstage/shared/_pagination` partial
15
+ - Sidebar no longer renders on index, dashboard, or new-record pages; proc-based sidebar links were crashing with `NoMethodError` when `@record` was nil — sidebar is now guarded with `record&.persisted?`
16
+
10
17
  ## [0.1.9] — 2026-05-24
11
18
 
12
19
  ### Fixed
@@ -27,10 +27,4 @@
27
27
  </tbody>
28
28
  </table>
29
29
 
30
- <% if @total_pages > 1 %>
31
- <nav>
32
- <% (1..@total_pages).each do |p| %>
33
- <%= link_to p, url_for(page: p), class: (p == @page ? "current" : nil) %>
34
- <% end %>
35
- </nav>
36
- <% end %>
30
+ <%= render "backstage/shared/pagination" %>
@@ -52,16 +52,4 @@
52
52
  </tbody>
53
53
  </table>
54
54
 
55
- <% if @total_pages > 1 %>
56
- <% window_start = [[@page - 2, 2].max, @total_pages - 4].min
57
- window_end = [[@page + 2, @total_pages - 1].min, 5].max %>
58
- <nav>
59
- <%= link_to "1", url_for(page: 1), class: (@page == 1 ? "current" : nil) %>
60
- <% if window_start > 2 %> &hellip;<% end %>
61
- <% (window_start..window_end).each do |p| %>
62
- &nbsp;<%= link_to p, url_for(page: p), class: (p == @page ? "current" : nil) %>
63
- <% end %>
64
- <% if window_end < @total_pages - 1 %> &hellip;<% end %>
65
- &nbsp;<%= link_to @total_pages, url_for(page: @total_pages), class: (@page == @total_pages ? "current" : nil) %>
66
- </nav>
67
- <% end %>
55
+ <%= render "backstage/shared/pagination" %>
@@ -0,0 +1,13 @@
1
+ <% if @total_pages > 1 %>
2
+ <% window_start = [[@page - 2, 2].max, @total_pages - 4].min
3
+ window_end = [[@page + 2, @total_pages - 1].min, 5].max %>
4
+ <nav>
5
+ <%= link_to "1", url_for(page: 1), class: (@page == 1 ? "current" : nil) %>
6
+ <% if window_start > 2 %> &hellip;<% end %>
7
+ <% (window_start..window_end).each do |p| %>
8
+ &nbsp;<%= link_to p, url_for(page: p), class: (p == @page ? "current" : nil) %>
9
+ <% end %>
10
+ <% if window_end < @total_pages - 1 %> &hellip;<% end %>
11
+ &nbsp;<%= link_to @total_pages, url_for(page: @total_pages), class: (@page == @total_pages ? "current" : nil) %>
12
+ </nav>
13
+ <% end %>
@@ -46,7 +46,7 @@
46
46
  </main>
47
47
  <% sidebar = defined?(@resource_config) && @resource_config&.sidebar_config
48
48
  record = defined?(@record) ? @record : nil %>
49
- <% if sidebar&.links&.any? %>
49
+ <% if sidebar&.links&.any? && record&.persisted? %>
50
50
  <aside>
51
51
  <ul>
52
52
  <% sidebar.links.each do |link| %>
@@ -1,3 +1,3 @@
1
1
  module Backstage
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backstage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gareth James
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-24 00:00:00.000000000 Z
11
+ date: 2026-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -58,6 +58,7 @@ files:
58
58
  - app/views/backstage/resources/edit.html.erb
59
59
  - app/views/backstage/resources/index.html.erb
60
60
  - app/views/backstage/resources/new.html.erb
61
+ - app/views/backstage/shared/_pagination.html.erb
61
62
  - app/views/layouts/backstage/backstage.html.erb
62
63
  - config/routes.rb
63
64
  - lib/backstage.rb