guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: hydra/googles: Go back to list of logs for the cu


From: Ricardo Wurmus
Subject: branch master updated: hydra/googles: Go back to list of logs for the current channel.
Date: Mon, 27 Apr 2020 11:37:27 -0400

This is an automated email from the git hooks/post-receive script.

rekado pushed a commit to branch master
in repository maintenance.

The following commit(s) were added to refs/heads/master by this push:
     new 3e5a726  hydra/googles: Go back to list of logs for the current 
channel.
3e5a726 is described below

commit 3e5a72633bef36540a8f002f0ae4a9482ad5cc2c
Author: Ricardo Wurmus <address@hidden>
AuthorDate: Mon Apr 27 17:35:33 2020 +0200

    hydra/googles: Go back to list of logs for the current channel.
    
    * hydra/googles.scm (render-log): Accept CHANNEL argument and use it
    in the link to the list of logs.
    (%controller): Pass CHANNEL argument to RENDER-LOG.
---
 hydra/goggles.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/hydra/goggles.scm b/hydra/goggles.scm
index 0795f46..264a830 100755
--- a/hydra/goggles.scm
+++ b/hydra/goggles.scm
@@ -262,7 +262,7 @@ representation highlighting certain parts."
                                           (_ (cons chunk acc)))))) '()
                                           rest))))))))
 
-(define (render-log root path)
+(define (render-log channel root path)
   ;; PATH is a list of path components
   (let ((file-name (string-join (cons* root path) "/")))
     (if (and (not (any (cut string-contains <> "..") path))
@@ -279,7 +279,8 @@ representation highlighting certain parts."
              (body
               (h1 "IRC channel logs")
               (h2 ,path)
-              (p (a (@ (href "/")) "back to list of logs"))
+              (p (a (@ (href ,(string-append "/" channel)))
+                    "back to list of logs"))
               (div (@ (id "logs"))
                    ,@(map handle-line split-lines))))))
         (not-found (build-uri 'http
@@ -355,9 +356,9 @@ freenode." channel))
     (('GET (? (cut member <> (assoc-ref %config 'channels)) channel))
      (render-html (index channel)))
     (('GET (? (cut member <> (assoc-ref %config 'channels)) channel) path ...)
-     (render-log (string-append %log-root "/#" channel "/") path))
+     (render-log channel (string-append %log-root "/#" channel "/") path))
     (('GET path ...)
-     (render-log (string-append %log-root "/#guix/") path))))
+     (render-log "guix" (string-append %log-root "/#guix/") path))))
 
 (define (request-path-components request)
   (split-and-decode-uri-path (uri-path (request-uri request))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]