unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Canan Talayhan <canan.t.talayhan@gmail.com>
To: Christopher Baines <mail@cbaines.net>
Cc: guix-devel@gnu.org
Subject: Re: [Outreachy] - Guix Data Service - Set a more informative page title
Date: Fri, 23 Apr 2021 11:34:10 +0300	[thread overview]
Message-ID: <CAAosC5LUD=TAqK3sp9PWmCcTqUBBxWM-=z8THen5C5jjWYgdHw@mail.gmail.com> (raw)
In-Reply-To: <878s5ahzke.fsf@cbaines.net>

[-- Attachment #1: Type: text/plain, Size: 6771 bytes --]

It seems after testing lots of pages this one escaped me since I only
tested the working case.

Please find the quick fix in the link below.
https://pastebin.ubuntu.com/p/s7tWyPHZ8F/

I'm looking forward to making another contribution. Could you please
review it as soon as possible?

Thanks,
Canan Talayhan


On Thu, Apr 22, 2021 at 10:47 PM Christopher Baines <mail@cbaines.net> wrote:
>
>
> Canan Talayhan <canan.t.talayhan@gmail.com> writes:
>
> > I've missed it unintentionally. I've not touched the "@" sign this time. :)
> >
> >>>  + (define page-header "Comparing")
> >  >>  +
> >  >>   (layout
> >  >>  +  #:title
> >  >>  +  (string-append page-header " " (string-take base-commit 8) " and "
> >  >>  +  (string-take target-commit 8))
> >  >>    #:body
> >  >>    `(,(header)
> >  >>     (div
> >  >>  @@ -107,7 +112,7 @@
> >  >>      (@ (class "col-sm-7"))
> >  >>      ,@(if invalid-query?
> >  >>         `((h1 "Compare"))
> >  >>  -       `((h1 "Comparing "
> >  >>  +       `((h1 ,page-header ," "
> >  >>            (a (@ (href ,(string-append "/revision/" base-commit)))
> >  >>              (samp ,(string-take base-commit 8) "…"))
> >  >>            " and "
> >
> > I think I misunderstood that comment.
> >>> There's a couple of things here. I'd be tempted not to use a variable
> >>> for "Comparing", it's not really the page header, as that's more
> >>> complicated, so I think I'd just use the string in both places.
> >
> > Now, I've fixed it this way. I hope this version is good.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > *(layout   #:title   (string-append "Comparing " (string-take base-commit
> > 8) " and "    (string-take target-commit 8))   #:body   `(,(header)
> >  (div      (@ (class "container"))      (div       (@ (class "row"))
> >  (div        (@ (class "col-sm-7"))        ,@(if invalid-query?
> >   `((h1 "Compare"))              `((h1 "Comparing "                    (a
> > (@ (href ,(string-append "/revision/" base-commit)))
> >  (samp ,(string-take base-commit 8) "…"))                    " and "*
> >
>
> I think your email came through a bit garbled, anyway, I think there's
> still an issue with the title here.
>
> > On Mon, Apr 19, 2021 at 10:16 PM Christopher Baines <mail@cbaines.net>
> > wrote:
> >
> >>
> >> Canan Talayhan <canan.t.talayhan@gmail.com> writes:
> >>
> >> > Thanks for your quick response.
> >> >
> >> >>Why's the @ being removed here?
> >> > It interprets like an HTML code when I use the page-header like
> >> > `,page-header, so I removed it. According to your comment, I reverted
> >> > to the original version.
> >> >
> >> > " 'GET repository..." which includes package/package-name in the URL
> >> > has not the best titles since I couldn't test them because of the
> >> > error that I've mentioned.
> >> > I'm open to suggestions.
> >> >
> >> > Could you please re-review the patch that contains all the
> >> > modifications you've mentioned in the previous message?
> >>
> >> I've had another look, see my comments below.
> >>
> >> > On Sun, Apr 18, 2021 at 8:53 PM Christopher Baines <mail@cbaines.net>
> >> wrote:
> >> >>
> >> >>
> >> >> Canan Talayhan <canan.t.talayhan@gmail.com> writes:
> >> >>
> >> >> > I've updated the patch that contains all the suggestions. I think the
> >> patch
> >> >> > is ready to merge.
> >> >> >
> >> >> > One thing that I would like to ask you about the package and
> >> package-name
> >> >> > in web/repository/controller.scm.
> >> >> >
> >> >> > When I test the URL below I'm getting this error. (
> >> >> > https://pastebin.ubuntu.com/p/HdKShmKqH7/)
> >> >> >
> >> >> >    - ('GET "repository" repository-id "branch" branch-name "package"
> >> >> >    package-name) ->
> >> >> >    http://localhost:8765/repository/1/branch/master/package/emacs
> >> >> >
> >> >> > What do you think? BTW it's accessible on the official server.
> >> >> >
> >> >> >    -
> >> https://data.guix.gnu.org/repository/1/branch/master/package/emacs/
> >> >>
> >> >> Hmm, this could possibly be due to an issue with the small dump of the
> >> >> database.
> >> >>
> >> >> > Could you please review the patch attached?
> >> >> > I'm very excited to make my first FOSS contribution. :)
> >> >>
> >> >> I've had a look though, and I have some more comments:
> >> >>
> >> >>   diff --git a/guix-data-service/web/compare/html.scm
> >> b/guix-data-service/web/compare/html.scm
> >> >>   index 5b5fe0a..170fb12 100644
> >> >>   --- a/guix-data-service/web/compare/html.scm
> >> >>   +++ b/guix-data-service/web/compare/html.scm
> >> >>   @@ -96,7 +96,12 @@
> >> >>        (unless invalid-query?
> >> >>          (query-parameters->string query-parameters)))
> >> >>
> >> >>   +  (define page-header "Comparing")
> >> >>   +
> >> >>      (layout
> >> >>   +   #:title
> >> >>   +   (string-append page-header " " (string-take base-commit 8) " and "
> >> >>   +    (string-take target-commit 8))
> >> >>       #:body
> >> >>       `(,(header)
> >> >>         (div
> >> >>   @@ -107,7 +112,7 @@
> >> >>            (@ (class "col-sm-7"))
> >> >>            ,@(if invalid-query?
> >> >>                  `((h1 "Compare"))
> >> >>   -              `((h1 "Comparing "
> >> >>   +              `((h1 ,page-header ," "
> >> >>                        (a (@ (href ,(string-append "/revision/"
> >> base-commit)))
> >> >>                           (samp ,(string-take base-commit 8) "…"))
> >> >>                        " and "
> >> >>
> >> >> There's a couple of things here. I'd be tempted not to use a variable
> >> >> for "Comparing", it's not really the page header, as that's more
> >> >> complicated, so I think I'd just use the string in both places.
> >> >>
> >> >> Second thing, the (if invalid-query? bit when constructing the h1
> >> >> element is important. The query parameters being invalid could mean
> >> >> anything from the form just hasn't been filled in, to the value isn't
> >> >> actually a commit hash, but something else, maybe some HTML/JavaScript
> >> >> that is malicious and shouldn't be included in the page. A similar
> >> >> approach probably needs taking for the title.
> >>
> >> This stuff above still looks the same to me, although part of my
> >> analysis was wrong, as the type of an invalid parameter is a record, so
> >> the page just breaks if the parameters are invalid (which I guses is
> >> better than what I was describing).
> >>
> >> Anyway, I think this still needs fixing.
>
> These are my relevant comments from before, you should be able to see
> the error yourself if you go to /compare locally, does this page work
> for you?

[-- Attachment #2: 0001-Set-a-more-informative-page-titles.patch --]
[-- Type: text/x-patch, Size: 19996 bytes --]

From eb21a20037d9765d8339de8ffa4d615366b893a4 Mon Sep 17 00:00:00 2001
From: Canan Talayhan <canan.t.talayhan@gmail.com>
Date: Fri, 23 Apr 2021 11:19:32 +0300
Subject: [PATCH] Set a more informative page titles

Any page where the title is "Guix Data Service"
---
 guix-data-service/web/build-server/html.scm | 24 ++++++--
 guix-data-service/web/build/html.scm        |  6 +-
 guix-data-service/web/compare/html.scm      | 24 +++++++-
 guix-data-service/web/dumps/html.scm        |  6 +-
 guix-data-service/web/jobs/html.scm         | 29 +++++++--
 guix-data-service/web/nar/html.scm          |  5 +-
 guix-data-service/web/package/html.scm      |  3 +
 guix-data-service/web/repository/html.scm   | 30 +++++++++-
 guix-data-service/web/revision/html.scm     | 65 +++++++++++++++++++--
 guix-data-service/web/view/html.scm         | 12 ++--
 10 files changed, 179 insertions(+), 25 deletions(-)

diff --git a/guix-data-service/web/build-server/html.scm b/guix-data-service/web/build-server/html.scm
index f16a570..541a960 100644
--- a/guix-data-service/web/build-server/html.scm
+++ b/guix-data-service/web/build-server/html.scm
@@ -27,7 +27,11 @@
 (define (view-build query-parameters
                     build
                     required-failed-builds)
+  (define page-header "Build")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -36,7 +40,7 @@
        (@ (class "row"))
        (div
         (@ (class "col-sm-12"))
-        (h1 "Build")))
+        (h1 ,page-header)))
       (div
        (@ (class "row"))
        ,@(match build
@@ -98,7 +102,11 @@
             '())))))
 
 (define (view-build-servers build-servers)
+  (define page-header "Build servers")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -107,7 +115,7 @@
        (@ (class "row"))
        (div
         (@ (class "col-sm-12"))
-        (h2 "Build servers")
+        (h2 ,page-header)
         ,@(map
            (match-lambda
              ((id url lookup-all-derivations? lookup-builds?)
@@ -127,7 +135,11 @@
            build-servers)))))))
 
 (define (view-build-server build-server)
+  (define page-header "Build server")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -136,7 +148,7 @@
        (@ (class "row"))
        (div
         (@ (class "col-sm-12"))
-        (h2 "Build server")
+        (h2 ,page-header)
         ,(match build-server
            ((url lookup-all-derivations?)
             `(dl
@@ -150,7 +162,11 @@
                        "No")))))))))))
 
 (define (view-signing-key sexp)
+  (define page-header "Signing key")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -159,5 +175,5 @@
        (@ (class "row"))
        (div
         (@ (class "col-sm-12"))
-        (h2 "Signing key")
+        (h2 ,page-header)
         ,(sexp-div sexp)))))))
