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"
This commit is contained in:
Renaud 2022-02-23 21:22:18 +01:00 committed by GitHub
parent b4163eb8b2
commit 38de95ce40
Failed to generate hash of commit

View file

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