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,
[whamlet|
<div class="alert alert-danger">
<h4> Fehler:
<ul>
$forall errmsg <- errorMsgs
<li> #{errmsg}
<div class="alert__content">
<h4> Fehler:
<ul>
$forall errmsg <- errorMsgs
<li> #{errmsg}
^{widget}
|]
)

View File

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

View File

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

View File

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

View File

@ -6,7 +6,8 @@
Die Reimplementierung von
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>
<div .container>

View File

@ -4,9 +4,14 @@
window.utils = window.utils || {};
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.appendChild(closeEl);
}
})();

View File

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