Due to some of the portions of the gadget list items being optional
it's not consistent whether or not they should be separated by
a line break.
When two pieces of text follow each other, there should be a line
break in-between.
When a piece of text is output afte a list, however, there is no
need for a line break as anything after a list would already
become its own line. Printing one anyway causes a blank space
to show up, which visually causes it to appear related to the
next gadget.
Fix by setting a boolean after each portion to indicate whether
or not it should be followed by a line break.
Also improve the code a bit with comments and use Html instead
of Xml.
Bug: T204616
Change-Id: If65e170746898999dd8f5351004eeaf49b340ab2
The lengthy and localised descriptions make it hard to scan and
identify the actual rights themselves. They are meant as descriptions
to explain what a right is, not to identify the right itself.
It should probably be more similar to the list of checkboxes
on Special:UserRights. For now, kept the descriptions as tooltips,
but could also remove them entirely.
Change-Id: I29f68ffd5a8d002b65384f3762fb9e5631c13def
The wrapper tags that we have to create when using the 'rawrow' option
would have to be different for OOUI and non-OOUI preferences forms,
making it impossible to support both at the same time.
We used it in order to generate `<td colspan=2>...</td>` rather than
`<td></td><td>...</td>`, and make the description span both the label
and the input columns. However, this is not necessary, because the
label column is entirely hidden on this page of preferences, as all of
the preferences have no labels.
Bug: T203202
Change-Id: Ib9510a8bfb2430fdda3988d88628c9f0c509c6d0
* "raw" and "rawrow" are documented as booleans.
* "raw" does not have any effect if "rawrow" is set.
* "label" does not have any effect if "rawrow" is set.
* "noglobal" refers to GlobalPreferences. It does not have any effect
because "info" fields are blacklisted anyway.
https://github.com/wikimedia/mediawiki-extensions-GlobalPreferences/blob/master/includes/GlobalPreferencesFactory.php#L75
Also see my longer comment in I1ab2bc6 where I explain all these changes.
Change-Id: I7b4e08b45070ae07935e1cd59091b3d608583e5b
This change raises MediaWiki version requirement to 1.32.
Change-Id: Ieffed829bf5a8e1f138fd5f63518e415cebb1287
Depends-On: I193f5b9a95430b0a05573c361715e053e5411e32
The user's preference usually reflects the displayed skin, however this isn't
true if the `useskin` URL query is set, or MobileFrontend is being used.
This fixes gadgets being displayed on the wrong skin when using `useskin`,
and allows mobile-specific gadgets (using `skins=minerva`).
Testing if the gadget is allowed in the current skin is split out from
`isAllowed` to `isSkinSupported` to enable a future patch showing gadgets
on preferences regardless of if they are allowed on the current skin.
Test coverage is added for both functions.
Also fixed another test which wasn't working, presumably because the placeholder
user didn't have the "read" right, so the section wasn't being kept.
Bug: T199478
Change-Id: I21febe92d54d6d0b89925f902581cc2739d824fb
This is more an integration test than anything. The @covers tags I found
are to strict, in my opinion. These test cases cover more code.
Change-Id: I6cef7ce0c612ac3dfbb855c495032df1fe96f4af