Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Articles frontend associations badges changed to buttons and more #32992

Merged
merged 6 commits into from
Apr 14, 2021

Conversation

infograf768
Copy link
Member

@infograf768 infograf768 commented Apr 4, 2021

Pull Request for Issue #32978

Summary of Changes

Using buttons instead of badges to display lang tags for articles associations.
(see f7833a4 as example)

Using full lang tag in button to let choose when we have the same language for different countries: de-DE, de-AT,

----EDIT: Creating btn-secondary and btn-sm overrides

Testing Instructions

Create a multilingual site with the specific sample data.
Create a list category for the category concerned by the associated articles per default.
Make sure Articles Options Associations are set and not use flags

Screen Shot 2021-04-04 at 11 11 41

Load Home page. Load list category menu item.

patch and test again.

Needs npm

Actual result BEFORE applying this Pull Request

Bildschirmfoto 2021-04-03 um 09 59 50

Expected result AFTER applying this Pull Request

assoc_front-home-2

assoc_front-list-2

Note: may need some more concerning a11y

@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-4.0-dev labels Apr 4, 2021
@ghost
Copy link

ghost commented Apr 4, 2021

Thanks @infograf768 for the PR which i can not test cause Needs npm, sorry.

@joomdonation
Copy link
Contributor

@sandramay0905 You can test it by download update package for this PR https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/32992/downloads/41573/Joomla_4.0.0-beta8-dev+pr.32992-Development-Update_Package.zip , go to System -> Update -> Joomla, open Upload & Update tab, select that package, click on Upload & Install button

update

@brianteeman
Copy link
Contributor

It seems wrong to me to be adding this class to the bootstrap file as that is really for overrides not for new classes

I dont see why you are inventing a new class of btn-badge and then having to invent a new size when the badge size would be perfectly ok if that was used.

The problem you are trying to solve here (as I understand it) is the current hover styling making the text unreadable and the underline.

Both of those can be resolved purely in css without changing any markup and still only targeting the associations

.association a {
    color: #fff;
    text-decoration: none;
}

@ghost
Copy link

ghost commented Apr 4, 2021

I have tested this item ✅ successfully on 63e08b2

Thanks @joomdonation for the hint. I used the custom update server, i wasn't aware of both possibilities.


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

@infograf768
Copy link
Member Author

I dont see why

Indeed you don't.

@brianteeman
Copy link
Contributor

So please explain

@infograf768
Copy link
Member Author

Please @drmenzelit explain to the guy.
I am tired.

@drmenzelit
Copy link
Contributor

