Releases: linkrobins/flarum-badge-labels
Release list
v1.1.0
Everything asked for after the first release is in here.
Badge titles are now a choice of three: on every badge, on the first badge only, which is a member's main one, with the rest left as icons, or off. The setting a forum already has carries over, so nothing changes until it is touched.
The post count has a placement of its own, so it can sit under the avatar while the badges stay beside the username, or the other way around.
A discussion's own badges can take the same pills: sticky, locked, and any others a forum has added. That one is off by default. In the discussion list they move to the line under the title, where there is room for their names, and on a phone they take a line of their own.
The space between the avatar and the first badge under it is a setting now, and starts closer than it used to.
Each pill is evened up inside. The icon had about 5px of room on one side and 11px on the other, and now has the same on both, and every title in a column starts at the same place whatever its icon.
A badge that paints itself through a class instead of naming a colour, such as sticky, drew its title in the theme's plain badge colour rather than its own. The badge now draws the whole pill, so its two ends always match.
On Flarum 1.x a badge group too wide for the post header line used to split the timestamp across two lines and start under the leftover word. It moves down whole now, to the header's own left edge.
Thanks to mihzor, Subarist, and sergtsar for the feedback this release is made of.
Works on Flarum 1.8 and 2.x from the same release.
v1.0.1
Three fixes from the feedback on the release thread, all on phones or in the below-the-avatar placement. Nothing to reconfigure: update and the fixes apply.
Fixed
- Badge pills looked broken on phones. With badge titles turned on for phones, the icon half and the title half of a pill were different heights, so the icon sat off centre and the two halves no longer read as one shape. Flarum makes badges slightly smaller in its compact phone header, and the titles were not following. They do now.
- A tall stack of badges stretched the post. Below the avatar, a member with several badges left a block of empty space under their post and knocked the post out of line with its avatar. The badge list no longer takes up room it does not need, and each post still keeps exactly enough space for the badges it shows, so nothing spills into the post beneath it.
- On phones, the time a post was written now stays beside the username. In the below-the-avatar placement the badges came between the two and pushed the timestamp onto a line of its own. The badges now sit on their own row underneath, the way they do on a desktop.
Thanks to Subarist for reporting the first two with screenshots, and to everyone on the thread for trying the first release so quickly.
v1.0.0
First public release, for testing.
Flarum shows a post author's badges as small icons tucked over the corner of the avatar, and you only find out what one means by hovering it. This extension writes each badge's name next to its icon and moves the badges somewhere they have room.
New
- Each badge becomes a single pill: its icon at the rounded left end, its name at the right, in the badge's own colour. Text colour is picked per badge so it stays readable on light and dark badges alike.
- Choose where the badges sit: in a column below the avatar (the author column widens to make room), or on the post header line beside the username, where they follow the timestamp.
- Optionally show how many posts the author has written, as a pill of its own in your theme's neutral badge colour so it is never mistaken for a group.
- Set how much room the author column gets, from 85 to 400 pixels, when the badges sit below the avatar.
- Phones keep Flarum's compact post header by default, since there is no room for titles there. One switch turns it on for phones too.
Notes
- Every badge is covered, not just group badges. The title comes from whatever each badge already tells Flarum its name is, so badges added by other extensions get labelled too, and badges with no name stay as plain icons.
- Nothing is added to your database, and nothing new is sent to visitors. The post count is the same one Flarum already shows on member profiles.
- Works on Flarum 1.8 and 2.x from this same release.
Thanks to Tutrix, whose CSS this grew out of, in reply to mihzor's request.
This is a first release put out for testing, so please report anything that looks wrong on your forum.