Skip to content

Commit

Permalink
hsec-tools: add description in generated index
Browse files Browse the repository at this point in the history
  • Loading branch information
blackheaven authored and frasertweedale committed Jun 10, 2024
1 parent a726901 commit 381bda6
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion code/hsec-tools/src/Security/Advisories/Generate/HTML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ data AffectedPackageR = AffectedPackageR

listByDates :: [AdvisoryR] -> Html ()
listByDates advisories =
inPage PageListByDates $
inPage PageListByDates $ do
indexDescription
div_ [class_ "advisories"] $ do
table_ [class_ "pure-table pure-table-horizontal"] $ do
thead_ $ do
Expand All @@ -120,6 +121,8 @@ listByDates advisories =
listByPackages :: [AdvisoryR] -> Html ()
listByPackages advisories =
inPage PageListByPackages $ do
indexDescription

let byPackage :: Map.Map Text [(AdvisoryR, AffectedPackageR)]
byPackage =
Map.fromList $
Expand Down Expand Up @@ -149,6 +152,18 @@ listByPackages advisories =
td_ [class_ "advisory-fixed"] $ maybe (return ()) toHtml $ fixed package
td_ [class_ "advisory-summary"] $ toHtml $ advisorySummary advisory

indexDescription :: Html ()
indexDescription =
div_ [class_ "description"] $ do
p_ "The Haskell Security Advisory Database is a repository of security advisories filed against packages published via Hackage."
p_ $ do
"It is generated from "
a_ [href_ "https://github.com/haskell/security-advisories/", target_ "_blank", rel_ "noopener noreferrer"] "Haskell Security Advisory Database"
". "
"Feel free to "
a_ [href_ "https://github.com/haskell/security-advisories/blob/main/PROCESS.md", target_ "_blank", rel_ "noopener noreferrer"] "report new or historic security issues"
"."

-- * Utils

data NavigationPage
Expand Down

0 comments on commit 381bda6

Please sign in to comment.