AlertMessage close working with i18n now.

This commit is contained in:
SJost 2018-06-12 10:05:58 +02:00
parent 54a0fa1252
commit 21a96ce44d
3 changed files with 3 additions and 5 deletions

View File

@ -412,6 +412,7 @@ instance Yesod UniWorX where
defaultLayout widget = do
master <- getYesod
mmsgs <- getMessages
messageRender <- getMessageRender -- needed, since there is no i18n interpolation in Julius
mcurrentRoute <- getCurrentRoute

View File

@ -11,10 +11,8 @@ import qualified Data.List as List
import Data.Map (Map)
import qualified Data.Map as Map
import Database.Persist
-- import Database.Persist -- currently not needed here
-- getKeyBy :: PersistEntity val => Unique val -> ReaderT backend0 m0 (Maybe (Entity val))
-- getKeyBy :: Unique a -> YesodDB site (Key a)
entities2map :: PersistEntity record => [Entity record] -> Map (Key record) record
entities2map = foldl' (\m entity -> Map.insert (entityKey entity) (entityVal entity) m) Map.empty

View File

@ -6,8 +6,7 @@
window.utils.alert = function(alertEl) {
var closeEl = document.createElement('DIV');
closeEl.classList.add('alert__close');
// TODO: fix this. How to request translation in *.julius .files?
closeEl.innerText = "_{MsgCloseAlert}";
closeEl.innerText = #{String (messageRender MsgCloseAlert)};
closeEl.addEventListener('click', function(event) {
alertEl.classList.add('alert--invisible');
});