diff --git a/guix-data-service/web/build/html.scm b/guix-data-service/web/build/html.scm
index 18d045a..4b758bb 100644
--- a/guix-data-service/web/build/html.scm
+++ b/guix-data-service/web/build/html.scm
@@ -29,7 +29,11 @@
                      valid-targets
                      stats
                      builds)
+  (define page-header "Builds")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -38,7 +42,7 @@
        (@ (class "row"))
        (div
         (@ (class "col-sm-12"))
-        (h1 "Builds")
+        (h1 ,page-header)
         (table
          (@ (class "table"))
          (thead
diff --git a/guix-data-service/web/compare/html.scm b/guix-data-service/web/compare/html.scm
index 5b5fe0a..62b0991 100644
--- a/guix-data-service/web/compare/html.scm
+++ b/guix-data-service/web/compare/html.scm
@@ -97,6 +97,11 @@
       (query-parameters->string query-parameters)))
 
   (layout
+   #:title
+   (if invalid-query?
+      "Compare"
+      (string-append "Comparing " (string-take base-commit 8) " and "
+        (string-take target-commit 8)))
    #:body
    `(,(header)
      (div
@@ -420,6 +425,8 @@
               (style "font-size: 1.5em; padding-right: 0.4em;"))))
 
   (layout
+   #:title
+   "Comparing derivations"
    #:body
    `(,(header)
      (div
@@ -685,7 +692,11 @@
   (define fields
     (assq-ref query-parameters 'field))
 
+  (define page-header "Package derivation changes")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -835,7 +846,7 @@ enough builds to determine a change")))
        (@ (class "row"))
        (div
         (@ (class "col-sm-12"))
-        (h1 "Package derivation changes")
+        (h1 ,page-header)
         ,(if
           (null? derivation-changes)
           '(p "No derivation changes")
@@ -950,7 +961,12 @@ enough builds to determine a change")))
     (string-append "?base_commit=" base-commit
                    "&target_commit=" target-commit))
 
+  (define page-header (string-append "Comparing "
+    (string-take base-commit 8) " and " (string-take target-commit 8)))
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -1042,7 +1058,11 @@ enough builds to determine a change")))
                                           #:optional
                                           base-revision-details
                                           target-revision-details)
+  (define page-header "System test derivation changes")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -1141,7 +1161,7 @@ enough builds to determine a change")))
        (@ (class "row"))
        (div
         (@ (class "col-sm-12"))
-        (h1 "System test derivation changes")
+        (h1 ,page-header)
         ,(if
           (null? changes)
           '(p "No system test derivation changes")
diff --git a/guix-data-service/web/dumps/html.scm b/guix-data-service/web/dumps/html.scm
index 71e69c8..d6d77f9 100644
--- a/guix-data-service/web/dumps/html.scm
+++ b/guix-data-service/web/dumps/html.scm
@@ -22,7 +22,11 @@
   #:export (view-dumps))
 
 (define (view-dumps available-dumps)
+  (define page-header "Database dumps")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -31,7 +35,7 @@
        (@ (class "row"))
        (div
         (@ (class "col-sm-12"))
-        (h1 "Database dumps")))
+        (h1 ,page-header)))
       ,@(map
          (match-lambda
            ((date-string . files)
diff --git a/guix-data-service/web/jobs/html.scm b/guix-data-service/web/jobs/html.scm
index 82734d6..5c5881c 100644
--- a/guix-data-service/web/jobs/html.scm
+++ b/guix-data-service/web/jobs/html.scm
@@ -30,7 +30,11 @@
                    jobs-and-events
                    recent-events
                    show-next-page?)
+  (define page-header "Jobs")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -40,7 +44,7 @@
        (div
         (@ (class "col-sm-12"))
         (h1 (@ (style "display: inline-block;"))
-            "Jobs")
+            ,page-header)
         (div
          (@ (class "btn-group pull-right")
             (style "margin-top: 1.3rem;")
@@ -189,7 +193,11 @@
 
 (define (view-job-events query-parameters
                          recent-events)
+  (define page-header "Recent events")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -200,7 +208,7 @@
         (@ (class "col-sm-12"))
         (a (@ (href "/jobs"))
            (h3 "Jobs"))
-        (h1 "Recent events")))
+        (h1 ,page-header)))
       (div
        (@ (class "row"))
        (div
@@ -256,7 +264,14 @@
              recent-events)))))))))
 
 (define (view-job-queue jobs-and-events)
+  (define page-header
+    (string-append "Queued jobs ("
+              (number->string (length jobs-and-events))
+              ")"))
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -267,9 +282,7 @@
         (@ (class "col-sm-12"))
         (a (@ (href "/jobs"))
            (h3 "Jobs"))
-        (h1 "Queued jobs ("
-            ,(length jobs-and-events)
-            ")")))
+        (h1 ,page-header)))
       (div
        (@ (class "row"))
        (div
@@ -330,7 +343,11 @@
                  jobs-and-events)))))))))
 
 (define (view-job job-id query-parameters log)
+  (define page-header (string-append "Job " job-id))
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -339,7 +356,7 @@
        (@ (class "row"))
        (div
         (@ (class "col-sm-12"))
-        (h1 "Job " ,job-id)))
+        (h1 ,page-header)))
       (div
        (@ (class "row"))
        (div
diff --git a/guix-data-service/web/nar/html.scm b/guix-data-service/web/nar/html.scm
index 596d16b..063b091 100644
--- a/guix-data-service/web/nar/html.scm
+++ b/guix-data-service/web/nar/html.scm
@@ -22,7 +22,10 @@
   #:export (view-substitutes))
 
 (define (view-substitutes narinfo-signing-public-key)
+  (define page-header "Substitutes")
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -31,7 +34,7 @@
        (@ (class "row"))
        (div
         (@ (class "col-sm-12"))
-        (h1 "Substitutes")
+        (h1 ,page-header)
         ,@(if (canonical-sexp? narinfo-signing-public-key)
               `((h3 "Public key")
                 (pre
diff --git a/guix-data-service/web/package/html.scm b/guix-data-service/web/package/html.scm
index 0d9b078..85b33e9 100644
--- a/guix-data-service/web/package/html.scm
+++ b/guix-data-service/web/package/html.scm
@@ -24,7 +24,10 @@
   #:export (view-package))
 
 (define* (view-package name package-version-with-branches)
+
   (layout
+   #:title
+   (string-append "Package: " name)
    #:body
    `(,(header)
      (div
diff --git a/guix-data-service/web/repository/html.scm b/guix-data-service/web/repository/html.scm
index 88f2632..4bb50db 100644
--- a/guix-data-service/web/repository/html.scm
+++ b/guix-data-service/web/repository/html.scm
@@ -32,7 +32,11 @@
             view-no-latest-revision))
 
 (define* (view-git-repositories git-repositories)
+   (define page-header "Git repositories")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -41,7 +45,7 @@
        (@ (class "row"))
        (div
         (@ (class "col-md-12"))
-        (h1 "Git repositories")))
+        (h1 ,page-header)))
       ,@(map
          (match-lambda
            ((id label url cgit-base-url)
@@ -65,7 +69,11 @@
 (define* (view-git-repository git-repository-id
                               label url cgit-url-base
                               branches-with-most-recent-commits)
+  (define page-header (string-append "Repository " (string-drop url 8)))
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -86,7 +94,11 @@
 
 (define (view-branch git-repository-id
                      branch-name query-parameters branch-commits)
+  (define page-header (string-append branch-name " branch"))
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -197,7 +209,11 @@
                              branch-name
                              package-name
                              versions-by-revision-range)
+  (define page-header (string-append package-name " on " branch-name))
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -386,6 +402,8 @@
                 (map first derivations-by-revision-range))))
 
   (layout
+   #:title
+   (string-append package-name " package derivations")
    #:body
    `(,(header)
      (div
@@ -636,6 +654,8 @@
                 (map first outputs-by-revision-range))))
 
   (layout
+   #:title
+   (string-append package-name " package outputs")
    #:body
    `(,(header)
      (div
@@ -849,6 +869,8 @@
                                          valid-systems
                                          system-test-history)
   (layout
+   #:title
+   (string-append system-test-name " history")
    #:body
    `(,(header)
      (div
@@ -1016,12 +1038,16 @@
                 '(#f))))))))))))
 
 (define (view-no-latest-revision branch-name)
+   (define page-header "No latest revision")
+
   (layout
+   #:title
+   (string-append page-header " for " branch-name)
    #:body
    `(,(header)
      (div
       (@ (class "container"))
-      (h1 "No latest revision")
+      (h1 ,page-header)
       (p "No latest revision for "
          (strong (samp ,branch-name))
          " branch")))))
diff --git a/guix-data-service/web/revision/html.scm b/guix-data-service/web/revision/html.scm
index 25b79f4..514129b 100644
--- a/guix-data-service/web/revision/html.scm
+++ b/guix-data-service/web/revision/html.scm
@@ -48,7 +48,11 @@
 (define* (view-revision-news commit-hash
                              query-parameters
                              news-entries)
+
   (layout
+   #:title
+   (string-append "Channel News Entries - Revision "
+    (string-take commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -107,7 +111,11 @@
                                 #:key path-base
                                 header-text
                                 header-link)
+
   (layout
+   #:title
+   (string-append "Package: " name " - Revision "
+    (string-take revision-commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -135,7 +143,7 @@
                                          branch-name))))
                   branches)))
           git-repositories-and-branches)
-        (h1 "Package " ,name)))
+        (h1 "Package: " ,name)))
       (div
        (@ (class "row"))
        (div
@@ -169,7 +177,11 @@
                                             #:key header-text
                                             header-link
                                             version-history-link)
+
   (layout
+   #:title
+   (string-append "Package: " name " @ " version " - Revision "
+    (string-take revision-commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -224,7 +236,7 @@
                       (role "button"))
                    "Version history"))
               '())
-        (h1 "Package " ,name " @ " ,version)))
+        (h1 "Package: " ,name " @ " ,version)))
       (div
        (@ (class "row"))
        (div
@@ -471,7 +483,10 @@
                         lint-warning-counts
                         #:key (path-base "/revision/")
                         header-text)
+
   (layout
+   #:title
+   (string-append "Revision " (string-take commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -548,6 +563,9 @@
        "Home page" "Location" "Licenses")))
 
   (layout
+   #:title
+   (string-append  "Packages - Revision "
+    (string-take revision-commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -756,6 +774,9 @@
      package-description-counts))
 
   (layout
+   #:title
+   (string-append "Packages translation availability - Revision "
+    (string-take commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -835,7 +856,10 @@
                                      query-parameters
                                      #:key (path-base "/revision/")
                                      header-text header-link)
+
   (layout
+   #:title
+   (string-append  "System tests - Revision " (string-take commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -936,7 +960,11 @@
                                           channel-instances
                                           #:key (path-base "/revision/")
                                           header-text header-link)
+
   (layout
+   #:title
+   (string-append "Channel instances - Revision "
+    (string-take commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -1217,6 +1245,9 @@ figure {
                 colours))))))
 
   (layout
+   #:title
+   (string-append "Package substitute availability - Revision "
+    (string-take revision-commit-hash 7))
    #:body
    `(,(header)
      (style ,chart-css)
@@ -1254,7 +1285,11 @@ figure {
                                                 #:key (path-base "/revision/")
                                                 header-text
                                                 header-link)
+
   (layout
+   #:title
+   (string-append  "Package reproducibility - Revision "
+    (string-take revision-commit-hash 7))
    #:body
    `(,(header)
      (style "
@@ -1522,6 +1557,9 @@ figure {
     (assq-ref query-parameters 'field))
 
   (layout
+   #:title
+   (string-append  "Package derivations - Revision "
+    (string-take commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -1703,6 +1741,9 @@ figure {
       ))
 
   (layout
+   #:title
+   (string-append  "Fixed output package derivations - Revision "
+    (string-take commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -1843,6 +1884,9 @@ figure {
          build-server-urls))
 
   (layout
+   #:title
+   (string-append "Package derivation outputs - Revision "
+    (string-take commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -2021,7 +2065,10 @@ figure {
                               build-server-options
                               stats
                               builds)
+
   (layout
+   #:title
+   (string-append  "Builds - Revision " (string-take commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -2159,6 +2206,9 @@ figure {
      '("Linter" "Message" "Location")))
 
   (layout
+   #:title
+   (string-append "Lint warnings - Revision "
+    (string-take revision-commit-hash 7))
    #:body
    `(,(header)
      (div
@@ -2314,7 +2364,11 @@ figure {
 
 (define (unknown-revision commit-hash job git-repositories-and-branches
                           jobs-and-events)
+  (define page-header "Unknown revision")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -2347,13 +2401,16 @@ figure {
                 (strong (@ (class "text-center")
                            (style "font-size: 2em; display: block;"))
                         "Unknown"))))
-            `((h1 "Unknown revision")
+            `((h1 ,page-header)
               (p "No known revision with commit "
                  (strong (samp ,commit-hash)))))))))
 
 (define (unprocessed-revision commit-hash job git-repositories-and-branches
                               jobs-and-events)
+  (define page-header "Unknown revision")
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -2375,6 +2432,6 @@ figure {
                        git-repositories-and-branches
                        commit-hash))
                 ,@(view-revision/jobs-and-events jobs-and-events))))
-            `((h1 "Unknown revision")
+            `((h1 ,page-header)
               (p "No known revision with commit "
                  (strong (samp ,commit-hash)))))))))
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index 8063e17..33535a9 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -65,13 +65,15 @@
 (define* (layout #:key
                  (head '())
                  (body '())
-                 (title "Guix Data Service")
+                 title
                  description)
   `((doctype "html")
     (html
      (@ (lang "en"))
      (head
-      (title ,title)
+      (title ,(if title
+               (string-append title " — Guix Data Service")
+               "Guix Data Service"))
       (meta (@ (http-equiv "Content-Type")
                (content "text/html; charset=UTF-8")))
       (meta (@ (name "viewport")
@@ -286,8 +288,7 @@
 (define (index git-repositories-and-revisions)
   (layout
    #:description
-   "The Guix Data Service processes, stores and provides data about Guix over
-time."
+   "The Guix Data Service processes, stores and provides data about Guix over time."
    #:body
    `(,(header)
      (div
@@ -334,7 +335,10 @@ time."
          git-repositories-and-revisions)))))
 
 (define (view-statistics guix-revisions-count derivations-count)
+  (define page-header "Statistics")
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
-- 
2.17.1


  reply	other threads:[~2021-04-23  8:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13  9:01 [Outreachy] - Guix Data Service - Set a more informative page title Canan Talayhan
2021-04-13 11:57 ` Maxime Devos
2021-04-13 15:56   ` Canan Talayhan
2021-04-13 17:51     ` Maxime Devos
2021-04-15 12:08       ` Canan Talayhan
2021-04-15 21:52         ` Christopher Baines
2021-04-16  9:58           ` Canan Talayhan
2021-04-16 11:11             ` Christopher Baines
2021-04-18 13:42               ` Canan Talayhan
2021-04-18 17:53                 ` Christopher Baines
2021-04-18 20:37                   ` Canan Talayhan
2021-04-19 19:16                     ` Christopher Baines
2021-04-21 15:43                       ` Canan Talayhan
2021-04-22 19:46                         ` Christopher Baines
2021-04-23  8:34                           ` Canan Talayhan [this message]
2021-04-23 12:10                             ` Christopher Baines
2021-04-24 11:39                               ` Christopher Baines
2021-04-24 15:30                                 ` Canan Talayhan
2021-04-24 20:21                                   ` Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAosC5LUD=TAqK3sp9PWmCcTqUBBxWM-=z8THen5C5jjWYgdHw@mail.gmail.com' \
    --to=canan.t.talayhan@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=mail@cbaines.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).