recourse 4.4.1 → 4.4.3

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: eb1da2ed81c2178c7553903bdf1183571f42cbb7e6b2e52a9b6178f751bbdeb5
4
- data.tar.gz: ca93a07a08ac2661c2ec7a1b3c8b02462cef11cedc04ccdb2cb3c84c191e1204
3
+ metadata.gz: ba7f8f62f4a4488b30a0ccc90cc550d98e56dc6a717380b368d5f2a51e06f0c6
4
+ data.tar.gz: 6311ab19960ad5bc92151cfde18dfa4a8610c067ecb08c00021340d19b7e9a2c
5
5
  SHA512:
6
- metadata.gz: a8dcab8f0715cb1626e1dcf9d73ea440c5d6fb890b930ba6efc59634b1ec3af52dfc94bda48f2e9973c20e85aa52f0b028b088738113f84c9a64ee53c002dc3f
7
- data.tar.gz: ef6187e998382e3de0f9ecefc816ab14e1129468fb698a4390410edb553e63e857d1f8ab5cffec6113467aec1b0b83826ea3318bd3c60388d4d0c45be1c527ea
6
+ metadata.gz: 34d609a74f655281b6e4438571a00d4fc554fd431f4e07d3058ba8b84529f800a0e4c798f709ec806989ed9519da2045301658be5314fb0a09317cdcc213ffc9
7
+ data.tar.gz: 142f6ec366b5e45fcffc6afb92ebcf8cbe84ce6e4918e7d4ee50b33144048263fb35f9b519655ea16beb4816e679ec2e4a1311c286881bf7477fcda8a70fffe7
data/CHANGELOG.md CHANGED
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
5
5
  For more information about changelogs, check [Keep a Changelog](http://keepachangelog.com) and
6
6
  [Vandamme](http://tech-angels.github.io/vandamme).
7
7
 
8
+ ## 4.4.3 - 2026-09-08
9
+
10
+ * [Fix] A counted tab reads `1 franchise` again, without the extra space 4.4.0 put between the figure and the word
11
+
12
+ ## 4.4.2 - 2026-09-08
13
+
14
+ * [Fix] `search_highlight` marks the label of a record the search reached through a key
15
+
16
+ A row drawn out of the provider a sector points at marks `provider.name` with
17
+ `search_highlight provider.name, :name`; the helper checked `name` against the
18
+ sector, which has none, and marked nothing.
19
+
20
+ * [Fix] On a phone the pages under a table are centered on their own row
21
+ * [Fix] A filter's menu drops over the sidebar's row of links on a phone, not under it
22
+
8
23
  ## 4.4.1 - 2026-09-08
9
24
 
10
25
  * [Fix] The footer reads `Displaying items 1-20 of 101`, without `in total`
@@ -118,9 +118,11 @@
118
118
  .nav-link:hover:not(.active) { background-color: transparent; }
119
119
  }
120
120
 
121
- /* The navbar and the sidebar stack over the main column: a menu opened from a
122
- filter or a link's tooltip drops over the first rows rather than under them. */
123
- .recourse-shell > nav, .recourse-sidebar { position: relative; z-index: 2; }
121
+ /* The navbar stacks over the sidebar, and both over the main column: a menu
122
+ opened from a filter drops over the sidebar's row of links on a phone and over
123
+ the first rows of the table anywhere, rather than under either. */
124
+ .recourse-sidebar { position: relative; z-index: 2; }
125
+ .recourse-shell > nav { position: relative; z-index: 3; }
124
126
 
125
127
  /* An action column is as wide as a row is tall — an icon in a square — and a
126
128
  counter column starts at the same square, widening only when a figure like
@@ -18,6 +18,7 @@
18
18
  <%= t 'recourse.displaying', count: pagy.count %>
19
19
  <% end %>
20
20
  </div>
21
- <div class='px-2 mt-2 sm:mt-0'><%== pagy.series_nav(:bootstrap, classes: 'pagination mb-0') if pagy.last > 1 %></div>
21
+ <%# Centered on the row of their own a phone gives them, and at the end of the shared row from `sm` up. -%>
22
+ <div class='px-2 mt-2 sm:mt-0 d-flex justify-content-center sm:justify-content-end'><%== pagy.series_nav(:bootstrap, classes: 'pagination mb-0') if pagy.last > 1 %></div>
22
23
  </div>
23
24
  <% end %>
@@ -41,13 +41,24 @@ module Recourse
41
41
 
42
42
  # A foreign key's cell shows a label from the other table, so what decides is
43
43
  # whether the search reaches through that association rather than reads a column.
44
+ # And a row drawn out of the record a key points at marks that record's label with
45
+ # the same helper — `name` on a page of sectors is the provider's — so a column this
46
+ # model has none of is looked for among the labels the search reached through.
44
47
  def searched_column?(column)
45
- association = belongs_to_association column.to_s
48
+ association = belongs_to_association(column.to_s) || labelled_association(column.to_s)
46
49
  return resource_model.recourse_searchable_associations.include? association if association
47
50
 
48
51
  resource_model.recourse_searchable_columns.include? column.to_s
49
52
  end
50
53
 
54
+ def labelled_association(column)
55
+ return if resource_model.column_names.include? column
56
+
57
+ resource_model.recourse_searchable_associations.find do |one|
58
+ one.klass.recourse_label.to_s == column
59
+ end
60
+ end
61
+
51
62
  # The search the action built, under Ransack's own name for one.
52
63
  def resource_search
53
64
  controller_assign 'q'
@@ -32,13 +32,16 @@ module Recourse
32
32
  # The icon is the counted model's own, whatever leads the words beside it. The
33
33
  # words are wrapped where a picture or a figure stands beside them, so a phone,
34
34
  # which has room for neither, keeps the picture and the figure and drops the words.
35
+ # A figure and its words share one element: the link lays its children out with a
36
+ # gap, and two of them would stand a gap and a space apart.
35
37
  def association_tab_label(record, association, namespace)
36
38
  icon = Recourse.known_model_icon association.klass
37
39
  count = tab_count record, association
38
40
  words = tab_words association, namespace, count
39
41
  words = tag.span words, class: 'recourse-tab-word' if icon || count
42
+ words = tag.span safe_join([count, words], ' ') if count
40
43
 
41
- safe_join [icon && tag.i(class: "bi bi-#{icon}"), count, words].compact, ' '
44
+ safe_join [icon && tag.i(class: "bi bi-#{icon}"), words].compact, ' '
42
45
  end
43
46
 
44
47
  # `ZIPs` where the record keeps no count, and `places` after the `8` where it
@@ -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 = '4.4.1'
3
+ VERSION = '4.4.3'
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: 4.4.1
4
+ version: 4.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob