Store license information for packages

And display this on the package page.

This uses a couple of new tables, and an additional field in the
package_metadata table.

Currently, the order of the licenses in the package definition isn't stored,
as I'm not sure the order in the list is significant.
This commit is contained in:
Christopher Baines 2019-05-15 08:05:14 +01:00
parent 28c2d46081
commit 16799a34a9
12 changed files with 393 additions and 16 deletions

View file

@ -327,7 +327,8 @@
(div
(@ (class "col-sm-12"))
,(match package-metadata
(((synopsis description home-page file line column-number))
(((synopsis description home-page file line column-number
licenses))
`(dl
(@ (class "dl-horizontal"))
(dt "Synopsis")
@ -355,6 +356,16 @@
", column: " ,column-number ")")
'())))
git-repositories)))
'())
,@(if (> (vector-length licenses) 0)
`((dt ,(if (eq? (vector-length licenses) 1)
"License"
"Licenses"))
(dd (ul
,@(map (lambda (license)
`(li (a (@ (href ,(assoc-ref license "uri")))
,(assoc-ref license "name"))))
(vector->list licenses)))))
'()))))))
(div
(@ (class "row"))