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

Adding role menu and menuitem to navigation menu trees and leafs #9149

Merged
merged 3 commits into from Nov 8, 2015
Merged

Adding role menu and menuitem to navigation menu trees and leafs #9149

merged 3 commits into from Nov 8, 2015

Conversation

tassoman
Copy link
Contributor

@tassoman tassoman commented Nov 2, 2015

This pull request is a first solution to #9148 .

For better results in terms of a11y, I think would be better removing a href="" links from trees menu items (as seen in this Success criteria example code) then managing hide/show behavior by using aria-hidden="true" attribute or jquery code. This part is not covered in this pull request.

If you like the solution I could go on further with another pull request.

@@ -1,6 +1,6 @@
{% macro submenuItem(name, url, anchorlink) %}
{% if name|slice(0,1) != '_' %}
<li>
<li role="menuitem" title="{{ name|translate }}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add |e('html_attr') for proper attribute escaping

@mattab
Copy link
Member

mattab commented Nov 2, 2015

Hi @tassoman

Great to see your pull request to increase accessibility in Piwik! (refs #4167)

If you like the solution I could go on further with another pull request.

For sure it is wonderful if Piwik can be more accessible thanks to your help and Pull requests. We look forward to them!

@tassoman
Copy link
Contributor Author

tassoman commented Nov 3, 2015

Thank you for support on twig filters. I'm going to update my PR asap 👍
Do you think I should use official Twig's docs for reference?
http://twig.sensiolabs.org/doc/templates.html

@mbeccati
Copy link

mbeccati commented Nov 3, 2015

@mattab what have you done?!?! My old friend @tassoman will be your worst nightmare now ;)

@mattab
Copy link
Member

mattab commented Nov 3, 2015

good to see you here @mbeccati

I'm very pleased to help your old friend @tassoman bring accessibility improvements to Piwik... ;-)

<a class="item" href="{% if anchorlink %}#{% else %}index.php?{% endif %}{{ url|urlRewriteWithParameters|slice(1) }}">
{{ name|translate }}
{{ name|translate|e('html_attr') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no |e('html_attr) here. It should be only used when it will be used within an HTML attribute like above in the title attribute.

@tsteur
Copy link
Member

tsteur commented Nov 4, 2015

Note to myself: We need to make sure to apply this in Piwik 3.0 branch as well

@tsteur tsteur added this to the 2.15.1 milestone Nov 5, 2015
{{ 'CoreHome_Menu'|translate }}
</span>
<span class="menu-icon {{ level2._icon|default('icon-arrow-right') }}"></span>
{{ level1|translate }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to bother you again, I noticed some UI tests are failing now because the {{ level1|... } is no longer directly attached to the </span> as it was the case before.

This results in a whitespace between the icon and the menu name and so the menu item names are no longer aligned

menus_admin_loaded

BTW: Are you familiar with squashing commits?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem for bothering, I'm aware of my situation, learning by mistakes 🎓
Thank you for the link about squashing commits, I was unaware because not mentioned in Docs. (I've added a PR also on it)

tsteur added a commit that referenced this pull request Nov 8, 2015
Adding role menu and menuitem to navigation menu trees and leafs
@tsteur tsteur merged commit 6c94558 into matomo-org:master Nov 8, 2015
@tsteur
Copy link
Member

tsteur commented Nov 8, 2015

Thx a lot for this @tassoman well done :)

@tsteur tsteur added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Nov 8, 2015
@tassoman
Copy link
Contributor Author

tassoman commented Nov 9, 2015

Thank you I'm proud I can contribute to Piwik's improvements!

@tsteur
Copy link
Member

tsteur commented Nov 9, 2015

Thanks for your help @tassoman . We feel very lucky to get such contributions. This will soon run on hundred thousands of servers and will be used by many users :) Feel free to issue another PR any time. Cheers

@mattab mattab added the c: Accessibility When something is not usable for a certain group (eg missing contrast) or devices (eg smartphones). label Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Accessibility When something is not usable for a certain group (eg missing contrast) or devices (eg smartphones). not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants