[fix #3975] set buttons floating in dossier page

This commit is contained in:
pedong 2019-08-14 18:54:45 +02:00 committed by Paul Chavard
parent b74b72d1c8
commit d2a78abc3a
3 changed files with 53 additions and 2 deletions

View file

@ -361,6 +361,57 @@
}
}
.send-dossier-wrapper {
display: flex;
width: 100%;
margin-top: $default-padding;
background: #FFFFFF;
position: fixed;
bottom: 0px;
border: 1px solid #CCCCCC;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom: none;
padding: 30px;
padding-bottom: 5px;
padding-top: 5px;
left: 0px;
margin: 0 auto;
.button {
margin-top: $default-padding;
margin-bottom: 0;
}
// Wide layout: align buttons on a single row
@media (min-width: 550px) {
flex-direction: row;
.button:not(:first-of-type) {
margin-left: $default-spacer;
}
// If there are more than one button, align the "Send" button to the right
.button:not(:first-of-type).send {
margin-left: auto;
}
}
// Narrow layout: stack buttons vertically
@media (max-width: 550px) {
flex-direction: column-reverse;
align-items: center;
.button {
width: 100%;
max-width: 350px;
line-height: 30px;
margin-left: none;
margin-right: none;
}
}
}
.send-notice {
@include notice-text-style;
margin-bottom: $default-padding;

View file

@ -32,7 +32,7 @@
locals: { champ: champ, form: champ_form }
- if !apercu
.send-wrapper
.send-dossier-wrapper
- if dossier.brouillon?
= f.button 'Enregistrer le brouillon',
formnovalidate: true,

View file

@ -21,7 +21,7 @@ describe 'users/dossiers/brouillon.html.haml', type: :view do
end
it 'affiche les boutons de validation' do
expect(rendered).to have_selector('.send-wrapper')
expect(rendered).to have_selector('.send-dossier-wrapper')
end
it 'prépare le footer' do