Problem/Motivation
It would be nice if themes could provide unique styling (colors, etc.) based on revision status, published, and latest revision info. This patch adds some classes to assist with that, and default styles in the module to indicate node/revision properties like published, latest and current.
Identifying revision state currently can be done by visually scanning for the text. With a small amount of additional CSS we can enhance this by making entire rows visibly distinguishable by moderation state and active/current revision flag.
Steps to reproduce
View a node revisions path at node/469/revisions with Diff module enabled.
Proposed resolution
Set row classes for each moderation state and add a library for moderation state colors.
Remaining tasks
- [x] Prototype
- [x] Consider https://www.drupal.org/docs/develop/user-interface-standards/table
- [ ] Consider UX of color usage
- [x]
Consider aria labels - don't think TR can have labels applied? - [x]
Consider Drupal\node\Controller\NodeController::revisionOverview - [ ] Add tests
User interface changes
Colors on revisions list.
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | diff-add_classes-3252547-2.patch | 1.02 KB | azinck |
Issue fork diff-3252547
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
azinck commentedComment #4
xurizaemonComment #6
xurizaemonComment #7
xurizaemonComment #8
xurizaemonARIA labels on the TR: I don't think we can do this, since it requires an interactive element per https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attribut...
Compared to Drupal\node\Controller\NodeController::revisionOverview - before MR,
revision-currentis already provided by Drupal\diff\Form\RevisionOverviewForm. We will addrevision-latestandmoderation-state-<state_machine_name>.Comment #9
xurizaemonComment #10
xurizaemonComment #11
heddnComment #12
acbramley commentedMR has conflicts and I'm personally not a huge fan of changing this in the module. People are used to the defaults by now and admin themes should be IMO in charge of stylising these types of things.