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 +4 -4
- data/lib/recourse/helpers/shapes.rb +11 -2
- data/lib/recourse/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: 25dc12a1680c270205fc1db7405ac15f34b7b1be1185a340520ba0bfb9e442ec
|
|
4
|
+
data.tar.gz: cebe2b2a13e11b31f49019be4bde68c62b7f297b996ba0042e2ba4d00ac59257
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
data/lib/recourse/version.rb
CHANGED