Add a utility to help generate next page links
This commit is contained in:
parent
156b7eea7e
commit
fc9c44b715
1 changed files with 17 additions and 0 deletions
|
|
@ -16,9 +16,13 @@
|
||||||
;;; <http://www.gnu.org/licenses/>.
|
;;; <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
(define-module (guix-data-service web html-utils)
|
(define-module (guix-data-service web html-utils)
|
||||||
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
|
#:use-module (guix-data-service web query-parameters)
|
||||||
#:export (sexp-div
|
#:export (sexp-div
|
||||||
|
|
||||||
|
next-page-link
|
||||||
|
|
||||||
build-status-value->display-string
|
build-status-value->display-string
|
||||||
build-status-span
|
build-status-span
|
||||||
build-status-alist->build-icon))
|
build-status-alist->build-icon))
|
||||||
|
|
@ -38,6 +42,19 @@
|
||||||
((and string val)
|
((and string val)
|
||||||
val)))
|
val)))
|
||||||
|
|
||||||
|
(define (next-page-link path
|
||||||
|
query-parameters
|
||||||
|
field
|
||||||
|
value)
|
||||||
|
(string-append
|
||||||
|
path
|
||||||
|
"?"
|
||||||
|
(query-parameters->string
|
||||||
|
`((,field . ,value)
|
||||||
|
,@(alist-delete
|
||||||
|
field
|
||||||
|
query-parameters)))))
|
||||||
|
|
||||||
(define (build-status-value->display-string value)
|
(define (build-status-value->display-string value)
|
||||||
(assoc-ref
|
(assoc-ref
|
||||||
'(("scheduled" . "Scheduled")
|
'(("scheduled" . "Scheduled")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue