Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Comptoir du Libre v3 - Upcoming version
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Comptoir
Comptoir du Libre v3 - Upcoming version
Commits
14fb0f8e
Commit
14fb0f8e
authored
2 months ago
by
Fabrice Gangler
Browse files
Options
Downloads
Patches
Plain Diff
fix: autogenerate footer links with aria-current attribute if necessary
parent
d6acaf52
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webapp/templates/app_base.html.twig
+7
-1
7 additions, 1 deletion
webapp/templates/app_base.html.twig
webapp/templates/app_base_footer.html.twig
+37
-26
37 additions, 26 deletions
webapp/templates/app_base_footer.html.twig
with
44 additions
and
27 deletions
webapp/templates/app_base.html.twig
+
7
−
1
View file @
14fb0f8e
...
...
@@ -66,7 +66,13 @@
margin
:
0
auto
;
}
</style>
footer
#page_footer
nav
>
ul
>
li
>
a
[
aria-current
=
'page'
]
{
color
:
black
;
}
</style>
{%
endcspstyle
%}
...
...
This diff is collapsed.
Click to expand it.
webapp/templates/app_base_footer.html.twig
+
37
−
26
View file @
14fb0f8e
{%
set
footerMainNavLinks
=
{
'page_footer_link_home'
:
{
'route'
:
'app_home_i18n'
,
'i18nKey'
:
'public.footer.link.home'
}
,
'page_footer_link_contact'
:
{
'route'
:
'app_page_contact'
,
'i18nKey'
:
'public.footer.link.contact'
}
,
'page_footer_link_about'
:
{
'route'
:
'app_page_about'
,
'i18nKey'
:
'public.footer.link.about'
}
,
'page_footer_link_legal'
:
{
'route'
:
'app_page_legal'
,
'i18nKey'
:
'public.footer.link.legal'
}
,
'page_footer_link_accessibility'
:
{
'route'
:
'app_page_accessibility'
,
'i18nKey'
:
'public.footer.link.accessibility'
}
,
'page_footer_link_opendata'
:
{
'route'
:
'app_page_opendata'
,
'i18nKey'
:
'public.footer.link.open-data'
,
'title'
:
'Open data - Données ouvertes du Comptoir du Libre'
}
,
}
%}
<footer
id=
"page_footer"
class=
"border-top mt-5 pt-2 "
>
<nav>
<ul>
<li>
<a
id=
"page_footer_link_home"
href=
"
{{
path
(
'app_home_i18n'
)
}}
"
>
{{
'public.footer.link.home'
|
trans
}}
</a>
</li>
<li>
<a
id=
"page_footer_link_contact"
href=
"
{{
path
(
'app_page_contact'
)
}}
"
>
{{
'public.footer.link.contact'
|
trans
}}
</a>
</li>
<li>
<a
id=
"page_footer_link_about"
href=
"
{{
path
(
'app_page_about'
)
}}
"
>
{{
'public.footer.link.about'
|
trans
}}
</a>
</li>
<li>
<a
id=
"page_footer_link_legal"
href=
"
{{
path
(
'app_page_legal'
)
}}
"
>
{{
'public.footer.link.legal'
|
trans
}}
</a>
</li>
<li>
<a
id=
"page_footer_link_accessibility"
href=
"
{{
path
(
'app_page_accessibility'
)
}}
"
>
{{
'public.footer.link.accessibility'
|
trans
}}
</a>
</li>
{# <li><a href="/fr/pages/accessibility" aria-current="page">Accessibilité : non conforme</a> </li>#}
<li>
<a
id=
"page_footer_link_opendata"
href=
"
{{
path
(
'app_page_opendata'
)
}}
"
title=
"Open data - Données ouvertes du Comptoir du Libre"
>
{{
'public.footer.link.open-data'
|
trans
}}
</a>
</li>
{%
set
currentRoute
=
app.request.attributes.get
(
"_route"
)
%}
{%
for
key
,
linkData
in
footerMainNavLinks
%}
{%
set
ariaCurrentAttr
=
(
currentRoute
==
linkData.route
)
?
'aria-current="page"'
:
''
%}
<li>
<a
id=
"
{{
key
}}
"
{{
ariaCurrentAttr
|
raw
}}
href=
"
{{
path
(
linkData.route
)
}}
"
>
{{
linkData.i18nKey
|
trans
}}
</a>
</li>
{%
endfor
%}
</ul>
</nav>
</footer>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment