From 6377fee2e46e8b7654739895b2b8b687882efbef Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Wed, 3 Mar 2021 12:31:21 +0100 Subject: [PATCH] A team can be created --- Application.hs | 1 + Foundation.hs | 3 +++ config/routes | 3 +++ gonito.cabal | 1 + messages/en.msg | 3 +++ templates/default-layout.hamlet | 1 + templates/my-teams.hamlet | 8 ++++++++ 7 files changed, 20 insertions(+) create mode 100644 templates/my-teams.hamlet diff --git a/Application.hs b/Application.hs index c570fe4..3d51ae1 100644 --- a/Application.hs +++ b/Application.hs @@ -61,6 +61,7 @@ import Handler.ExtraPoints import Handler.Dashboard import Handler.Evaluate import Handler.Swagger +import Handler.Team -- This line actually creates our YesodDispatch instance. It is the second half -- of the call to mkYesodData which occurs in Foundation.hs. Please see the diff --git a/Foundation.hs b/Foundation.hs index 703781c..8c4c408 100644 --- a/Foundation.hs +++ b/Foundation.hs @@ -225,6 +225,9 @@ instance Yesod App where isAuthorized (CompareFormR _ _) _ = regularAuthorization + isAuthorized MyTeamsR _ = isTrustedAuthorized + isAuthorized CreateTeamR _ = isTrustedAuthorized + isAuthorized (TestProgressR _ _) _ = isTrustedAuthorized isAuthorized SwaggerR _ = return Authorized diff --git a/config/routes b/config/routes index e760592..09af0a6 100644 --- a/config/routes +++ b/config/routes @@ -27,6 +27,9 @@ /api/version-info/#Text VersionInfoJsonR GET /list-archived-challenges ListArchivedChallengesR GET +/my-teams MyTeamsR GET +/create-team CreateTeamR POST + /challenge/#Text ShowChallengeR GET /challenge-readme/#Text ChallengeReadmeR GET /challenge-submission/#Text ChallengeSubmissionR GET POST diff --git a/gonito.cabal b/gonito.cabal index 5c143b9..ba821f8 100644 --- a/gonito.cabal +++ b/gonito.cabal @@ -62,6 +62,7 @@ library Data.Diff Handler.Swagger Handler.JWT + Handler.Team if flag(dev) || flag(library-only) cpp-options: -DDEVELOPMENT diff --git a/messages/en.msg b/messages/en.msg index a2a83a9..cc06503 100644 --- a/messages/en.msg +++ b/messages/en.msg @@ -99,3 +99,6 @@ ChallengeNotHealthy: Something is wrong with the challenge data! Archive: Archive Unarchive: Unarchive Heal: Heal +TeamIdent: Team name +TeamIdentTooltip: Note that it cannot be changed later +YourTeams: your teams diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index f0670fb..63f23a5 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -44,6 +44,7 @@