fixed deprecated alerts in backend. we need a template for alerts

This commit is contained in:
Felix Hamann 2018-06-10 20:19:00 +02:00
parent b505130621
commit a1b6599a29
7 changed files with 31 additions and 21 deletions

View File

@ -324,10 +324,11 @@ newCourseForm template = identForm FIDcourse $ \html -> do
(FormFailure errorMsgs, (FormFailure errorMsgs,
[whamlet| [whamlet|
<div class="alert alert-danger"> <div class="alert alert-danger">
<h4> Fehler: <div class="alert__content">
<ul> <h4> Fehler:
$forall errmsg <- errorMsgs <ul>
<li> #{errmsg} $forall errmsg <- errorMsgs
<li> #{errmsg}
^{widget} ^{widget}
|] |]
) )

View File

@ -100,10 +100,11 @@ makeSheetForm msId template = identForm FIDsheet $ \html -> do
(FormFailure errorMsgs, (FormFailure errorMsgs,
[whamlet| [whamlet|
<div class="alert alert-danger"> <div class="alert alert-danger">
<h4> Fehler: <div class="alert__content">
<ul> <h4> Fehler:
$forall errmsg <- errorMsgs <ul>
<li> #{errmsg} $forall errmsg <- errorMsgs
<li> #{errmsg}
^{widget} ^{widget}
|] |]
) )

View File

@ -149,10 +149,11 @@ newTermForm template html = do
(FormFailure errorMsgs, (FormFailure errorMsgs,
[whamlet| [whamlet|
<div class="alert alert-danger"> <div class="alert alert-danger">
<h4> Fehler: <div class="alert__content">
<ul> <h4> Fehler:
$forall errmsg <- errorMsgs <ul>
<li> #{errmsg} $forall errmsg <- errorMsgs
<li> #{errmsg}
^{widget} ^{widget}
|] |]
) )

View File

@ -23,8 +23,8 @@
$forall (status, msg) <- mmsgs $forall (status, msg) <- mmsgs
$with status2 <- bool status "info" (status == "") $with status2 <- bool status "info" (status == "")
<div class="alert alert-#{status2}"> <div class="alert alert-#{status2}">
<div .alert__content>#{msg} <div .alert__content>
<div .alert__close>_{MsgCloseAlert} #{msg}
<!-- actual content --> <!-- actual content -->

View File

@ -6,7 +6,8 @@
Die Reimplementierung von Die Reimplementierung von
UniWorX ist noch nicht abgeschlossen. UniWorX ist noch nicht abgeschlossen.
<p .alert .alert-danger>Das System ist noch nicht produktiv einsetzbar <div .alert .alert-danger>
<div .alert__content>Das System ist noch nicht produktiv einsetzbar
<hr> <hr>
<div .container> <div .container>

View File

@ -4,9 +4,14 @@
window.utils = window.utils || {}; window.utils = window.utils || {};
window.utils.alert = function(alertEl) { window.utils.alert = function(alertEl) {
alertEl.querySelector('.alert__close').addEventListener('click', function(event) { var closeEl = document.createElement('DIV');
closeEl.classList.add('alert__close');
// TODO: fix this. How to request translation in *.julius .files?
closeEl.innerText = "_{MsgCloseAlert}";
closeEl.addEventListener('click', function(event) {
alertEl.classList.add('alert--invisible'); alertEl.classList.add('alert--invisible');
}); });
alertEl.appendChild(closeEl);
} }
})(); })();

View File

@ -56,6 +56,7 @@
} }
} }
.alert-danger,
.alert-error { .alert-error {
border-color: var(--color-error); border-color: var(--color-error);
background-color: #fff5f7; background-color: #fff5f7;