diff --git a/src/Auth/Dummy.hs b/src/Auth/Dummy.hs index e7033f3d8..cdb8db1e8 100644 --- a/src/Auth/Dummy.hs +++ b/src/Auth/Dummy.hs @@ -7,7 +7,7 @@ import Import.NoFoundation import Database.Persist.Sql (SqlBackendCanRead) import Utils.Form - + import Data.CaseInsensitive (CI) import qualified Data.CaseInsensitive as CI @@ -54,4 +54,4 @@ dummyLogin = AuthPlugin{..} apDispatch _ _ = notFound apLogin toMaster = do (login, loginEnctype) <- handlerToWidget . generateFormPost $ renderAForm FormStandard dummyForm - $(widgetFile "widgets/dummy-login-form") + $(widgetFile "widgets/dummy-login-form/dummy-login-form") diff --git a/src/Auth/LDAP.hs b/src/Auth/LDAP.hs index cd2a9a037..861c03620 100644 --- a/src/Auth/LDAP.hs +++ b/src/Auth/LDAP.hs @@ -36,7 +36,7 @@ data CampusMessage = MsgCampusIdentNote | MsgCampusSubmit | MsgCampusInvalidCredentials deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic, Typeable) - + findUser :: LdapConf -> Ldap -> Text -> [Ldap.Attr] -> IO [Ldap.SearchEntry] findUser LdapConf{..} ldap campusIdent = Ldap.search ldap ldapBase userSearchSettings userFilter @@ -48,7 +48,7 @@ findUser LdapConf{..} ldap campusIdent = Ldap.search ldap ldapBase userSearchSet , Ldap.time ldapSearchTimeout , Ldap.derefAliases Ldap.DerefAlways ] - + userPrincipalName :: Ldap.Attr userPrincipalName = Ldap.Attr "userPrincipalName" @@ -105,7 +105,7 @@ campusLogin conf@LdapConf{..} pool = AuthPlugin{..} apDispatch _ _ = notFound apLogin toMaster = do (login, loginEnctype) <- handlerToWidget . generateFormPost $ renderAForm FormStandard campusForm - $(widgetFile "widgets/campus-login-form") + $(widgetFile "widgets/campus-login/campus-login-form") data CampusUserException = CampusUserLdapError LdapPoolError | CampusUserHostNotResolved String diff --git a/src/Auth/PWHash.hs b/src/Auth/PWHash.hs index 68df34703..74c4e67a3 100644 --- a/src/Auth/PWHash.hs +++ b/src/Auth/PWHash.hs @@ -35,7 +35,7 @@ hashForm = HashLogin <*> areq passwordField (fslpI MsgPWHashPassword "Passwort") Nothing <* submitButton - + hashLogin :: ( YesodAuth site , YesodPersist site , SqlBackendCanRead (YesodPersistBackend site) @@ -90,5 +90,5 @@ hashLogin pwHashAlgo = AuthPlugin{..} apDispatch _ _ = notFound apLogin toMaster = do (login, loginEnctype) <- handlerToWidget . generateFormPost $ renderAForm FormStandard hashForm - $(widgetFile "widgets/hash-login-form") + $(widgetFile "widgets/hash-login-form/hash-login-form") diff --git a/src/Foundation.hs b/src/Foundation.hs index 7e34e3f8f..6ed16c930 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -969,19 +969,19 @@ siteLayout' headingOverride widget = do -- you to use normal widget features in default-layout. navbar :: Widget - navbar = $(widgetFile "widgets/navbar") + navbar = $(widgetFile "widgets/navbar/navbar") asidenav :: Widget asidenav = $(widgetFile "widgets/asidenav/asidenav") footer :: Widget - footer = $(widgetFile "widgets/footer") + footer = $(widgetFile "widgets/footer/footer") alerts :: Widget alerts = $(widgetFile "widgets/alerts/alerts") contentHeadline :: Maybe Widget contentHeadline = headingOverride <|> (pageHeading =<< mcurrentRoute) breadcrumbsWgt :: Widget - breadcrumbsWgt = $(widgetFile "widgets/breadcrumbs") + breadcrumbsWgt = $(widgetFile "widgets/breadcrumbs/breadcrumbs") pageaction :: Widget - pageaction = $(widgetFile "widgets/pageaction") + pageaction = $(widgetFile "widgets/pageaction/pageaction") -- functions to determine if there are page-actions (primary or secondary) hasPageActions, hasSecondaryPageActions, hasPrimaryPageActions :: Bool hasPageActions = hasPrimaryPageActions || hasSecondaryPageActions diff --git a/src/Handler/Corrections.hs b/src/Handler/Corrections.hs index 1fece3778..29f31b107 100644 --- a/src/Handler/Corrections.hs +++ b/src/Handler/Corrections.hs @@ -162,7 +162,7 @@ colRating = sortable (Just "rating") (i18nCell MsgRating) $ \DBRow{ dbrOutput=(E cid <- encrypt subId return $ CSubmissionR tid ssh csh sheetName cid CorrectionR in mconcat - [ anchorCellM mkRoute $(widgetFile "widgets/rating") + [ anchorCellM mkRoute $(widgetFile "widgets/rating/rating") , writerCell $ do let summary :: SheetTypeSummary diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index 3401cf4de..dd09362f1 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -295,7 +295,7 @@ registerForm registered msecret extra = do (Just _) | not registered -> bimap Just Just <$> mreq textField (fslpI MsgCourseSecret "Code") Nothing _ -> return (Nothing,Nothing) (btnRes, btnView) <- mreq (buttonField $ bool BtnRegister BtnDeregister registered) "buttonField ignores settings anyway" Nothing - let widget = $(widgetFile "widgets/registerForm") + let widget = $(widgetFile "widgets/register-form/register-form") let msecretRes | Just res <- msecretRes' = Just <$> res | otherwise = FormSuccess Nothing return (btnRes *> ((==msecret) <$> msecretRes), widget) -- checks that correct button was pressed, and ignores result of btnRes diff --git a/src/Handler/Profile.hs b/src/Handler/Profile.hs index 1e2547db9..33736976e 100644 --- a/src/Handler/Profile.hs +++ b/src/Handler/Profile.hs @@ -221,7 +221,7 @@ getProfileDataR = do -- Delete Button (btnWdgt, btnEnctype) <- generateFormPost (buttonForm :: Form ButtonDelete) defaultLayout $ do - let delWdgt = $(widgetFile "widgets/data-delete") + let delWdgt = $(widgetFile "widgets/data-delete/data-delete") $(widgetFile "profileData") $(widgetFile "dsgvDisclaimer") diff --git a/src/Handler/Sheet.hs b/src/Handler/Sheet.hs index 615fa91e1..ebd365521 100644 --- a/src/Handler/Sheet.hs +++ b/src/Handler/Sheet.hs @@ -205,7 +205,7 @@ getSheetListR tid ssh csh = do mkRoute = do cid' <- mkCid return $ CSubmissionR tid ssh csh sheetName cid' CorrectionR - acell = anchorCellM mkRoute $(widgetFile "widgets/rating") + acell = anchorCellM mkRoute $(widgetFile "widgets/rating/rating") in cellTell acell $ stats submissionRatingPoints , sortable Nothing -- (Just "percent") diff --git a/src/Handler/Users.hs b/src/Handler/Users.hs index 4d5e6c125..04a44e6bf 100644 --- a/src/Handler/Users.hs +++ b/src/Handler/Users.hs @@ -144,7 +144,7 @@ postAdminUserR uuid = do return (school, cbAdmin, cbLecturer) let result = forM boxRights $ \(Entity sid _, (resAdmin,_), (resLecturer, _)) -> (,,) <$> pure sid <*> resAdmin <*> resLecturer - return (result,$(widgetFile "widgets/user-rights-form")) + return (result,$(widgetFile "widgets/user-rights-form/user-rights-form")) let userRightsAction changes = do void . runDB $ forM changes $ \(sid, userAdmin, userLecturer) -> diff --git a/src/Handler/Utils/Delete.hs b/src/Handler/Utils/Delete.hs index c35d2a14f..400ef2d72 100644 --- a/src/Handler/Utils/Delete.hs +++ b/src/Handler/Utils/Delete.hs @@ -90,9 +90,9 @@ getDeleteR DeleteRoute{..} = do (deleteFormWdgt, deleteFormEnctype) <- generateFormPost $ confirmForm' drRecords confirmString Just targetRoute <- getCurrentRoute - + sendResponse =<< - defaultLayout $(widgetFile "widgets/delete-confirmation") + defaultLayout $(widgetFile "widgets/delete-confirmation/delete-confirmation") diff --git a/src/Handler/Utils/Form.hs b/src/Handler/Utils/Form.hs index 1fcc4b11c..0491a3cc8 100644 --- a/src/Handler/Utils/Form.hs +++ b/src/Handler/Utils/Form.hs @@ -588,9 +588,9 @@ multiAction acts defAction = do widgets <- mapM mToWidget results let actionWidgets = Map.foldrWithKey accWidget [] widgets accWidget _act Nothing = id - accWidget act (Just w) = cons $(widgetFile "widgets/multiAction") + accWidget act (Just w) = cons $(widgetFile "widgets/multi-action/multi-action") actionResults = Map.map fst results - return ((actionResults Map.!) =<< actionRes, $(widgetFile "widgets/multiActionCollect")) + return ((actionResults Map.!) =<< actionRes, $(widgetFile "widgets/multi-action/multi-action-collect")) multiActionA :: (RenderMessage UniWorX action, PathPiece action, Ord action, Eq action) => FieldSettings UniWorX diff --git a/src/Handler/Utils/SheetType.hs b/src/Handler/Utils/SheetType.hs index 43b98a92f..9e69815c9 100644 --- a/src/Handler/Utils/SheetType.hs +++ b/src/Handler/Utils/SheetType.hs @@ -25,7 +25,7 @@ gradeSummaryWidget title sts = hasMarkedPasses = positiveSum $ numMarkedPasses sumSummaries hasPoints = positiveSum $ numSheetsPoints sumSummaries hasMarkedPoints = positiveSum $ numMarkedPoints sumSummaries - rowWdgts = [ $(widgetFile "widgets/gradingSummaryRow") + rowWdgts = [ $(widgetFile "widgets/grading-summary/grading-summary-row") | (sumHeader,summary) <- [ (MsgSheetTypeNormal' ,normalSummary) , (MsgSheetTypeBonus' ,bonusSummary) @@ -33,4 +33,4 @@ gradeSummaryWidget title sts = ] ] in if 0 == numSheets sumSummaries then mempty - else $(widgetFile "widgets/gradingSummary") + else $(widgetFile "widgets/grading-summary/grading-summary") diff --git a/src/Handler/Utils/Templates.hs b/src/Handler/Utils/Templates.hs index ce0d70bc0..ae8673af1 100644 --- a/src/Handler/Utils/Templates.hs +++ b/src/Handler/Utils/Templates.hs @@ -9,7 +9,7 @@ modal modalTrigger modalContent = do let modalDynamic = isLeft modalContent modalId <- newIdent triggerId <- newIdent - $(widgetFile "widgets/modal") + $(widgetFile "widgets/modal/modal") case modalContent of Left route -> do route' <- toTextUrl route diff --git a/src/Utils/Form.hs b/src/Utils/Form.hs index c4fe43f80..787a2e4b5 100644 --- a/src/Utils/Form.hs +++ b/src/Utils/Form.hs @@ -41,7 +41,7 @@ data FormLayout = FormStandard | FormDBTableFilter | FormDBTablePagesize renderAForm :: Monad m => FormLayout -> FormRender m a renderAForm formLayout aform fragment = do (res, ($ []) -> fieldViews) <- aFormToForm aform - let widget = $(widgetFile "widgets/form") + let widget = $(widgetFile "widgets/form/form") return (res, widget) -------------------- @@ -367,7 +367,7 @@ reorderField optList = Field{..} isSel n = (==) (either (const $ map optionInternalValue olOptions) id val !! pred n) . optionInternalValue nums = map (id &&& withNum theId) [1..length olOptions] withNum t n = tshow n <> "." <> t - $(widgetFile "widgets/permutation") + $(widgetFile "widgets/permutation/permutation") optionsFinite :: ( MonadHandler m , Finite a diff --git a/templates/widgets/breadcrumbs.hamlet b/templates/widgets/breadcrumbs/breadcrumbs.hamlet similarity index 100% rename from templates/widgets/breadcrumbs.hamlet rename to templates/widgets/breadcrumbs/breadcrumbs.hamlet diff --git a/templates/widgets/breadcrumbs.lucius b/templates/widgets/breadcrumbs/breadcrumbs.lucius similarity index 100% rename from templates/widgets/breadcrumbs.lucius rename to templates/widgets/breadcrumbs/breadcrumbs.lucius diff --git a/templates/widgets/campus-login-form.hamlet b/templates/widgets/campus-login/campus-login-form.hamlet similarity index 100% rename from templates/widgets/campus-login-form.hamlet rename to templates/widgets/campus-login/campus-login-form.hamlet diff --git a/templates/widgets/campus-login.hamlet b/templates/widgets/campus-login/campus-login.hamlet similarity index 100% rename from templates/widgets/campus-login.hamlet rename to templates/widgets/campus-login/campus-login.hamlet diff --git a/templates/widgets/data-delete.hamlet b/templates/widgets/data-delete/data-delete.hamlet similarity index 100% rename from templates/widgets/data-delete.hamlet rename to templates/widgets/data-delete/data-delete.hamlet diff --git a/templates/widgets/delete-confirmation.hamlet b/templates/widgets/delete-confirmation/delete-confirmation.hamlet similarity index 100% rename from templates/widgets/delete-confirmation.hamlet rename to templates/widgets/delete-confirmation/delete-confirmation.hamlet diff --git a/templates/widgets/delete-confirmation.lucius b/templates/widgets/delete-confirmation/delete-confirmation.lucius similarity index 100% rename from templates/widgets/delete-confirmation.lucius rename to templates/widgets/delete-confirmation/delete-confirmation.lucius diff --git a/templates/widgets/dummy-login-form.hamlet b/templates/widgets/dummy-login-form/dummy-login-form.hamlet similarity index 100% rename from templates/widgets/dummy-login-form.hamlet rename to templates/widgets/dummy-login-form/dummy-login-form.hamlet diff --git a/templates/widgets/footer.hamlet b/templates/widgets/footer/footer.hamlet similarity index 100% rename from templates/widgets/footer.hamlet rename to templates/widgets/footer/footer.hamlet diff --git a/templates/widgets/footer.lucius b/templates/widgets/footer/footer.lucius similarity index 100% rename from templates/widgets/footer.lucius rename to templates/widgets/footer/footer.lucius diff --git a/templates/widgets/form.hamlet b/templates/widgets/form/form.hamlet similarity index 100% rename from templates/widgets/form.hamlet rename to templates/widgets/form/form.hamlet diff --git a/templates/widgets/form.julius b/templates/widgets/form/form.julius similarity index 100% rename from templates/widgets/form.julius rename to templates/widgets/form/form.julius diff --git a/templates/widgets/gradingSummaryRow.hamlet b/templates/widgets/grading-summary/grading-summary-row.hamlet similarity index 97% rename from templates/widgets/gradingSummaryRow.hamlet rename to templates/widgets/grading-summary/grading-summary-row.hamlet index 16ef69f15..261b98e1a 100644 --- a/templates/widgets/gradingSummaryRow.hamlet +++ b/templates/widgets/grading-summary/grading-summary-row.hamlet @@ -51,4 +51,4 @@ $# \ (_{title $ getSum $ summary ^. _numSheetsPoints}) $# Kurze Alternative mit Hashtag-Symbol für "Anzahl" $# \ (##{display $ summary ^. _numSheetsPoints}) -