Omit the class description when the group block shows a single class #113

Merged
thatguygriff merged 1 commits from feature/group-class-single-embed-description into main 2026-07-28 13:48:07 +00:00
Owner

Closes #114

The Group Classes block can be pinned to one class (sidebar Classes shown → Class, or [us_group_classes offering="…"]) so it can be embedded on a page dedicated to that class. On such a page the surrounding copy already describes the class, but the card repeated the class description anyway.

In single-class mode the description is now left out. The card still shows the schedule (term dates + class time), instructor, schedule note, price, "Enrol by" deadline, and the enrol / enrolled / withdraw controls. Showing All classes is unchanged — descriptions are still included there.

The editor preview follows the same rule: BlockPreview::groupClasses() takes the mode from the block's offeringId attribute, drops the sample description when a class is pinned, and its note says what the published page shows. The sample card also gained the .us-class-when and .us-enrol-deadline elements the live markup has always rendered, so themes can style against them.

Docs updated (docs/features/editor-blocks.md, docs/features/group-classes.md) and a [1.2.2] changelog entry describes the whole option — the class picker itself shipped in cde8704 but was never recorded.

Tests

  • composer test — 620 tests, 1782 assertions, all pass
  • composer lint — PHPStan level 10, no errors
  • composer cs — PHPCS clean
Closes #114 The **Group Classes** block can be pinned to one class (sidebar **Classes shown → Class**, or `[us_group_classes offering="…"]`) so it can be embedded on a page dedicated to that class. On such a page the surrounding copy already describes the class, but the card repeated the class description anyway. In single-class mode the description is now left out. The card still shows the schedule (term dates + class time), instructor, schedule note, price, "Enrol by" deadline, and the enrol / enrolled / withdraw controls. Showing **All classes** is unchanged — descriptions are still included there. The editor preview follows the same rule: `BlockPreview::groupClasses()` takes the mode from the block's `offeringId` attribute, drops the sample description when a class is pinned, and its note says what the published page shows. The sample card also gained the `.us-class-when` and `.us-enrol-deadline` elements the live markup has always rendered, so themes can style against them. Docs updated (`docs/features/editor-blocks.md`, `docs/features/group-classes.md`) and a `[1.2.2]` changelog entry describes the whole option — the class picker itself shipped in `cde8704` but was never recorded. ### Tests - `composer test` — 620 tests, 1782 assertions, all pass - `composer lint` — PHPStan level 10, no errors - `composer cs` — PHPCS clean
thatguygriff added 1 commit 2026-07-28 13:39:12 +00:00
Omit the class description when the group block shows one class
CI / Tests (PHP 8.1) (pull_request) Successful in 1m13s
CI / Coding Standards (pull_request) Successful in 3m1s
CI / No Debug Code (pull_request) Successful in 2s
CI / Tests (PHP 8.2) (pull_request) Successful in 1m2s
CI / PHPStan (pull_request) Successful in 3m3s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m40s
CI / Build Plugin Zip (pull_request) Skipped
c4acdb7ca4
The Group Classes block can be pinned to a single class via its Class
option so it can be embedded on a page dedicated to that class. On such a
page the surrounding copy already describes the class, so the card
repeated it. In single-class mode the description is now left out and the
card shows only the schedule, instructor, schedule note, price, enrolment
deadline and the enrol/withdraw controls.

The editor preview follows the same rule: BlockPreview::groupClasses()
takes the mode from the block's offeringId attribute, drops the sample
description when a class is pinned, and notes what the published page
shows. Its sample card also gained the .us-class-when and
.us-enrol-deadline elements the live markup has always rendered.

Closes #114

Co-Authored-By: Claude Opus 5 <[email protected]>
thatguygriff force-pushed feature/group-class-single-embed-description from b0952ca06d to c4acdb7ca4 2026-07-28 13:39:12 +00:00 Compare
thatguygriff merged commit d866aa7295 into main 2026-07-28 13:48:07 +00:00
thatguygriff deleted branch feature/group-class-single-embed-description 2026-07-28 13:48:07 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#113