fixed deprecated alerts in backend. we need a template for alerts
This commit is contained in:
parent
b505130621
commit
a1b6599a29
@ -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}
|
||||||
|]
|
|]
|
||||||
)
|
)
|
||||||
|
|||||||
@ -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}
|
||||||
|]
|
|]
|
||||||
)
|
)
|
||||||
|
|||||||
@ -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}
|
||||||
|]
|
|]
|
||||||
)
|
)
|
||||||
|
|||||||
@ -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 -->
|
||||||
|
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user