Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixos-search
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 01559c1dfcf1
Choose a base ref
...
head repository: NixOS/nixos-search
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7a841b70cb54
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jan 17, 2021

  1. Copy the full SHA
    7a841b7 View commit details
Showing with 15 additions and 13 deletions.
  1. +15 −13 src/Page/Packages.elm
28 changes: 15 additions & 13 deletions src/Page/Packages.elm
Original file line number Diff line number Diff line change
@@ -338,14 +338,13 @@ viewResultItem channel showNixOSDetails show item =
"https://github.com/NixOS/nixpkgs/blob/" ++ branch ++ "/" ++ uri

createShortDetailsItem title url =
[ li [ Html.Attributes.map SearchMsg Search.trapClick ]
li [ Html.Attributes.map SearchMsg Search.trapClick ]
[ a
[ href url
, target "_blank"
]
[ text title ]
]
]

shortPackageDetails =
ul []
@@ -357,40 +356,43 @@ viewResultItem channel showNixOSDetails show item =
[]

Just channelDetails ->
createShortDetailsItem
"source"
[ createShortDetailsItem
"Source"
(createGithubUrl channelDetails.branch position)
]
)
|> Maybe.withDefault []
)
|> List.append
(item.source.homepage
|> List.head
|> Maybe.map (createShortDetailsItem "homepage")
|> Maybe.map (\x -> [ createShortDetailsItem "Homepage" x ])
|> Maybe.withDefault []
)
|> List.append
(item.source.licenses
|> List.head
|> Maybe.map
|> List.filterMap
(\license ->
case ( license.fullName, license.url ) of
( Nothing, Nothing ) ->
[]
Nothing

( Just fullName, Nothing ) ->
[ text fullName ]
Just (text fullName)

( Nothing, Just url ) ->
createShortDetailsItem "license" url
Just (createShortDetailsItem "Unknown" url)

( Just fullName, Just url ) ->
createShortDetailsItem fullName url
Just (createShortDetailsItem fullName url)
)
|> Maybe.withDefault []
|> List.intersperse (text ", ")
|> List.append [ text "Licenses: " ]
)
|> List.append
[ li [] [ text item.source.pname ]
[ text "Name: "
, li [] [ text item.source.pname ]
, text "Version: "
, li [] [ text item.source.pversion ]
]
)