diff options
author | stuebinm | 2022-03-28 17:21:22 +0200 |
---|---|---|
committer | stuebinm | 2022-03-28 17:21:22 +0200 |
commit | c4b4eb91492db2950d7d6c08edab9b26fb8bf334 (patch) | |
tree | d2bc2025e28c6ebb99f5e8821d4c645aefbe83b3 /server | |
parent | 82082e8b6f02f7fa003f8cf311122fa013ae641e (diff) |
server: add a howto link
Diffstat (limited to 'server')
-rw-r--r-- | server/HtmlOrphans.hs | 6 | ||||
-rw-r--r-- | server/Server.hs | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/server/HtmlOrphans.hs b/server/HtmlOrphans.hs index dad2954..c6f74d5 100644 --- a/server/HtmlOrphans.hs +++ b/server/HtmlOrphans.hs @@ -31,7 +31,7 @@ import Lucid.Html5 (a_, body_, button_, class_, code_, disabled_, onclick_, p_, rel_, script_, span_, src_, title_, type_, ul_) import Server (JobStatus (..), - Org (Org, orgBacklinkPrefix, orgContactMail, orgSlug), + Org (Org, orgBacklinkPrefix, orgContactMail, orgHowtoLink, orgSlug), RemoteRef (RemoteRef, reponame, reporef, repourl), prettySha, unState) import Types (Hint (Hint), Level (..)) @@ -61,7 +61,9 @@ instance ToHtml (Org True, RemoteRef, JobStatus, Maybe JobStatus) where "Linter Result" if pending then button_ [class_ "btn btn-primary btn-disabled", disabled_ "true"] "pending …" - else button_ [onclick_ "relint()", class_ "btn btn-primary", id_ "relint_button"] "relint now" + else button_ [onclick_ "relint()", class_ "btn btn-primary", id_ "relint_button"] "Relint" + whenJust orgHowtoLink $ \link -> + a_ [class_ "btn btn-primary", href_ link] "Howto" a_ [class_ "btn btn-primary" , href_ ("mailto:" <> orgContactMail <> "?subject=[Help-walint] " <> reponame <> " " <> rev)] "Help?" diff --git a/server/Server.hs b/server/Server.hs index 48a7170..0c09314 100644 --- a/server/Server.hs +++ b/server/Server.hs @@ -101,6 +101,7 @@ data Org (loaded :: Bool) = Org , orgWebdir :: Text , orgBacklinkPrefix :: Text , orgContactMail :: Text + , orgHowtoLink :: Maybe Text } deriving (Generic) instance NFData (LintConfig Skeleton) => NFData (Org True) @@ -164,6 +165,7 @@ orgCodec = Org <*> T.text "webdir" .= orgWebdir <*> T.text "backlink_prefix" .= orgBacklinkPrefix <*> T.text "contact_mail" .= orgContactMail + <*> coerce (T.first T.text "howto_link") .= orgHowtoLink -- why exactly does everything in tomland need to be invertable urlBimap :: TomlBiMap BaseUrl String |