diff --git a/.gitignore b/.gitignore index 5c3dfb89e..973be71ae 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ cabal.sandbox.config uniworx.cabal uniworx.nix .gup/ -.dbsettings.yml \ No newline at end of file +.dbsettings.yml +*.kate-swp diff --git a/routes b/routes index ee2df1f02..a2b3baa4e 100644 --- a/routes +++ b/routes @@ -10,5 +10,7 @@ /assist/newcourse NewCourseR GET POST -/assist/newterm NewTermR GET POST -/assist/showterm ShowTermR GET +/assist/showterms ShowTermsR GET +/assist/newterm NewTermR GET +/assist/editterm EditTermR GET POST +/assist/editterm/#TermIdentifier EditTermExistR GET diff --git a/src/Application.hs b/src/Application.hs index 037783ff1..67453bcba 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -3,6 +3,7 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE ViewPatterns #-} {-# LANGUAGE RecordWildCards #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Application diff --git a/src/Foundation.hs b/src/Foundation.hs index 7f135afab..d070194a2 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -167,9 +167,11 @@ instance Yesod UniWorX where isAuthorized ProfileR _ = isAuthenticated -- TODO: change to Assistants - isAuthorized NewCourseR _ = return Authorized - isAuthorized NewTermR _ = return Authorized - isAuthorized ShowTermR _ = return Authorized + isAuthorized NewCourseR _ = return Authorized + isAuthorized NewTermR _ = return Authorized + isAuthorized EditTermR _ = return Authorized + isAuthorized (EditTermExistR _) _ = return Authorized + isAuthorized ShowTermsR _ = return Authorized -- This function creates static content files in the static folder -- and names them based on a hash of their content. This allows diff --git a/src/Handler/Assist.hs b/src/Handler/Assist.hs index bcf101935..82b917a76 100644 --- a/src/Handler/Assist.hs +++ b/src/Handler/Assist.hs @@ -121,8 +121,8 @@ postNewCourseR = do -} -getShowTermR :: Handler Html -getShowTermR = do +getShowTermsR :: Handler Html +getShowTermsR = do terms <- runDB $ selectList [] [Desc TermStart] defaultLayout $ do setTitle "Freigeschaltete Semester" @@ -137,7 +137,7 @@ getShowTermR = do
- Bitte alles ausfüllen! +