A team can be created

This commit is contained in:
Filip Gralinski 2021-03-03 12:31:21 +01:00
parent aa3831ee6b
commit 6377fee2e4
7 changed files with 20 additions and 0 deletions

View File

@ -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

View File

@ -225,6 +225,9 @@ instance Yesod App where
isAuthorized (CompareFormR _ _) _ = regularAuthorization
isAuthorized MyTeamsR _ = isTrustedAuthorized
isAuthorized CreateTeamR _ = isTrustedAuthorized
isAuthorized (TestProgressR _ _) _ = isTrustedAuthorized
isAuthorized SwaggerR _ = return Authorized

View File

@ -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

View File

@ -62,6 +62,7 @@ library
Data.Diff
Handler.Swagger
Handler.JWT
Handler.Team
if flag(dev) || flag(library-only)
cpp-options: -DDEVELOPMENT

View File

@ -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

View File

@ -44,6 +44,7 @@
<ul class="dropdown-menu">
<li><a href="@{YourAccountR}">_{MsgYourAccount}</a></li>
<li><a href="@{MyScoreR}">_{MsgYourScore}</a></li>
<li><a href="@{MyTeamsR}">_{MsgYourTeams}</a></li>
<li><a href="@{AuthR LogoutR}">_{MsgLogOut}</a></li>
$nothing
<ul class="nav navbar-nav navbar-top navbar-collapse collapse">

View File

@ -0,0 +1,8 @@
<hr>
<h2>Create a new team
<form method=post action=@{CreateTeamR}#form enctype=#{formEnctype}>
^{formWidget}
<button .btn .btn-primary type="submit">
_{MsgSubmit} <span class="glyphicon glyphicon-upload"></span>