DATARAMA

Improve tree entry page layout

January 29, 2016
Project: goon

This patch introduces a sidebar link to the owning project of tree entries, and uses the entry filename as page title.

1 files changed, 5 insertions / 5 deletions

diff --git a/goon.scm b/goon.scm
index 3e27568..3f790d3 100755
--- a/goon.scm
+++ b/goon.scm
@@ -582,13 +582,13 @@
 (define (tree-entry-sidebar repo entry)
   (let* ((blob (tree-entry->object repo entry))
          (bytes (blob-length blob))
-         (filename (tree-entry-name entry))
          (lines (if (blob-binary? blob) #f 
                   (count-lines (blob->string (blob-content blob))))))
     `(div (@ (class "sidebar-module-outer"))
           (div (@ (class "sidebar-module"))
-               (h2 "Filename")
-               (span (@ (class "entry-filename")) ,filename)
+               (h2 "project")
+               (a (@ (href ,(repository-outfile repo "master")))
+                ,(repository-name repo))
                (h2 "Bytes")
                ,bytes
                ,(if lines
@@ -613,8 +613,8 @@
            (content (blob-content blob))
            (filename (tree-entry-name entry)))
       (output-page repo
-        (prep-output `((header-title . ,(repository-name repo))
-                   (title        . (h1 (@ (id "pagetitle")) ,(string-append "Project: " (repository-name repo))))
+        (prep-output `((header-title . ,(string-append (repository-name repo) ":" (tree-entry-name entry)))
+                       (title        . (h1 (@ (id "pagetitle")) ,(tree-entry-name entry)))
                        (sidebar      . ,(tree-entry-sidebar repo entry))
                        (content      . ,(tree-entry-content repo entry))))
         (tree-entry-path entry)))))
 
Powered by Plutonium