diff options
-rw-r--r-- | Biz/Dragons.hs | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/Biz/Dragons.hs b/Biz/Dragons.hs index d370693..4294172 100644 --- a/Biz/Dragons.hs +++ b/Biz/Dragons.hs @@ -1154,14 +1154,7 @@ instance Lucid.ToHtml AdminDashboard where Lucid.h2_ <| Lucid.toHtml <| "Total Analyses: " <> tshow totalAnalyses Lucid.section_ <| do Lucid.h2_ "Post analysis" - let action = linkAction_ "/" <| fieldLink postAnalysis - Lucid.form_ [action, Lucid.method_ "post"] <| do - Lucid.input_ [Lucid.type_ "text", Lucid.name_ "owner"] - Lucid.input_ [Lucid.type_ "text", Lucid.name_ "repo"] - Lucid.input_ - [ Lucid.type_ "submit" - ] - + Lucid.toHtml <| SubmitAnalysis "github" "training-kit" Lucid.section_ <| do Lucid.h2_ "All Users" Lucid.ul_ @@ -1484,6 +1477,27 @@ data SubmitAnalysis = SubmitAnalysis instance Web.FromForm SubmitAnalysis +instance Lucid.ToHtml SubmitAnalysis where + toHtmlRaw = Lucid.toHtml + toHtml SubmitAnalysis {..} = do + let action = linkAction_ "/" <| fieldLink postAnalysis + Lucid.form_ [action, Lucid.method_ "post"] <| do + Lucid.input_ + [ Lucid.type_ "text", + Lucid.name_ "owner", + Lucid.placeholder_ "owner", + Lucid.value_ owner + ] + Lucid.input_ + [ Lucid.type_ "text", + Lucid.name_ "repo", + Lucid.placeholder_ "repo", + Lucid.value_ repo + ] + Lucid.input_ + [ Lucid.type_ "submit" + ] + -- | I need more information than just 'Analysis' has to render a full, useful -- web page, hence this type. data AnalysisDisplay = AnalysisDisplay User AnalysisAction |