From: Canan Talayhan <canan.t.talayhan@gmail.com>
To: guix-devel@gnu.org
Subject: [Outreachy] - Guix Data Service - Set a more informative page title
Date: Tue, 13 Apr 2021 12:01:47 +0300 [thread overview]
Message-ID: <CAAosC5LWRR59xBYo+UjjGyBGWPBa7hzg0JPxEPoJj-2vnfyvUg@mail.gmail.com> (raw)
[-- 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
next reply other threads:[~2021-04-13 10:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 9:01 Canan Talayhan [this message]
2021-04-13 11:57 ` [Outreachy] - Guix Data Service - Set a more informative page title 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
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=CAAosC5LWRR59xBYo+UjjGyBGWPBa7hzg0JPxEPoJj-2vnfyvUg@mail.gmail.com \
--to=canan.t.talayhan@gmail.com \
--cc=guix-devel@gnu.org \
/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).