From c402d7819ad3fed1ded47401a7f18864df7e1db3 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 26 Aug 2021 13:46:13 +0200 Subject: [PATCH] Add Mailto link for mailing to all maintainers (#341) Signed-off-by: Matthias Beyer --- src/Page/Packages.elm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Page/Packages.elm b/src/Page/Packages.elm index ac83c8a..2353ae1 100644 --- a/src/Page/Packages.elm +++ b/src/Page/Packages.elm @@ -396,6 +396,18 @@ viewResultItem channel showInstallDetails show item = ] ] + mailtoAllMaintainers maintainers = + let + maintainerMails = List.filterMap (\m -> m.email) maintainers + in + li [] + [ a + [ href <| + ("mailto:" ++ String.join "," maintainerMails) + ] + [ text "Mail to all maintainers" ] + ] + showPlatform platform = case Search.channelDetailsFromId channel of Just channelDetails -> @@ -421,7 +433,11 @@ viewResultItem channel showInstallDetails show item = [ p [] [ text "This package has no maintainers." ] ] else - [ ul [] (List.map showMaintainer item.source.maintainers) ] + [ ul [] + (List.singleton (mailtoAllMaintainers item.source.maintainers) + |> List.append (List.map showMaintainer item.source.maintainers) + ) + ] ) ) , div []