From eea05bba2778e9b968a13ba30d64c1b6b4f60bf6 Mon Sep 17 00:00:00 2001 From: Luis Felipe Date: Thu, 3 Jun 2021 14:22:14 -0500 Subject: [PATCH] website: publications: Add scientific publication mark. * website/apps/media/types.scm (): Add "scientific?" field. * website/apps/media/data.scm (publications): Use the new field. * website/apps/media/templates/components.scm (publication->shtml): Show graduate cap for scientific publications. * website/static/media/css/publications.css (.scientific-mark): New class. * website/static/media/img/scientific-mark.svg: New image. --- website/apps/media/data.scm | 3 +- website/apps/media/templates/components.scm | 12 ++ website/apps/media/types.scm | 14 +- website/static/media/css/publications.css | 7 + website/static/media/img/scientific-mark.svg | 154 +++++++++++++++++++ 5 files changed, 185 insertions(+), 5 deletions(-) create mode 100644 website/static/media/img/scientific-mark.svg diff --git a/website/apps/media/data.scm b/website/apps/media/data.scm index 812f9e3..079a6d3 100644 --- a/website/apps/media/data.scm +++ b/website/apps/media/data.scm @@ -137,7 +137,8 @@ Alexander Gosdschan, Katarzyna Wreczycka, Jonathan Ronen, Altuna Akalin" #:url "https://ambrevar.xyz/guix-advance/index.html" #:authors "Pierre Neidhardt" #:date (string->date "2019-01-14" "~Y-~m-~d") - #:type (C_ "publication type" "Article")) + #:type (C_ "publication type" "Article") + #:scientific? #false) (publication #:title "Scalable Workflows and Reproducible Data Analysis for Genomics" #:url "https://link.springer.com/protocol/10.1007%2F978-1-4939-9074-0_24" diff --git a/website/apps/media/templates/components.scm b/website/apps/media/templates/components.scm index 20fa3a9..a1a6072 100644 --- a/website/apps/media/templates/components.scm +++ b/website/apps/media/templates/components.scm @@ -42,6 +42,18 @@ (h3 (@ (lang ,(publication-language publication)) (class "publication-title")) + ,(if (publication-scientific? publication) + `((img + (@ (class "scientific-mark") + (src ,(guix-url "static/media/img/scientific-mark.svg")) + ;; TRANSLATORS: This is a tag that indicates a + ;; publication is scientific. + (alt ,(G_ "[Scientific]")) + ;; TRANSLATORS: This is a help text indicating a + ;; publication is scientific. + (title ,(G_ "Scientific")))) + " ") + "") ,(publication-title publication)) (p diff --git a/website/apps/media/types.scm b/website/apps/media/types.scm index 2c219e5..ac9bbda 100644 --- a/website/apps/media/types.scm +++ b/website/apps/media/types.scm @@ -8,6 +8,7 @@ #:export (publication publication? publication-authors + publication-scientific? publication-date publication-language publication-title @@ -71,22 +72,27 @@ ;;; The kind of publication. See the list of publications in the ;;; (apps media data) module for examples. ;;; +;;; scientific? (boolean) +;;; Whether the publication is scientific or not. +;;; ;;; (define-record-type - (make-publication title url authors date language type) + (make-publication title url authors date language type scientific?) publication? (title publication-title) (url publication-url) (authors publication-authors) (date publication-date) (language publication-language) - (type publication-type)) + (type publication-type) + (scientific? publication-scientific?)) ;;; Helper procedures. -(define* (publication #:key title url authors date (language "en") type) +(define* (publication #:key title url authors date (language "en") type + (scientific? #true)) "Return a object with the given attributes." - (make-publication title url authors date language type)) + (make-publication title url authors date language type scientific?)) ;;; Screenshot (record type) diff --git a/website/static/media/css/publications.css b/website/static/media/css/publications.css index 797918f..11a8542 100644 --- a/website/static/media/css/publications.css +++ b/website/static/media/css/publications.css @@ -33,3 +33,10 @@ .publication-info { margin-bottom: 0px; } + +.scientific-mark { + display: inline-block; + cursor: help; + height: 28px; + width: 28px; +} diff --git a/website/static/media/img/scientific-mark.svg b/website/static/media/img/scientific-mark.svg new file mode 100644 index 0000000..d301307 --- /dev/null +++ b/website/static/media/img/scientific-mark.svg @@ -0,0 +1,154 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   + + + + + base-commit: 89dffa68995c39261b0bf30466a982c42294fd48 -- 2.31.1