recourse 7.5.0 → 7.6.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: 28a482b8977d87fe680f8b1bff7502998e09202d1c5e95364746cc01b9c92596
4
- data.tar.gz: a8fdb47ce0906854dd0164ac638d8d43155ca9d5561b3f47641c100b326113bf
3
+ metadata.gz: a2a20bbc5915a1d57b72fb203edfdd05c1bd5f994c428b0520f2ef9af73ec3f0
4
+ data.tar.gz: a6ba069086c36351dd7072d09a2909f64bd17a84346d8ef31921fd953592a61d
5
5
  SHA512:
6
- metadata.gz: b03910594792d293f48c138e3ebc186527fa8e08b4784a8c45924479290342ff83776775d508222b7b127b4d7dad5d19f24c5d6b08e9ad46df8be6aff418bfc3
7
- data.tar.gz: e6951d50584a7d913f575caeaa4e141d842e990902abee2326e65080b382587ec416cdedc73bf136265a3d5902374b3b5250546c1cdddd7d0513b5b4a16bdd86
6
+ metadata.gz: c98284ac83b4a7b5419f747e69028dff262aa5281745c61bc8fbd01d7dd0eeb07dc4706ffbbb531133c8c8bc1b2478e75b55a12484cb39a6ca2b539df2821ea5
7
+ data.tar.gz: cdede705768f5b68438efd3d1e80f1120827614a16d8bf11b9556aad5107184f4691d18e893a3d2ee8e1223a1ceef92f74c9026c60d278c6e3d904aa332edae9
data/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## 7.6.0 - 2026-09-20
11
+
12
+ * [CHANGE] The layout titles the page, so a host template cannot lose it
13
+
14
+ The four templates each set `content_for :title`, so a host writing one of its own —
15
+ which is the whole point of the gem drawing the rest — left the tab reading `Recourse`.
16
+ The title is chrome like the trail beside it, and the layout works it out from the same
17
+ place: what the trail ends with, the resource it is of where the record names nothing,
18
+ and the app's own name where neither answers. `content_for :title` still wins where a
19
+ host sets one.
20
+
10
21
  ## 7.5.0 - 2026-09-20
11
22
 
12
23
  * [FEATURE] A model may word its own deletion
@@ -2,7 +2,7 @@
2
2
  <html lang='en'>
3
3
  <head>
4
4
  <meta charset='utf-8'>
5
- <title><%= content_for(:title) || 'Recourse' %></title>
5
+ <title><%= content_for(:title) || page_title %></title>
6
6
  <meta name='viewport' content='width=device-width, initial-scale=1'>
7
7
  <meta name='color-scheme' content='light dark'>
8
8
  <%# A refresh Turbo is sent morphs the page in place and keeps the scroll; without these it
@@ -1,3 +1 @@
1
- <% content_for :title, resource_record_label %>
2
-
3
1
  <%= render 'form', resource_key => resource_record %>
@@ -1,5 +1,3 @@
1
- <% content_for :title, resources_name %>
2
-
3
1
  <% if (new_path = new_resource_path) %>
4
2
  <% content_for :actions do %>
5
3
  <%= link_to t('recourse.add', model: resource_name), new_path,
@@ -1,3 +1 @@
1
- <% content_for :title, t('recourse.new', model: resource_name) %>
2
-
3
1
  <%= render 'form', resource_key => resource_record %>
@@ -1,5 +1,3 @@
1
- <% content_for :title, resource_record_label %>
2
-
3
1
  <%# Nothing to read out where the host found no record: a singular resource is reached
4
2
  with no id, so the one it stands for is one it may not have yet, and the page says so
5
3
  rather than reading attributes off nothing. -%>
@@ -46,6 +46,14 @@ module Recourse
46
46
  safe_join [tag.i(class: "bi bi-#{icon}"), word], ' '
47
47
  end
48
48
 
49
+ # What the tab calls this page: what the trail ends with, the resource it is of
50
+ # where the record names nothing, and the app's own name where neither answers.
51
+ def page_title
52
+ breadcrumb_leaf.presence || breadcrumb_name.presence || app_name
53
+ end
54
+
55
+ def app_name = Rails.application.class.module_parent_name
56
+
49
57
  # Only a page beneath the index names itself, and names what it is showing.
50
58
  def breadcrumb_leaf
51
59
  case controller.action_name
@@ -1,4 +1,4 @@
1
1
  module Recourse
2
2
  # Version of the gem, read by the gemspec and by hosts checking compatibility.
3
- VERSION = '7.5.0'
3
+ VERSION = '7.6.0'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recourse
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.5.0
4
+ version: 7.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob