all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob d3f9feea1e34435c8d2d207e9aca345602cc9c34 2731 bytes (raw)
name: website/apps/development/templates/components.scm 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 
;;; GNU Guix web site
;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of the GNU Guix web site.
;;;
;;; The GNU Guix web site is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU Affero General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; The GNU Guix web site is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU Affero General Public License for more details.
;;;
;;; You should have received a copy of the GNU Affero General Public License
;;; along with the GNU Guix web site.  If not, see <http://www.gnu.org/licenses/>.

(define-module (apps development templates components)
  #:use-module (apps aux lists)
  #:use-module (apps aux web)
  #:use-module (apps base templates components)
  #:use-module (apps base utils)
  #:use-module (apps i18n)
  #:use-module (apps development data)
  #:use-module (srfi srfi-19)
  #:export (branch->shtml))

(define (next-deadline date period)
  "Return DATE or, if DATE is past, DATE + PERIOD.  DATE must be a SRFI-19
date and PERIOD is a number of seconds."
  (let ((now  (current-time time-utc))
        (then (date->time-utc date)))
    (if (and (time>? now then)
             (time> (time-difference now then)
                    (make-time time-utc 0
                               (* 2 7 3600 24))))
        (time-utc->date
         (make-time time-utc 0
                    (+ (time-second then) period)))
        date)))

(define (branch->shtml branch)
  `(div (@ (class "branch-overview"))
        (div (@ (class "branch-overview-heading"))
             (a (@ (href ,(branch-git-view-url branch)))
                (tt ,(branch-name branch)))
             (a (@ (href ,(branch-build-status-url branch)))
                (img (@ (alt ,(G_ "branch build status"))
                        (src ,(branch-build-badge-url branch))))))

        (div (@ (class "branch-synopsis"))
             ,(branch-synopsis branch))
        (div (@ (class "branch-description"))
             ,(branch-description branch))

        ,@(if (branch-target-date branch)
              `(,(G_ `(div (@ (class "branch-date"))
                           "target merge date: "
                           ,(date->string
                             (next-deadline (branch-target-date branch)
                                            (branch-merge-period branch))
                             (C_ "SRFI-19 data->string format"
                                 "~Y-~m-~d")))))
              '())))

debug log:

solving d3f9fee ...
found d3f9fee in https://yhetil.org/guix/20210702162904.314-1-ludo@gnu.org/

applying [1/1] https://yhetil.org/guix/20210702162904.314-1-ludo@gnu.org/
diff --git a/website/apps/development/templates/components.scm b/website/apps/development/templates/components.scm
new file mode 100644
index 0000000..d3f9fee

Checking patch website/apps/development/templates/components.scm...
Applied patch website/apps/development/templates/components.scm cleanly.

index at:
100644 d3f9feea1e34435c8d2d207e9aca345602cc9c34	website/apps/development/templates/components.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.