diff --git a/static/css/utils/asyncForm.scss b/static/css/utils/asyncForm.scss index 00c721822..a0f9956dd 100644 --- a/static/css/utils/asyncForm.scss +++ b/static/css/utils/asyncForm.scss @@ -4,25 +4,73 @@ width: 100%; font-size: 18px; text-align: center; -} - -.async-form-response--success { padding-top: 60px; } -.async-form-response--success::before { - content: ''; +.async-form-response::before, +.async-form-response::after { position: absolute; top: 0px; left: 50%; display: block; +} + +.async-form-response--success::before { + content: ''; width: 17px; height: 28px; - border: solid #000; + border: solid #069e04; border-width: 0 5px 5px 0; transform: translateX(-50%) rotate(45deg); } +.async-form-response--info::before { + content: ''; + width: 5px; + height: 30px; + top: 10px; + background-color: #777; + transform: translateX(-50%); +} +.async-form-response--info::after { + content: ''; + width: 5px; + height: 5px; + background-color: #777; + transform: translateX(-50%); +} + +.async-form-response--warning::before { + content: ''; + width: 5px; + height: 30px; + background-color: rgb(255, 187, 0); + transform: translateX(-50%); +} +.async-form-response--warning::after { + content: ''; + width: 5px; + height: 5px; + top: 35px; + background-color: rgb(255, 187, 0); + transform: translateX(-50%); +} + +.async-form-response--error::before { + content: ''; + width: 5px; + height: 40px; + background-color: #940d0d; + transform: translateX(-50%) rotate(-45deg); +} +.async-form-response--error::after { + content: ''; + width: 5px; + height: 40px; + background-color: #940d0d; + transform: translateX(-50%) rotate(45deg); +} + .async-form-loading { opacity: 0.1; transition: opacity 800ms ease-out; diff --git a/static/js/utils/asyncForm.js b/static/js/utils/asyncForm.js index e417b0ceb..aa57ed2a0 100644 --- a/static/js/utils/asyncForm.js +++ b/static/js/utils/asyncForm.js @@ -19,7 +19,7 @@ } function processResponse(response) { - var responseElement = makeResponseElement(response.content, response.class); + var responseElement = makeResponseElement(response.content, response.status); var parentElement = formElement.parentElement; // make sure there is a delay between click and response @@ -31,11 +31,11 @@ }, delay); } - function makeResponseElement(content, type) { + function makeResponseElement(content, status) { var responseElement = document.createElement('div'); - type = type || 'info'; + status = status || 'info'; responseElement.classList.add(ASYNC_FORM_RESPONSE_CLASS); - responseElement.classList.add(ASYNC_FORM_RESPONSE_CLASS + '--' + type); + responseElement.classList.add(ASYNC_FORM_RESPONSE_CLASS + '--' + status); responseElement.innerHTML = content; return responseElement; }