From 75ead33652e7069ab9c560e999acf3ce45e9046f Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Sun, 22 Mar 2020 21:48:22 +0100 Subject: [PATCH] Provide a download link to the original archive file --- modules/webapp/src/main/elm/Comp/ItemDetail.elm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail.elm b/modules/webapp/src/main/elm/Comp/ItemDetail.elm index 89937daa..e6a3c124 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail.elm @@ -1187,6 +1187,10 @@ renderAttachmentView model pos attach = attachName = Maybe.withDefault "No name" attach.name + + hasArchive = + List.map .id model.item.archives + |> List.member attach.id in div [ classList @@ -1204,6 +1208,17 @@ renderAttachmentView model pos attach = ] , div [ class "right menu" ] [ a + [ classList + [ ( "item", True ) + , ( "invisible", not hasArchive ) + ] + , title "Download the original archive file." + , href (fileUrl ++ "/archive") + , target "_new" + ] + [ i [ class "file archive outline icon" ] [] + ] + , a [ classList [ ( "item", True ) , ( "disabled", not attach.converted )