User tests: Successful: Unsuccessful:
See #7786
Edit and save an article in frontend in protostar.
After patch the alert message will now be in green for success.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
I did not do the change there (we also have to add the $alert = array( etc.
) because I feared not being B/C.
You folks decide. The PR is easy to change.
successfully tested - thanks
@Bakual If you wanted to do that you'd have to make sure that the non-prefixed names aren't used elsewhere in Bootstrap as contextual class helpers.
Edit: Also, our alert classes in the code don't directly align with the alert classes used in Bootstrap, hence the need for the conversion array (there is no alert-message
class).
@mbabker The current code produces already prefixed classnames (see https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/system/message.php#L19).
The table below shows what will change with this PR. All classes currently used aren't used in Bootstrap, except alert-error
.
Type | Default Class | Bootstrap Class | Comment |
---|---|---|---|
message | alert-message | alert-success | Broken, currently yellow, becomes green |
notice | alert-notice | alert-info | Broken, currently yellow, becomes blue |
warning | alert-warning | No change, shows yellow (default) | |
error | alert-error | alert-error | No change, shows red |
My proposal would add both classes, the existing and the bootstrap one. Which should make sure existing templates still work as expected.
On a sidenote: #7070 added alert-message
for the body part of the alert. This was of course badly named as it's already a possible value (default one) of the whole message container.
So there's two options:
Personally, I'd go with this PR as is. Yes, it's bad enough that our defaults are inconsistent, but adding another class to the div container (so you may have <div class="alert alert-notice alert-info">
has more issues than it potentially solves (if the template has a styling for alert-notice
it may be overridden by alert-info
based on the order of CSS rules or class names).
Ok, so let's go with this PR and do it better with J4
I guess therefore that this can go rtc and Merged
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Set it RTC. Someone else has to merge it :-)
Milestone |
Added: |
Category | ⇒ | Front End UI/UX |
Easy | No | ⇒ | Yes |
Thank you @infograf768! Merged.
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-09-01 17:42:57 |
Closed_By | ⇒ | Kubik-Rubik |
Labels |
Removed:
?
|
Agree with the change and tested succesfully. It also makes output in backend and frontend more consistent.
The only thing I find less optimal is that this only fixes it for Protostar. Each (Bootstrap based) template which wants to do the same, needs to create an override as well. Which imho isn't optimal. Our core should output Bootstrap compatible markup by default.
I wonder if we instead can change the default system layout. Instead of replacing the class, add an additional one to the output.
So instead of
<div class="alert <?php echo $alert[$type]; ?>">
make it
<div class="alert alert-<?php echo $type; ?> <?php echo $alert[$type]; ?>">
Imho that should work and shouldn't break existing templates as the existing classes would still be present for templates which supported them.
What do you think?