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

🐛 fix(footer): title des liens obligatoires du footer [DS-3760, DS-3789] #905

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/component/footer/example/sample/footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ if (footer.brand === true) {
if (footer.content === true) data.content = {
desc: lorem('', 240),
links: [
{label: 'legifrance.gouv.fr'},
{label: 'gouvernement.fr'},
{label: 'info.gouv.fr'},
{label: 'service-public.fr'},
{label: 'legifrance.gouv.fr'},
{label: 'data.gouv.fr'}
]
};
Expand Down Expand Up @@ -50,7 +50,7 @@ if (footer.bottom === true) data.bottom = {
{label: 'Données personnelles', url: footer.href},
{label: 'Gestion des cookies', url: footer.href}
],
copyright: `Sauf mention explicite de propriété intellectuelle détenue par des tiers, les contenus de ce site sont proposés sous <a href="https://github.com/etalab/licence-ouverte/blob/master/LO.md" ${includeAttrs(targetBlankData())}>licence etalab-2.0</a>`
copyright: `Sauf mention explicite de propriété intellectuelle détenue par des tiers, les contenus de ce site sont proposés sous <a href="https://github.com/etalab/licence-ouverte/blob/master/LO.md" ${includeAttrs(targetBlankData('Licence etalab'))}>licence etalab-2.0</a>`
};
%>

Expand Down
2 changes: 1 addition & 1 deletion src/component/footer/template/ejs/content.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
attributes.id = uniqueId('footer__content-link');
%>
<li class="<%= prefix %>-footer__content-item">
<a <%- includeAttrs({...targetBlankData(), ...attributes}) %> class="<%= prefix %>-footer__content-link" href="https://<%= links[i].label %>"><%= links[i].label %></a>
<a <%- includeAttrs({...targetBlankData(links[i].label), ...attributes}) %> class="<%= prefix %>-footer__content-link" href="https://<%= links[i].label %>"><%= links[i].label %></a>
</li>
<% } %>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions tool/example/decorator.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ const errorData = (error) => {

locals.errorData = errorData;

const targetBlankData = () => {
const targetBlankData = (title = contentPlaceholder('Intitulé')) => {
const attr = {};
attr.target = '_blank';
attr.rel = 'noopener external';
attr.title = `${contentPlaceholder('Intitulé')} - ${getText('blank')}`;
attr.title = `${title} - ${getText('blank')}`;
return attr;
}

Expand Down