From 38de95ce40f213d91e501a3f6c534d0ad005a885 Mon Sep 17 00:00:00 2001 From: Renaud Date: Wed, 23 Feb 2022 21:22:18 +0100 Subject: [PATCH] Improve short package details readability (#429) * put licenses list on it own line and separate each license with a small black square * display package name as a code block * display version number in bold * add a 'house with garden' emoji before "Homepage" * add a 'package' emoji before "Source" --- src/Page/Packages.elm | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/Page/Packages.elm b/src/Page/Packages.elm index 545291c..cb5c2f5 100644 --- a/src/Page/Packages.elm +++ b/src/Page/Packages.elm @@ -20,6 +20,8 @@ import Html exposing ( Html , a + , br + , code , div , em , h4 @@ -330,11 +332,27 @@ viewResultItem channel showInstallDetails show item = |> Maybe.map (\x -> [ li [ trapClick ] - [ createShortDetailsItem "Homepage" x ] + [ createShortDetailsItem "🏡 Homepage" x ] ] ) |> Maybe.withDefault [] ) + |> List.append + (if item.source.pversion == "" then + [] + + else + [ text "Version: " + , li [] [ strong [] [ text item.source.pversion ] ] + ] + ) + |> List.append + [ text "Name: " + , li [] [ code [] [ text item.source.pname ] ] + ] + |> List.append + [ br [] [] + ] |> List.append (item.source.licenses |> List.filterMap @@ -352,22 +370,9 @@ viewResultItem channel showInstallDetails show item = ( Just fullName, Just url ) -> Just (createShortDetailsItem fullName url) ) - |> List.intersperse (text ", ") - |> (\x -> [ li [] (List.append [ text "Licenses: " ] x) ]) + |> List.intersperse (text " ▪ ") + |> (\x -> [ li [] (List.append [ text "License(s): " ] x) ]) ) - |> List.append - (if item.source.pversion == "" then - [] - - else - [ text "Version: " - , li [] [ text item.source.pversion ] - ] - ) - |> List.append - [ text "Name: " - , li [] [ text item.source.pname ] - ] ) showMaintainer maintainer = @@ -637,7 +642,7 @@ renderSource item channel trapClick createShortDetailsItem createGithubUrl = Just channelDetails -> [ li [ trapClick ] [ createShortDetailsItem - "Source" + "📦 Source" (createGithubUrl channelDetails.branch position) ] ]