Very often there are some problems with warnings about the impossibility of editing, which need to be addressed pointwise. Colorize the entire block, or hide it for certain editors. It is also often necessary to quickly understand where this message is coming from in order to be able to correct it.
It seems to me that it would be useful for each message to set its own class, which would display in the DOM what kind of message it is.
For example:
https://ru.wikipedia.org/wiki/MediaWiki:Protectedpagetext | mw-permissionerror-protectedpagetext |
https://ru.wikipedia.org/wiki/MediaWiki:Blockedtext | mw-permissionerror-blockedtext |
And do this for each MediaWiki message that is inserted as a warning by engine.
QA steps
- Visit https://en.wikipedia.beta.wmflabs.org/wiki/Protected_page?action=edit and inspect the HTML. Ensure that the element has the class mw-permissionerror-protectedpagetext
Developer notes
Edit warnings show when the user doesn't have permission to do something.
Edit warnings are set inside includes/OutputPage.php (OutputPage::formatPermissionsErrorMessage)
There are two scenarios: 1 error shown or multiple errors shown.
When one error is shown the expected output would be:
<div class="permissions-errors"> <div class="$newClass"></div> </div> `
When multiple errors:
<div class="permissions-errors"> <ul> <li class="$newClass"></li> <li class="$newClass2"></li> </ul> </div>
The class should be "mw-permissionerror-<msg-key>"