Add Mailto link for mailing to all maintainers (#341)

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2021-08-26 13:46:13 +02:00 committed by GitHub
parent 6bce11114d
commit c402d7819a
Failed to generate hash of commit

View file

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