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

@ -12,7 +12,7 @@
module Handler.Sheet where
import Import
import Import
import System.FilePath (takeFileName)
import Handler.Utils
@ -21,10 +21,10 @@ import Handler.Utils.Zip
-- import Data.Time
import qualified Data.Text as T
-- import Data.Function ((&))
--
--
import Colonnade hiding (fromMaybe, singleton)
import Yesod.Colonnade
--
--
import qualified Data.UUID.Cryptographic as UUID
import qualified Data.Conduit.List as C
@ -44,7 +44,7 @@ instance Eq (Unique Sheet) where
{-
* Implement Handlers
* Implement Breadcrumbs in Foundation
* Implement Breadcrumbs in Foundation
* Implement Access in Foundation
-}
@ -76,7 +76,7 @@ makeSheetForm msId template = identForm FIDsheet $ \html -> do
E.&&. sheetFile E.^. SheetFileType E.==. E.val fType
return (file E.^. FileId)
| otherwise = return Set.empty
(result, widget) <- flip (renderAForm FormStandard) html $ SheetForm
<$> areq textField (fsb "Name") (sfName <$> template)
<*> aopt htmlField (fsb "Hinweise für Teilnehmer") (sfDescription <$> template)
@ -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;