unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [Outreachy] - Guix Data Service - Set a more informative page title
@ 2021-04-13  9:01 Canan Talayhan
  2021-04-13 11:57 ` Maxime Devos
  0 siblings, 1 reply; 19+ messages in thread
From: Canan Talayhan @ 2021-04-13  9:01 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 985 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 8155 bytes --]

[-- Attachment #2: jobs-title-and-view.diff --]
[-- Type: text/x-patch, Size: 3516 bytes --]

 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

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-04-24 20:22 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).