recourse 5.9.1 → 5.9.2

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: 70d04d12275cf8524fd076d13543cb7fa1bb606e317fef64d21eff5b13abf92c
4
- data.tar.gz: 13ea5ed9a84fcd3e069ec8ebe613e93dff6a4c8ba7a11214fdc1539f3e98e6de
3
+ metadata.gz: 25dc12a1680c270205fc1db7405ac15f34b7b1be1185a340520ba0bfb9e442ec
4
+ data.tar.gz: cebe2b2a13e11b31f49019be4bde68c62b7f297b996ba0042e2ba4d00ac59257
5
5
  SHA512:
6
- metadata.gz: 336ac0bda118932020f25bbb5f4ac1754bdedea678fd27692689456521e457a02d75ca02ef8554d2033cf717e9e040953f3f21cc97d523efc0ab9ef3789f5409
7
- data.tar.gz: e1b962b9bb79ce0409f921199e794470365d4edbbaf118a40ddf8f43f3bebacd592e0f8660d9b165901e96b0708a6be236dffb2a4675052995bf2ea9c4c8b325
6
+ metadata.gz: d96675d0ce0922948410a1e13835bb19d9354c1b1e85710e5c8f01b942b83e77547367552ca4f234bd6bfe0d710b21306e105b025b9845ce8c4aa0b4b0a4c023
7
+ data.tar.gz: a0cbef102e56493def2d5e105f3bb463952a5aa636106ac8272d7eefb436fff3dfd50db469f42173acf4f202b329cb191b2c915866b10deef92b954d23882dee
@@ -23,17 +23,26 @@ module Recourse
23
23
  shapes
24
24
  end
25
25
 
26
+ # Which shape this page is, which is the page's own business rather than the
27
+ # request's: a table asked for as a Turbo Stream is still a table, and reading the
28
+ # shape off the format offered a link to the page being read.
29
+ def current_shape
30
+ return :map if map_view?
31
+ return :cal if calendar_view?
32
+
33
+ :html
34
+ end
35
+
26
36
  # A link to each shape the page is not in, carrying the query it was asked with —
27
37
  # the search, the sort and the page — so another shape shows the rows the table
28
38
  # did. The week stays behind: only a calendar has one, and a calendar reached
29
39
  # from the table opens on this week.
30
40
  def view_links
31
- shapes = view_shapes
32
41
  query = request.query_parameters.except 'week'
33
42
 
34
43
  # The table is the page at its own address, which is the one shape asked for by
35
44
  # carrying no extension at all.
36
- shapes.except(request.format.symbol).map do |shape, key|
45
+ view_shapes.except(current_shape).map do |shape, key|
37
46
  link_to t(key), url_for(query.merge(format: (shape unless shape == :html)))
38
47
  end
39
48
  end
@@ -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 = '5.9.1'
3
+ VERSION = '5.9.2'
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: 5.9.1
4
+ version: 5.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - claudiob