In Bootstrap 4 it was possible to use .badge-* as contextual class in links (https://getbootstrap.com/docs/4.0/components/badge/#links). That was changed in Bootstrap 5, now one should use .btn-* classes. The class .btn-sm is still too big for the associations and we have already an override for .btn-secondary. We have two options: we create a new class or we have to make some overrides of the BS classes for the associations views.
We can move the new class to _global.scss or on a new file under joomla-custom-elements to avoid confusions with the overrides of BS classes.

@brianteeman
Copy link
Contributor

brianteeman commented Apr 4, 2021

Which is what I said. As its not an override it should not be in the bootstrap override files but instead be in a component specific file in the pages folder such as _com_associatons

@chmst
Copy link
Contributor

chmst commented Apr 4, 2021

I vote for overrides of the BS classes for the associations views.

@infograf768
Copy link
Member Author

infograf768 commented Apr 4, 2021

OK. Things are now clearer.
We have to use buttons instead of badges in frontend and create our own button for this specific case.

Now, where do we add the new classes?
Do the new classes have to be added in the build/media_source/com_associations/css/sidebyside.css (which is only loaded in the association tmpl) or a new buttons.css file in the same folder,
and then loaded directly in both cases layout/content/info_block/associations.php and /components/com_content/tmpl/category/default_articles.php via

if (Associations::isEnabled())
{
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $app->getDocument()->getWebAssetManager();
$wa->registerAndUseStyle('com_associations, 'com_associations/sidebyside.css'); // or buttons.css
}

@infograf768
Copy link
Member Author

infograf768 commented Apr 4, 2021

The other solution is to make sure we have a association class added in the /components/com_content/tmpl/category/default_articles.php <div> (it exists in the infoblock for <dd>)

and then create the override for btn-secondary in the bootstap overrides _buttons.scss (or in a new file _associations.scss) in vendor/bootstrap/ as

.association .btn-secondary {

.association .btn-sm {

@infograf768
Copy link
Member Author

Modified PR to override btn-secondary and btn-sm instead of creating btn-badge and btn-vsm

Same results. Modifying now description.

@infograf768
Copy link
Member Author

Can be tested again. Needs NPM.
@sandramay0905 At this time we have an issue with drone and it is impossible to get the corrected update package for the PR.

@infograf768
Copy link
Member Author

@Quy
used visually-hidden instead of sr-only + reformatted the css

@infograf768
Copy link
Member Author

@ghost
Copy link

ghost commented Apr 8, 2021

I have tested this item 🔴 unsuccessfully on bff5a71


"Standard Colour Theme" show different look than "Expected result AFTER applying this Pull Request":

Article Category List
grafik grafik

"Alternative Colour Theme" show like "Expected result AFTER applying this Pull Request":

Article Category List
Bildschirmfoto 2021-04-08 um 10 19 27 Bildschirmfoto 2021-04-08 um 10 19 54

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

@infograf768
Copy link
Member Author

@sandramay0905
I do not confirm your findings here. The colors are totally independent of the colors themes

.article-info .association,
.cat-list-association {
  .btn-secondary {
    font-weight: 700;
    color: $white;
    background-color: $gray-600;
    border-color: $gray-400;

    &:hover,
    &:focus {
      color: $white;
      background-color: $gray-800;
    }
  }

I guess you had an issue when applying the PR.

@ghost
Copy link

ghost commented Apr 8, 2021

I used https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/32992/downloads/41753/pr_list.xml for update.

@infograf768
Copy link
Member Author

Please make a clean install of https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/32992/downloads/41753/Joomla_4.0.0-beta8-dev+pr.32992-Development-Full_Package.zip

I just checked that pack and it includes the correct css and modifiations in the php files

@ghost
Copy link

ghost commented Apr 8, 2021

Please make a clean install

i can only make a clean install of Joomla4 at launch.joomla.org and test.

@infograf768
Copy link
Member Author

Then maybe use the same trick explained above
#32992 (comment)

@ghost
Copy link

ghost commented Apr 8, 2021

Then maybe use the same trick explained above

Using this trick i found, what i wrote at #32992 (comment):

Bildschirmfoto 2021-04-08 um 11 42 01

The Info by Joomla You can test this package as an update by using this custom update server is not true?

@infograf768
Copy link
Member Author

no ideA. i never use that...

@ghost
Copy link

ghost commented Apr 8, 2021

i used it at other pr's and it worked.

@Quy
Copy link
Contributor

Quy commented Apr 8, 2021

I have tested this item ✅ successfully on bff5a71


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

@ghost
Copy link

ghost commented Apr 9, 2021

@infograf768 unsuccessfully test #32992 (comment) looks like a firefox-issue on mac.

Firefox Safari
Bildschirmfoto 2021-04-09 um 11 04 46 Bildschirmfoto 2021-04-09 um 11 05 12

grafik

@infograf768
Copy link
Member Author

infograf768 commented Apr 9, 2021

@sandramay0905
It is working here on Firefox Macintosh.(87.0 (64-bit)) OS 10.12.6

Clean all your caches.

@infograf768
Copy link
Member Author

infograf768 commented Apr 9, 2021

@PhilETaylor
I know you have Mac OS 10.13.
Please test this PR on Firefox.

@ghost
Copy link

ghost commented Apr 9, 2021

It is working here on Firefox Macintosh.(87.0 (64-bit)) OS 10.12.6

then there is a failure on my side, sorry.

@PhilETaylor

This comment was marked as abuse.

@Quy
Copy link
Contributor

Quy commented Apr 9, 2021

@sandramay0905 Try clearing your browser's cache.

@ghost
Copy link

ghost commented Apr 10, 2021

I have tested this item ✅ successfully on bff5a71


Private Modus of firefox was the solution. Not true, got at another test similar problems. Best solution seems #32992 (comment)
Thanks for the help at all.


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

@infograf768
Copy link
Member Author

RTC

Tks for testing


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 10, 2021
@infograf768 infograf768 added this to the Joomla 4.0 milestone Apr 10, 2021
@rdeutz rdeutz merged commit 95e8387 into joomla:4.0-dev Apr 14, 2021
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Apr 14, 2021
@infograf768 infograf768 deleted the 4.0_assoc_buttons_frontend branch April 14, 2021 11:19
mstrap pushed a commit to mstrap/joomla-cms that referenced this pull request Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NPM Resource Changed This Pull Request can't be tested by Patchtester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants