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

Accessibilité : explicite le lien vers les CGU de la page de création de structure #1770

Merged
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
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ gem 'devise'
gem 'devise-i18n'
gem 'down'
gem 'ffaker'
gem 'font-awesome-sass', '~> 6.5.1'
gem 'geocoder'
gem 'google-api-client', '~> 0.53'
gem 'google_drive', '~> 3.0'
Expand Down
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ GEM
faraday-retry (1.0.3)
ffaker (2.23.0)
ffi (1.17.0)
font-awesome-sass (6.5.2)
sassc (~> 2.0)
foreman (0.88.1)
formatador (1.1.0)
formtastic (5.0.0)
Expand Down Expand Up @@ -697,7 +695,6 @@ DEPENDENCIES
down
factory_bot_rails
ffaker
font-awesome-sass (~> 6.5.1)
foreman
geocoder
google-api-client (~> 0.53)
Expand Down
14 changes: 9 additions & 5 deletions app/assets/images/logo-pro-connect-bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 4 additions & 34 deletions app/assets/stylesheets/_pro_connect_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
flex-direction: column;
justify-content: center;
margin-bottom: .75rem;
padding: .625em .75em .625em 4em;
padding: .625em .75em .625em 4.5em;
text-decoration: none;
position: relative;

Expand All @@ -32,52 +32,22 @@
font-size: 1.125em;
font-weight: 700;
}

& + p a {
color: #000091;
font-size: .875rem;
line-height: 1.5rem;
text-decoration: none;
background-image: linear-gradient(0deg,currentColor,currentColor),linear-gradient(0deg,currentColor,currentColor);
background-position: 0 100%,0 calc(100% - .0625rem);
background-repeat: no-repeat, no-repeat;
background-size: 0 .125rem, 100% .0625rem;
transition: background-size 0s;

&:hover {
background-size: 100% .125em,100% .0625em;
}

&::after {
background-color: currentColor;
content: "";
display: inline-block;
flex: 0 0 auto;
height: 1rem;
margin-left: .25rem;
mask-image: image-url('target-blank-icon.svg');
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
vertical-align: calc(.375em - .5rem);
width: 1rem;
}
}
}

.btn-pro-connect::before {
background-image: image-url('logo-pro-connect-bg.svg');
background-position: 50% 50%;
background-repeat: no-repeat;
background-size: 2.5em 3em;
background-size: 3.375em 3em;
bottom: .25em;
content: "";
display: block;
height: 3em;
left: .75em;
left: .625em;
margin-top: -1.5em;
position: absolute;
top: 50%;
width: 2.5em;
width: 3.375em;
}
}

Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/active_admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
@import 'admin/typography';
@import "bootstrap_minimal";
@import "pro_connect_button";
@import "font-awesome";

// COMPOSANTS
@import 'admin/composants/autocomplete';
Expand Down
32 changes: 32 additions & 0 deletions app/assets/stylesheets/admin/composants/_lien.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,35 @@
font-size: 0.75rem;
}
}

a.lien-externe {
color: #000091;
font-size: .875rem;
line-height: 1.5rem;
text-decoration: none;
background-image: linear-gradient(0deg,currentColor,currentColor),linear-gradient(0deg,currentColor,currentColor);
--underline-hover-width: 0;
--underline-thickness: calc(0.0625em + 0.25px);
background-position: 0 100%, 0 calc(100% - var(--underline-thickness));
background-repeat: no-repeat, no-repeat;
background-size: var(--underline-hover-width) calc(var(--underline-thickness) * 2), 100% var(--underline-thickness);
transition: background-size 0s;

&:hover {
--underline-hover-width: 100%;
}

&::after {
background-color: currentColor;
content: "";
display: inline-block;
flex: 0 0 auto;
height: 1rem;
margin-left: .25rem;
mask-image: image-url('target-blank-icon.svg');
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
vertical-align: -0.1rem;
width: 1rem;
}
}
2 changes: 1 addition & 1 deletion app/components/lien_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<span class="composant-lien">
<%= link_to @body, @url, @params %><% if @externe %><i class="fa fa-external-link" aria-hidden="true"></i><% end %>
<%= link_to @body, @url, @params %>
</span>
7 changes: 6 additions & 1 deletion app/components/lien_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ def initialize(body, url, externe: false)
@body = body
@url = url
@externe = externe
@params = { target: '_blank' } if externe
return unless externe

@params = { target: '_blank',
title: I18n.t('.lien_externe', texte_du_lien: body),
rel: 'noopener',
class: 'lien-externe' }
end
end
4 changes: 1 addition & 3 deletions app/views/active_admin/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
<span class="pro-connect__brand">ProConnect</span>
<% end %>
<p>
<a href="https://www.proconnect.gouv.fr/" target="_blank" rel="noopener" title="<%= t('.pro-connect.libelle-lien-pro-connect') %> - nouvelle fenêtre">
<%= t('.pro-connect.libelle-lien-pro-connect') %>
</a>
<%= render LienComponent.new(t('.pro-connect.libelle-lien-pro-connect'), 'https://www.proconnect.gouv.fr/', externe: true) %>
</p>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions config/locales/activeadmin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
fr:
logo_anlci: "ANLCI: Agence nationale de lutte contre l'illettrisme"
lien_cgu: CGU
lien_externe: "%{texte_du_lien} - nouvelle fenêtre"
devise:
failure:
already_authenticated: ""
Expand Down