recourse 8.0.0 → 8.1.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 +4 -4
- data/CHANGELOG.md +28 -10
- data/README.md +11 -6
- data/app/controllers/recourse/base_controller.rb +1 -1
- data/app/controllers/recourses_controller.rb +1 -1
- data/app/views/layouts/recourses.html.erb +5 -3
- data/lib/recourse/assets.rb +5 -0
- 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: 0b91067feabacd9f9f715400c5362b40040ed2658cab10377dbf2ca2c935697e
|
|
4
|
+
data.tar.gz: ef680fd9ad956b89360d7b88e80b14fc8dd7d72ed4424bab2d53e8d57e4563bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2555d8a1633195677280425138efce99f86996a81f15b3b5989c7a5a22ce86df2cbee1b8ef0ed7ab1fecdb7cba99cd3fe0be3f3e94e65945d0b8acba684d16d2
|
|
7
|
+
data.tar.gz: fc1f4f6410f9ac3d26c8de7b6f013309a43270f725be8c2b75a292b16ab747b852a52016a602869467a543256eee33bcbb2d1c997b7c08bdfac941be26322bac
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,24 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## 8.1.0 - 2026-10-14
|
|
11
|
+
|
|
12
|
+
* [FEATURE] The layout links the Bootstrap Icons it draws with
|
|
13
|
+
|
|
14
|
+
Every icon on these pages is named in Bootstrap Icons, but no stylesheet carried the
|
|
15
|
+
font, so a host had to link it from a `recourses/head` partial or see blank buttons. The
|
|
16
|
+
layout now links `Recourse.icons`, jsDelivr's copy of Bootstrap Icons 1.13.1 by default;
|
|
17
|
+
a host serving the font itself points the setting at its copy, or sets it to `nil`.
|
|
18
|
+
|
|
19
|
+
## 8.0.1 - 2026-10-14
|
|
20
|
+
|
|
21
|
+
* [FIX] Guard the screens with `prepend_before_action`, not `before_action`
|
|
22
|
+
|
|
23
|
+
Since 8.0.0 a record's pages look it up through `recourse_relation` before any
|
|
24
|
+
`before_action` of the host's runs, so a relation reading who is signed in -- an admin's
|
|
25
|
+
own chats -- found nobody and raised. The README, the guides and the comments now say
|
|
26
|
+
`prepend_before_action :authenticate!`, which runs the guard first.
|
|
27
|
+
|
|
10
28
|
## 8.0.0 - 2026-10-14
|
|
11
29
|
|
|
12
30
|
* [BREAKING] A record's own pages find it among the rows `recourse_relation` lists
|
|
@@ -320,9 +338,9 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
320
338
|
|
|
321
339
|
## 5.6.1 - 2026-09-18
|
|
322
340
|
|
|
323
|
-
* [Change] The pinned bundle is
|
|
341
|
+
* [Change] The pinned design bundle is 0.14.2
|
|
324
342
|
|
|
325
|
-
A conversation reads at the
|
|
343
|
+
A conversation reads at the design bundle's own size wherever it is drawn, a bubble inside a flow
|
|
326
344
|
is read from its start, and a focus ring is no longer painted over by the link below it.
|
|
327
345
|
These pages compact their body type for tables dense with figures, which is what made the
|
|
328
346
|
first of those visible here.
|
|
@@ -374,7 +392,7 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
374
392
|
breadcrumb over such a page raised instead of reading. It asks whether what it found
|
|
375
393
|
answers `model_name`, the way `known_icon` beside it already does.
|
|
376
394
|
|
|
377
|
-
* [Feature] `Recourse.assets` says where the
|
|
395
|
+
* [Feature] `Recourse.assets` says where the design bundle is served from
|
|
378
396
|
|
|
379
397
|
The stylesheet, the script and the palettes were three URLs carrying one pinned version,
|
|
380
398
|
moved together by hand every release — the 5.5.0 entry below says as much. They are one
|
|
@@ -382,11 +400,11 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
382
400
|
from, and jsdelivr's copy of the published package stays the default.
|
|
383
401
|
|
|
384
402
|
A host that sets `Recourse.assets = ''` serves the bundle itself, out of the
|
|
385
|
-
|
|
403
|
+
design gem mounted by path: its engine answers `/css`, `/js` and `/theme` from
|
|
386
404
|
its own `public/`. That is how a stylesheet or a controller gets tried on a real page
|
|
387
405
|
before the version carrying it is published, which is what this release needed.
|
|
388
406
|
|
|
389
|
-
* [Change] The pinned bundle is
|
|
407
|
+
* [Change] The pinned design bundle is 0.14.0
|
|
390
408
|
|
|
391
409
|
What carries the `sortable` controller the feature above names, and the two rules beside
|
|
392
410
|
it: the grip's cursor, and the tint on the space a dragged row will land in.
|
|
@@ -407,7 +425,7 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
407
425
|
glyphs point either way with either ordering. Both draw from the bundle this release
|
|
408
426
|
pins, whose subset carries `sort-up` beside the `sort-down` it already held.
|
|
409
427
|
|
|
410
|
-
* [Change] The pinned bundle is
|
|
428
|
+
* [Change] The pinned design bundle is 0.13.0
|
|
411
429
|
|
|
412
430
|
Two releases at once, since the pin was still at 0.11.0 while 0.12.0 came and went. It is
|
|
413
431
|
what carries the ascending sort glyph, so the fix above needs it; it also brings a card
|
|
@@ -506,11 +524,11 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
506
524
|
|
|
507
525
|
## 5.0.0 - 2026-09-14
|
|
508
526
|
|
|
509
|
-
* [Breaking change] Every page is styled and scripted by
|
|
527
|
+
* [Breaking change] Every page is styled and scripted by the design site, and nothing is served by the gem
|
|
510
528
|
|
|
511
529
|
The vendored Bootstrap, its icons and fonts, Stimulus, the sixteen controllers, the nine
|
|
512
530
|
palettes and the layout's own stylesheet have moved to the `design` repo, which publishes
|
|
513
|
-
them at `/v<version>/css
|
|
531
|
+
them at `/v<version>/css/<bundle>.css`, `/v<version>/js/<bundle>.js` and
|
|
514
532
|
`/v<version>/theme/<name>.css` on that origin, kept forever per version. The layout links
|
|
515
533
|
the first two at a pinned version, and `Recourse::THEMES_PATH` names the third at the
|
|
516
534
|
same one; a fix there reaches these pages when the pin moves, and not before. The
|
|
@@ -518,8 +536,8 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
|
|
|
518
536
|
|
|
519
537
|
A host needs that origin reachable from its readers' browsers. A host with a Content
|
|
520
538
|
Security Policy allows it for `style-src`, `script-src` and `font-src`. A host on the
|
|
521
|
-
|
|
522
|
-
|
|
539
|
+
design gem serves the same paths itself, but this gem still links the site: it never names
|
|
540
|
+
that gem.
|
|
523
541
|
|
|
524
542
|
* [Breaking change] A combobox is a `<select>`, and a filter submits one value per pick
|
|
525
543
|
|
data/README.md
CHANGED
|
@@ -20,10 +20,10 @@ gem 'recourse', '~> 8.0'
|
|
|
20
20
|
`~> 8.0` follows Semantic Versioning: `bundle update` takes every 8.x and never a
|
|
21
21
|
breaking change. Rails 8.1 and Ruby 3.2 are the minimum; the pages need Turbo, which
|
|
22
22
|
`turbo-rails` brings, and nothing else in the host. Everything a page is styled and
|
|
23
|
-
scripted by — Bootstrap 6,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
scripted by — Bootstrap 6, Turbo, Stimulus and the controllers behind these screens — is
|
|
24
|
+
`bh`, which this gem depends on and whose engine serves them at `/bh/`, so a host without
|
|
25
|
+
an asset pipeline gets the same screens. The icons are Bootstrap Icons, whose font the
|
|
26
|
+
layout links from `Recourse.icons`: jsDelivr's copy unless a host names its own, or `nil`.
|
|
27
27
|
|
|
28
28
|
## Step 1. Edit your routes
|
|
29
29
|
|
|
@@ -168,13 +168,18 @@ which the host defines to put behavior above every screen at once:
|
|
|
168
168
|
|
|
169
169
|
```ruby
|
|
170
170
|
class RecoursesController < Recourse::BaseController
|
|
171
|
-
|
|
171
|
+
prepend_before_action :authenticate!
|
|
172
172
|
end
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
+
`prepend_before_action`, so the guard runs before the gem's own: a record's pages look
|
|
176
|
+
it up through `recourse_relation`, and a relation that reads who is signed in finds
|
|
177
|
+
nobody yet if the guard comes after.
|
|
178
|
+
|
|
175
179
|
A controller the app already defines is left alone, and one line of it is usually
|
|
176
180
|
enough: `recourse_relation` puts a scope of your own behind a table the gem draws
|
|
177
|
-
whole, and behind the pages of each record in it, and `find_resource` finds a singular
|
|
181
|
+
whole, and behind the pages of each record in it, and `find_resource` finds a singular
|
|
182
|
+
record the parent names no association for.
|
|
178
183
|
|
|
179
184
|
## Step 5. Enjoy the extras
|
|
180
185
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Recourse
|
|
2
2
|
# Everything a recoursed screen does, in a class of its own so a host can put
|
|
3
3
|
# its own behavior above it — `class RecoursesController < Recourse::BaseController`
|
|
4
|
-
# with a `
|
|
4
|
+
# with a `prepend_before_action :authenticate!` guards every screen the gem serves.
|
|
5
5
|
class BaseController < ApplicationController
|
|
6
6
|
include Pagy::Method, Positioned, AttachmentResolution, AttachmentWriting,
|
|
7
7
|
Landing, Paging, ListResolution, ParameterResolution, ParentNaming,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# The superclass every recoursed controller gets, and what puts its templates
|
|
2
2
|
# under `recourses/`. A host defines this class itself — its `app/controllers`
|
|
3
|
-
# comes first — to put a `
|
|
3
|
+
# comes first — to put a `prepend_before_action` of its own above every screen.
|
|
4
4
|
class RecoursesController < Recourse::BaseController
|
|
5
5
|
# Empty on purpose: the behavior is the base class, so a host redefining this
|
|
6
6
|
# one loses none of it.
|
|
@@ -18,10 +18,12 @@
|
|
|
18
18
|
<%= yield :head %>
|
|
19
19
|
|
|
20
20
|
<%# Everything the page is styled by: Bootstrap 6 and bh's rules for this gem's
|
|
21
|
-
markup, served by bh's own engine
|
|
22
|
-
|
|
21
|
+
markup, served by bh's own engine, and the Bootstrap Icons every icon here is
|
|
22
|
+
named in. `Recourse.assets` and `Recourse.icons` are where, and a host serving
|
|
23
|
+
those files from somewhere else says so there. -%>
|
|
23
24
|
<link rel='stylesheet' href='<%= Recourse.asset 'css/bh.css' %>'>
|
|
24
|
-
|
|
25
|
+
<%= tag.link rel: 'stylesheet', href: Recourse.icons if Recourse.icons %>
|
|
26
|
+
<%# The one thing these screens set that bh's stylesheet does not: system faces
|
|
25
27
|
at a compact size, for pages dense with figures. 14px as rem, so a browser's own
|
|
26
28
|
text-size setting still scales it. After the stylesheet, since both are `:root`. -%>
|
|
27
29
|
<style>
|
data/lib/recourse/assets.rb
CHANGED
|
@@ -9,9 +9,14 @@ module Recourse
|
|
|
9
9
|
# A host serving those files from somewhere else — a CDN, a bundle of its own that
|
|
10
10
|
# carries bh's layer — points this at it, and that is the whole of what it writes.
|
|
11
11
|
attr_accessor :assets
|
|
12
|
+
|
|
13
|
+
# The stylesheet of Bootstrap Icons, whose names every icon on these pages is drawn by.
|
|
14
|
+
# A host serving the font itself points this at its own copy, or sets it to nil.
|
|
15
|
+
attr_accessor :icons
|
|
12
16
|
end
|
|
13
17
|
|
|
14
18
|
@assets = Bh::Engine::PREFIX.chomp '/'
|
|
19
|
+
@icons = 'https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css'
|
|
15
20
|
|
|
16
21
|
# One file of the design layer.
|
|
17
22
|
def self.asset(path) = "#{assets}/#{path}"
|
data/lib/recourse/version.rb
CHANGED