Labels adjusted, HelpForm not working before Login due to Modal-Login not being hidden properly, see #212
This commit is contained in:
parent
033e3a8ad8
commit
4a394d2050
12
.vscode/tasks.json
vendored
Normal file
12
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "echo",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "echo Hello"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -385,4 +385,12 @@ SheetCreateExisting: Folgende Pseudonyme haben bereits abgegeben:
|
|||||||
|
|
||||||
UserAccountDeleted name@Text: Konto für #{name} wurde gelöscht!
|
UserAccountDeleted name@Text: Konto für #{name} wurde gelöscht!
|
||||||
|
|
||||||
|
HelpAnswer: Anfrage von
|
||||||
|
HelpUser: Benutzeraccount Uni2Work
|
||||||
|
HelpAnonymous: Anonym (Keine Antwort möglich)
|
||||||
|
HelpEMail: E-Mail (ohne Login)
|
||||||
|
HelpRequest: Supportanfrage / Verbesserungsvorschlag
|
||||||
|
HelpProblemPage: Problematische Seite
|
||||||
|
|
||||||
|
|
||||||
Dummy: TODO Message not defined!
|
Dummy: TODO Message not defined!
|
||||||
|
|||||||
@ -813,7 +813,7 @@ defaultLinks = -- Define the menu items of the header.
|
|||||||
{ menuItemLabel = "Hilfe"
|
{ menuItemLabel = "Hilfe"
|
||||||
, menuItemIcon = Just "question"
|
, menuItemIcon = Just "question"
|
||||||
, menuItemRoute = HelpR
|
, menuItemRoute = HelpR
|
||||||
, menuItemModal = True
|
, menuItemModal = True -- TODO: Does not work yet, issue #212
|
||||||
, menuItemAccessCallback' = return True
|
, menuItemAccessCallback' = return True
|
||||||
}
|
}
|
||||||
, NavbarRight $ MenuItem
|
, NavbarRight $ MenuItem
|
||||||
@ -827,7 +827,7 @@ defaultLinks = -- Define the menu items of the header.
|
|||||||
{ menuItemLabel = "Login"
|
{ menuItemLabel = "Login"
|
||||||
, menuItemIcon = Just "sign-in-alt"
|
, menuItemIcon = Just "sign-in-alt"
|
||||||
, menuItemRoute = AuthR LoginR
|
, menuItemRoute = AuthR LoginR
|
||||||
, menuItemModal = True
|
, menuItemModal = True -- TODO: Does not work yet, issue #212
|
||||||
, menuItemAccessCallback' = isNothing <$> maybeAuthPair
|
, menuItemAccessCallback' = isNothing <$> maybeAuthPair
|
||||||
}
|
}
|
||||||
, NavbarSecondary $ MenuItem
|
, NavbarSecondary $ MenuItem
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
{-# LANGUAGE TupleSections #-}
|
{-# LANGUAGE TupleSections #-}
|
||||||
|
{-# LANGUAGE LambdaCase #-}
|
||||||
{-# LANGUAGE QuasiQuotes #-}
|
{-# LANGUAGE QuasiQuotes #-}
|
||||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||||
{-# LANGUAGE IncoherentInstances #-} -- why is this needed? Instance for "display deadline" ought to be clear
|
{-# LANGUAGE IncoherentInstances #-} -- why is this needed? Instance for "display deadline" ought to be clear
|
||||||
@ -238,7 +239,7 @@ getVersionR = selectRep $ do
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
data HelpIdentOptions = HIAnonymous | HIUser | HIEmail
|
data HelpIdentOptions = HIUser | HIEmail | HIAnonymous
|
||||||
deriving (Eq, Ord, Bounded, Enum, Show, Read)
|
deriving (Eq, Ord, Bounded, Enum, Show, Read)
|
||||||
|
|
||||||
$( return [] ) -- forces order of splices, error otherwise, see https://ghc.haskell.org/trac/ghc/ticket/9813
|
$( return [] ) -- forces order of splices, error otherwise, see https://ghc.haskell.org/trac/ghc/ticket/9813
|
||||||
@ -250,7 +251,10 @@ instance PathPiece HelpIdentOptions where
|
|||||||
fromPathPiece = finiteFromPathPiece
|
fromPathPiece = finiteFromPathPiece
|
||||||
|
|
||||||
instance RenderMessage UniWorX HelpIdentOptions where
|
instance RenderMessage UniWorX HelpIdentOptions where
|
||||||
renderMessage _ _ opt = tshow opt -- TODO
|
renderMessage foundation ls = renderMessage foundation ls . \case
|
||||||
|
HIUser -> MsgHelpUser
|
||||||
|
HIEmail -> MsgHelpEMail
|
||||||
|
HIAnonymous -> MsgHelpAnonymous
|
||||||
|
|
||||||
data HelpForm = HelpForm
|
data HelpForm = HelpForm
|
||||||
{ hfReferer:: Maybe Text
|
{ hfReferer:: Maybe Text
|
||||||
@ -260,16 +264,19 @@ data HelpForm = HelpForm
|
|||||||
|
|
||||||
helpForm :: Maybe Text -> Maybe UserId -> AForm _ HelpForm
|
helpForm :: Maybe Text -> Maybe UserId -> AForm _ HelpForm
|
||||||
helpForm mReferer mUid = HelpForm
|
helpForm mReferer mUid = HelpForm
|
||||||
<$> maybe (pure Nothing) (fmap Just . aforced textField (fslI MsgDummy)) mReferer
|
<$> maybe (pure Nothing) (fmap Just . aforced textField (fslI MsgHelpProblemPage)) mReferer
|
||||||
<*> multiActionA (fslI MsgDummy) identActions (HIUser <$ mUid)
|
<*> multiActionA (fslI MsgHelpAnswer) identActions (HIUser <$ mUid)
|
||||||
<*> (unTextarea <$> areq textareaField (fslI MsgDummy) Nothing)
|
<*> (unTextarea <$> areq textareaField (fslI MsgHelpRequest) Nothing)
|
||||||
<* submitButton
|
<* submitButton
|
||||||
where
|
where
|
||||||
identActions :: Map _ (AForm _ (Either (Maybe Email) UserId))
|
identActions :: Map _ (AForm _ (Either (Maybe Email) UserId))
|
||||||
identActions = Map.fromList . catMaybes $
|
identActions = Map.fromList $ case mUid of
|
||||||
[ ( HIUser,) . pure . Right <$> mUid
|
(Just uid) -> (HIUser, pure $ Right uid):defaultActions
|
||||||
, Just (HIAnonymous, pure (Left Nothing))
|
Nothing -> defaultActions
|
||||||
, Just (HIEmail, Left . Just <$> apreq emailField (fslI MsgDummy) Nothing)
|
|
||||||
|
defaultActions =
|
||||||
|
[ (HIEmail, Left . Just <$> apreq emailField (fslI MsgEMail) Nothing)
|
||||||
|
, (HIAnonymous, pure $ Left Nothing)
|
||||||
]
|
]
|
||||||
|
|
||||||
getHelpR :: Handler Html
|
getHelpR :: Handler Html
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user