backstage 0.1.10 → 0.1.11
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 +7 -0
- data/app/assets/stylesheets/backstage/backstage.css +2 -1
- data/app/views/backstage/resources/edit.html.erb +31 -14
- data/app/views/backstage/shared/_pagination.html.erb +8 -6
- data/app/views/layouts/backstage/backstage.html.erb +0 -12
- data/lib/backstage/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da942f19c113814d2f7a5e738b3b7f7ce1cc1e8b23beeaabe8e9ef7e1f0d1b50
|
|
4
|
+
data.tar.gz: 805dedf4003e77e48d6e9bf5eb426d3f24e91fe61297a97eebd3c1f8a858e8f1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 76d4dd10a000b8aeb880f7df124140c351553e44fd98ee3ab42b980cb7abb315297fc959c50a2f3770c48d289db77b28326d4073677046c43dc83cb12022d29d
|
|
7
|
+
data.tar.gz: 800c78a96cc7e9289edff896f5264d0aa73399c4ae30f1ad6557e100213a1c4975f6da1c823fc0f4842744952320f9fe18f3f6a5f1ebe7a3de9b964742c1999a
|
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.11] — 2026-05-25
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Pagination window no longer generates links below page 1 or above the last page when there are fewer than 6 total pages; window is clamped to the valid inner range and skipped entirely when `total_pages <= 2`
|
|
15
|
+
- Sidebar moved from the layout into the edit view, rendering to the right of the form in a two-column grid; links open in a new tab (`target="_blank"`) and blank URLs (e.g. from a proc returning `""`) are skipped silently
|
|
16
|
+
|
|
10
17
|
## [0.1.10] — 2026-05-25
|
|
11
18
|
|
|
12
19
|
### Fixed
|
|
@@ -3,7 +3,8 @@ body { display: grid; grid-template-columns: 200px 1fr; grid-template-rows: auto
|
|
|
3
3
|
header { grid-column: 1 / -1; }
|
|
4
4
|
nav { padding: 1rem; grid-row: 2; grid-column: 1; }
|
|
5
5
|
main { padding: 1rem; grid-row: 2; grid-column: 2; }
|
|
6
|
-
|
|
6
|
+
.edit-layout { display: grid; grid-template-columns: 1fr 220px; gap: 2rem; align-items: start; }
|
|
7
|
+
.edit-layout aside { border-left: 1px solid var(--pico-muted-border-color); padding-left: 1rem; }
|
|
7
8
|
|
|
8
9
|
/* Override Pico's horizontal nav list */
|
|
9
10
|
nav ul { flex-direction: column; }
|
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
<h1>Edit <%= @resource_config.model_class.model_name.human %></h1>
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
<% sidebar = @resource_config.sidebar_config %>
|
|
4
|
+
<div class="<%= sidebar&.links&.any? ? "edit-layout" : "" %>">
|
|
5
|
+
<div>
|
|
6
|
+
<%= form_with model: @record, url: resource_path(resource: params[:resource], id: @record.id), method: :patch do |f| %>
|
|
7
|
+
<% @resource_config.edit_fields.each do |field| %>
|
|
8
|
+
<div>
|
|
9
|
+
<%= f.label field.name %>
|
|
10
|
+
<%= render partial: field.partial_path, locals: { f: f, field: field, record: @record } %>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
13
|
+
<%= f.submit "Save" %>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<%= link_to "Cancel", resources_path(resource: params[:resource]) %>
|
|
12
17
|
|
|
13
|
-
<%=
|
|
18
|
+
<%= button_to "Delete",
|
|
19
|
+
resource_path(resource: params[:resource], id: @record.id),
|
|
20
|
+
method: :delete,
|
|
21
|
+
data: { confirm_message: "Delete this #{@resource_config.model_class.model_name.human}?" } %>
|
|
22
|
+
</div>
|
|
14
23
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
<% if sidebar&.links&.any? %>
|
|
25
|
+
<aside>
|
|
26
|
+
<ul>
|
|
27
|
+
<% sidebar.links.each do |link| %>
|
|
28
|
+
<% url = link.url_or_proc.respond_to?(:call) ? link.url_or_proc.call(@record) : link.url_or_proc %>
|
|
29
|
+
<% next if url.blank? %>
|
|
30
|
+
<li><%= link_to link.label, url, target: "_blank" %></li>
|
|
31
|
+
<% end %>
|
|
32
|
+
</ul>
|
|
33
|
+
</aside>
|
|
34
|
+
<% end %>
|
|
35
|
+
</div>
|
|
@@ -1,13 +1,15 @@
|
|
|
1
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
2
|
<nav>
|
|
5
3
|
<%= link_to "1", url_for(page: 1), class: (@page == 1 ? "current" : nil) %>
|
|
6
|
-
<% if
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
<% if @total_pages > 2 %>
|
|
5
|
+
<% window_start = [[@page - 2, 2].max, @total_pages - 4].min.clamp(2, @total_pages - 1)
|
|
6
|
+
window_end = [[@page + 2, @total_pages - 1].min, 5].max.clamp(2, @total_pages - 1) %>
|
|
7
|
+
<% if window_start > 2 %> …<% end %>
|
|
8
|
+
<% (window_start..window_end).each do |p| %>
|
|
9
|
+
<%= link_to p, url_for(page: p), class: (p == @page ? "current" : nil) %>
|
|
10
|
+
<% end %>
|
|
11
|
+
<% if window_end < @total_pages - 1 %> …<% end %>
|
|
9
12
|
<% end %>
|
|
10
|
-
<% if window_end < @total_pages - 1 %> …<% end %>
|
|
11
13
|
<%= link_to @total_pages, url_for(page: @total_pages), class: (@page == @total_pages ? "current" : nil) %>
|
|
12
14
|
</nav>
|
|
13
15
|
<% end %>
|
|
@@ -44,17 +44,5 @@
|
|
|
44
44
|
<main>
|
|
45
45
|
<%= yield %>
|
|
46
46
|
</main>
|
|
47
|
-
<% sidebar = defined?(@resource_config) && @resource_config&.sidebar_config
|
|
48
|
-
record = defined?(@record) ? @record : nil %>
|
|
49
|
-
<% if sidebar&.links&.any? && record&.persisted? %>
|
|
50
|
-
<aside>
|
|
51
|
-
<ul>
|
|
52
|
-
<% sidebar.links.each do |link| %>
|
|
53
|
-
<% url = link.url_or_proc.respond_to?(:call) ? link.url_or_proc.call(record) : link.url_or_proc %>
|
|
54
|
-
<li><%= link_to link.label, url %></li>
|
|
55
|
-
<% end %>
|
|
56
|
-
</ul>
|
|
57
|
-
</aside>
|
|
58
|
-
<% end %>
|
|
59
47
|
</body>
|
|
60
48
|
</html>
|
data/lib/backstage/version.rb
CHANGED