mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
As part of https://github.com/alphagov/notifications-admin/pull/187 the file upload pattern was changed to auto-submit once a file had been picked. The form that was submitted was, however, missing a CSRF token, as well as a submit button for non-JS users. This commit makes the file upload pattern self-contained, so that it will always include a form with a CSRF token in a hidden input and a submit button, which is then hidden when Javascript loads.
49 lines
664 B
SCSS
49 lines
664 B
SCSS
.js-enabled {
|
|
|
|
.file-upload {
|
|
|
|
&-label {
|
|
|
|
@include bold-19;
|
|
display: block;
|
|
margin: 0 0 10px 0;
|
|
|
|
.error-message {
|
|
padding: 0;
|
|
}
|
|
|
|
}
|
|
|
|
&-field {
|
|
width: 0.1px;
|
|
height: 0.1px;
|
|
opacity: 0;
|
|
overflow: hidden;
|
|
position: absolute;
|
|
z-index: -1;
|
|
|
|
&:focus + .file-upload-button {
|
|
outline: 3px solid $yellow;
|
|
}
|
|
|
|
}
|
|
|
|
&-button {
|
|
@include button($button-colour);
|
|
display: inline-block;
|
|
}
|
|
|
|
&-filename {
|
|
@include bold-19;
|
|
display: inline-block;
|
|
padding-left: $gutter-half;
|
|
}
|
|
|
|
&-submit {
|
|
display: none;
|
|
}
|
|
|
|
}
|
|
|
|
}
|