ProfessionalWiki / chameleon

Provides a highly flexible and customizable skin using Bootstrap 4
https://www.mediawiki.org/wiki/Skin:Chameleon
Other
114 stars 62 forks source link

Add option to PersonalTools to show lone menu items directly in navbar #357

Closed mdoggydog closed 1 year ago

mdoggydog commented 1 year ago

This commit adds a promoteLoneItems parameter to the PersonalTools component. If there is only one personal tool, and its name is in the parameter, then the link for that tool will be rendered directly in the navbar (instead of in a dropdown menu).

A prime use of this parameter is for a semi-private wiki, where a logged-out user only has the login tool available. With this parameter, the login button can be directly rendered (and thus, clicked) in the navbar, instead of being hidden in a menu activated by a dropdown toggle.

mdoggydog commented 1 year ago

(I'm sorry that I haven't provided unit-tests for this PR. To be honest, I haven't yet figured out how to run the existing chameleon unit-tests. (Via the available docs, I can't even get the docker environment working for MW < 1.38....))

malberts commented 1 year ago

(I'm sorry that I haven't provided unit-tests for this PR. To be honest, I haven't yet figured out how to run the existing chameleon unit-tests. (Via the available docs, I can't even get the docker environment working for MW < 1.38....))

Yeah I think the testing docs might be outdated. In my docker environment, I run this from the chameleon directory:

php ../../tests/phpunit/phpunit.php .

And then you should get something like this: Screenshot_20221105_090004