Extract out the compare form controls
So they can be used for the package derivations page
This commit is contained in:
parent
814a5d7cba
commit
56983eb03e
1 changed files with 38 additions and 35 deletions
|
|
@ -31,6 +31,43 @@
|
||||||
compare/packages
|
compare/packages
|
||||||
compare-invalid-parameters))
|
compare-invalid-parameters))
|
||||||
|
|
||||||
|
(define (compare-form-controls-for-mode mode query-parameters)
|
||||||
|
(cond
|
||||||
|
((eq? mode 'revision)
|
||||||
|
(list
|
||||||
|
(form-horizontal-control
|
||||||
|
"Base commit" query-parameters
|
||||||
|
#:required? #t
|
||||||
|
#:help-text "The commit to use as the basis for the comparison."
|
||||||
|
#:font-family "monospace")
|
||||||
|
(form-horizontal-control
|
||||||
|
"Target commit" query-parameters
|
||||||
|
#:required? #t
|
||||||
|
#:help-text "The commit to compare against the base commit."
|
||||||
|
#:font-family "monospace")))
|
||||||
|
((eq? mode 'datetime)
|
||||||
|
(list
|
||||||
|
(form-horizontal-control
|
||||||
|
"Base branch" query-parameters
|
||||||
|
#:required? #t
|
||||||
|
#:help-text "The branch to compare from."
|
||||||
|
#:font-family "monospace")
|
||||||
|
(form-horizontal-control
|
||||||
|
"Base datetime" query-parameters
|
||||||
|
#:help-text "The date and time to compare from."
|
||||||
|
#:font-family "monospace")
|
||||||
|
(form-horizontal-control
|
||||||
|
"Target branch" query-parameters
|
||||||
|
#:required? #t
|
||||||
|
#:help-text "The branch to compare to."
|
||||||
|
#:font-family "monospace")
|
||||||
|
(form-horizontal-control
|
||||||
|
"Target datetime" query-parameters
|
||||||
|
#:help-text "The date and time to compare to."
|
||||||
|
#:font-family "monospace")))
|
||||||
|
(else
|
||||||
|
'())))
|
||||||
|
|
||||||
(define (compare query-parameters
|
(define (compare query-parameters
|
||||||
mode
|
mode
|
||||||
cgit-url-bases
|
cgit-url-bases
|
||||||
|
|
@ -112,41 +149,7 @@
|
||||||
(action "")
|
(action "")
|
||||||
(style "padding-bottom: 0")
|
(style "padding-bottom: 0")
|
||||||
(class "form-horizontal"))
|
(class "form-horizontal"))
|
||||||
,@(cond
|
,@(compare-form-controls-for-mode mode query-parameters)
|
||||||
((eq? mode 'revision)
|
|
||||||
(list
|
|
||||||
(form-horizontal-control
|
|
||||||
"Base commit" query-parameters
|
|
||||||
#:required? #t
|
|
||||||
#:help-text "The commit to use as the basis for the comparison."
|
|
||||||
#:font-family "monospace")
|
|
||||||
(form-horizontal-control
|
|
||||||
"Target commit" query-parameters
|
|
||||||
#:required? #t
|
|
||||||
#:help-text "The commit to compare against the base commit."
|
|
||||||
#:font-family "monospace")))
|
|
||||||
((eq? mode 'datetime)
|
|
||||||
(list
|
|
||||||
(form-horizontal-control
|
|
||||||
"Base branch" query-parameters
|
|
||||||
#:required? #t
|
|
||||||
#:help-text "The branch to compare from."
|
|
||||||
#:font-family "monospace")
|
|
||||||
(form-horizontal-control
|
|
||||||
"Base datetime" query-parameters
|
|
||||||
#:help-text "The date and time to compare from."
|
|
||||||
#:font-family "monospace")
|
|
||||||
(form-horizontal-control
|
|
||||||
"Target branch" query-parameters
|
|
||||||
#:required? #t
|
|
||||||
#:help-text "The branch to compare to."
|
|
||||||
#:font-family "monospace")
|
|
||||||
(form-horizontal-control
|
|
||||||
"Target datetime" query-parameters
|
|
||||||
#:help-text "The date and time to compare to."
|
|
||||||
#:font-family "monospace")))
|
|
||||||
(else
|
|
||||||
'()))
|
|
||||||
,(form-horizontal-control
|
,(form-horizontal-control
|
||||||
"Locale" query-parameters
|
"Locale" query-parameters
|
||||||
#:name "locale"
|
#:name "locale"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue