Page MenuHomePhabricator

Add css class for user status to body tag
Closed, ResolvedPublic

Description

According to action classes in the body tag https://bugzilla.wikimedia.org/show_bug.cgi?id=4438
there should be classes for the user status:

  • user-anon
  • user-logged

Maybe expand it for the user rights

  • user-sysop
  • etc.

Technically this should be no problem since the same is added as javascript variables to the output ("wgUserGroups": ["*"] etc.)


Version: unspecified
Severity: enhancement

Details

Reference
bz34413

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:15 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz34413.
bzimport added a subscriber: Unknown Object (MLST).

Groups are pretty open-ended, I'm not sure how wise it would be to add them all as classes. (Also, 'anon' or 'logged' could be actual group names, leading to a conflict...)

There is a bit of prior art from Wikia that made it's way into my Monaco port code:
https://github.com/dantman/monaco-port/blob/master/ExtendedBodyAttributes.php

.loggedout and .mainpage

However I'm opposed to the idea of user groups in classes.

They have no value in generic css. Since user-rollback isn't the same on one wiki as another and might not even exist.

They have no value for hiding things from users. Because groups do no equate rights. You don't go hiding something with a .user-sysop since that's not a right and you might also need to add say .user-bureaucrat, etc... and of course no-one is going to do that. So this provokes the idea of dozens of wikis using even more bad practice. And there is no way we're going to add user-right-* to body classes since a user could have hundreds of them.

I don't like wgUserGroups. We need to have a wgUserRights so things can be coded properly.

I think this is a dupe of bug 13242.

I could swear there's a different bug where Splarka and I discussed this same idea, but I'll be damned if I can find it.

  • This bug has been marked as a duplicate of bug 13242 ***