Hi everyone,

My name is Canan. I'm an Outreachy applicant. I'm working on the
introductory task for Guix Data Service.


Introductory task:

   - Set a more informative page title for any page where the title is
   "Guix Data Service"


I've created a patch for the "Jobs" page. If it looks good for everyone
then I can proceed with other applicable pages.


Now, I'm working on the title part of the code snippet below to make it
more elegant.


```scm

(define* (layout #:key

                 (head '())

                 (body '())

                 title

                 description)

  `((doctype "html")

    (html

     (@ (lang "en"))

     (head

      ,@(if title

            `((title ,(string-append title " - Guix Data Service")))

            `((title "Guix Data Service")))

```


Could you please review and share your comments? I'll be appreciated.


Attached file: jobs-title-and-view.diff


Thanks,

Canan Talayhan

MSc. in Computer Engineering
Guix IRC: canant
 guix-data-service/web/jobs/html.scm | 25 +++++++++++++++++++++----
 guix-data-service/web/view/html.scm | 11 +++++++----
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/guix-data-service/web/jobs/html.scm b/guix-data-service/web/jobs/html.scm
index 82734d6..44d4b68 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,11 @@
              recent-events)))))))))
 
 (define (view-job-queue jobs-and-events)
+  (define page-header "Queued Jobs")
+
   (layout
+   #:title
+   page-header
    #:body
    `(,(header)
      (div
@@ -267,7 +279,7 @@
         (@ (class "col-sm-12"))
         (a (@ (href "/jobs"))
            (h3 "Jobs"))
-        (h1 "Queued jobs ("
+        (h1 ,page-header"("
             ,(length jobs-and-events)
             ")")))
       (div
@@ -329,8 +341,13 @@
                              '())))))
                  jobs-and-events)))))))))
 
+
 (define (view-job job-id query-parameters log)
+  (define page-header "Job")
+
   (layout
+   #:title
+   (string-append page-header job-id)
    #:body
    `(,(header)
      (div
@@ -339,7 +356,7 @@
        (@ (class "row"))
        (div
         (@ (class "col-sm-12"))
-        (h1 "Job " ,job-id)))
+        (h1 ,page-header ,job-id)))
       (div
        (@ (class "row"))
        (div
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm
index 8063e17..94ea9a1 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)
+      ,@(if title
+            `((title ,(string-append title " - Guix Data Service")))
+            `((title "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
@@ -335,6 +336,8 @@ time."
 
 (define (view-statistics guix-revisions-count derivations-count)
   (layout
+   #:title
+   "Statistics"
    #:body
    `(,(header)
      (div

Reply via email to