? Success

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
31 Aug 2015

See #7786
Edit and save an article in frontend in protostar.
After patch the alert message will now be in green for success.
screen shot 2015-08-31 at 09 08 13

avatar infograf768 infograf768 - open - 31 Aug 2015
avatar infograf768 infograf768 - change - 31 Aug 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 Aug 2015
Labels Added: ?
avatar Bakual
Bakual - comment - 31 Aug 2015

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?

avatar infograf768
infograf768 - comment - 31 Aug 2015

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.

avatar MAT978
MAT978 - comment - 31 Aug 2015

successfully tested - thanks


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7788.

avatar MAT978 MAT978 - test_item - 31 Aug 2015 - Tested successfully
avatar mbabker
mbabker - comment - 31 Aug 2015

@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).

avatar Bakual
Bakual - comment - 31 Aug 2015

@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.

avatar mbabker
mbabker - comment - 31 Aug 2015

So there's two options:

  • This PR, which only changes Protostar, and assumes other templates are styling messages based on the classes being pushed in unconverted
  • Your idea, which adds additional classes to the default layout, and based on what order the classes may appear in or whether there is CSS defined for them, may affect the display of template's message containers

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).

avatar Bakual
Bakual - comment - 31 Aug 2015

Ok, so let's go with this PR and do it better with J4 :+1:

avatar Bakual Bakual - test_item - 31 Aug 2015 - Not tested
avatar Bakual Bakual - test_item - 31 Aug 2015 - Tested successfully
avatar infograf768
infograf768 - comment - 31 Aug 2015

I guess therefore that this can go rtc and Merged

avatar infograf768 infograf768 - change - 31 Aug 2015
Status Pending Ready to Commit
avatar Bakual Bakual - change - 31 Aug 2015
Labels Added: ?
avatar Bakual
Bakual - comment - 31 Aug 2015

Set it RTC. Someone else has to merge it :-)

avatar Bakual Bakual - change - 31 Aug 2015
Milestone Added:
avatar zero-24 zero-24 - change - 31 Aug 2015
Category Front End UI/UX
avatar zero-24 zero-24 - change - 31 Aug 2015
Easy No Yes
avatar Kubik-Rubik
Kubik-Rubik - comment - 1 Sep 2015

Thank you @infograf768! Merged.

avatar Kubik-Rubik Kubik-Rubik - change - 1 Sep 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-09-01 17:42:57
Closed_By Kubik-Rubik
avatar Kubik-Rubik Kubik-Rubik - close - 1 Sep 2015
avatar joomla-cms-bot joomla-cms-bot - close - 1 Sep 2015
avatar joomla-cms-bot joomla-cms-bot - change - 1 Sep 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment