Add groups to the /about page

Some updates!

This requested happened faster then I expected :slight_smile: but I should have known.

The reason I didn’t do it initially is because I wanted to avoid an additional request… but I guess it’s unavoidable.

The way the theme component works, is that it matches the corresponding group ID from the theme setting to the site service (this.site.groups) — this contains the ID and the name, but not the full name…

Then the name gets plugged into the /g/${name}/members endpoint… which has the group members, but also does not have the full name…

So to get the full name, I need to make another request to /g/${name}.

The checkbox enables some simple CSS, text-transform: capitalize which capitalizes the first letter of each word.

Though I completely forgot about ::first-letter which I can use instead, so I’ve switched to that… this should be more consistent with our default capitalization now.

If anyone’s wondering, the reason to include this bit about capitalization is because automatic groups, like Trust Level groups, don’t have a full_name field and are always lowercase. What a tangled web we’ve weaved :sweat_smile:

I removed underscores in the component, but not dashes… this update will do both (but only for name, not full_name)

I’ve added a setting with the options:

  • alphabetical
  • order of creation
  • order of theme setting

Note this concerns the order of the additional groups, and won’t impact admins/moderators — which will always be shown first

Ah yes, there’s some CSS in Discourse that only applies to the moderator and admin groups, I’ve added a fix

Adding the description and link to group page are simple changes, I’ve added those (description disabled by default, but available in a setting).

Group owner is possible, but at the moment I reuse a core component AboutPageUsers — and that would need to be modified to be able to display the owner flair on the user avatar (which I think it probably the best place for it).

This component is growing in complexity fairly quickly, so I’m going to hold off on other requests until someone has a specific need for them.

5 Likes