guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: website: download: simplify download options.


From: Luis Felipe López Acevedo
Subject: 01/01: website: download: simplify download options.
Date: Sun, 24 May 2015 15:26:50 +0000

felipelopez pushed a commit to branch master
in repository guix-artwork.

commit 25d386d8d227d249fe2e0cf46eca26106b62151d
Author: Felipe López <address@hidden>
Date:   Sun May 24 10:26:50 2015 -0500

    website: download: simplify download options.
---
 website/static/base/css/download.css |   45 ++++++++++++++-
 website/www/download.scm             |  102 +++++++++++++++++-----------------
 2 files changed, 94 insertions(+), 53 deletions(-)

diff --git a/website/static/base/css/download.css 
b/website/static/base/css/download.css
index fab1bc6..8477da6 100644
--- a/website/static/base/css/download.css
+++ b/website/static/base/css/download.css
@@ -1,9 +1,48 @@
 /*
     Public domain 2015 Luis Felipe López Acevedo. All rights waived.
     <address@hidden>
-   
-    NOTE  The default style is targeted at screens with a width less than
-          1024 pixels.
 */
 
 @import url("article.css");
+
+
+.download-box {
+    border-color: #CCC;
+    border-style: none none solid none;
+    border-width: thin;
+    color: #4D4D4D;
+    font-size: 0.9em;
+    padding: 10px;
+    text-align: center;
+}
+
+.hlink-download, .hlink-download:link, .hlink-download:visited {
+    background-color: #E6E6E6;
+    border-style: none;
+    border-radius: 5px;
+    color: black;
+    display: inline-block;
+    font-weight: bold;
+    margin: 5px;
+    padding: 5px 10px;
+}
+
+.hlink-download:active, .hlink-download:focus, .hlink-download:hover {
+    background-color: #F4BB15;
+}
+
+.hlink-signature {
+    display: inline-block;
+    margin: 0px 5px;
+}
+
+
address@hidden screen and (min-width: 800px) {
+    .download-box {
+        border-style: solid;
+        display: inline-block;
+        margin: 10px;
+        vertical-align: top;
+        width: 270px;
+    }
+}
diff --git a/website/www/download.scm b/website/www/download.scm
index 07d03cf..f9f0d45 100644
--- a/website/www/download.scm
+++ b/website/www/download.scm
@@ -31,25 +31,42 @@ dependencies.")
 (define (ftp-url file)
   (string-append "ftp://alpha.gnu.org/gnu/guix/"; file))
 
-(define* (summary-box title
-                      #:key file description image manual)
-  `(div (@ (class "summary-box"))
-        (div (@ (class "text-center"))
-             (img (@ (src ,(image-url image))
-                     (alt ""))))
+(define (guixsd-files archs)
+  (map (lambda (arch)
+         (cons arch (ftp-url (string-append "guixsd-usb-install-"
+                                            (latest-guix-version) "." arch
+                                            "-linux.xz"))))
+       archs))
+
+(define (guix-files archs)
+  (map (lambda (arch)
+         (cons arch (ftp-url (string-append "guix-binary-" 
(latest-guix-version)
+                                            "." arch "-linux.tar.xz"))))
+       archs))
+
+(define (guix-source-files variants)
+  (map (lambda (variant)
+         (cons variant (ftp-url (string-append "guix-" (latest-guix-version)
+                                               ".tar.gz"))))
+       variants))
+
+(define* (download-box title
+                       #:key files description image manual)
+  `(div (@ (class "download-box"))
+        (img (@ (src ,(image-url image)) (alt "")))
         (h2 ,title)
         (p ,description)
-
-        (p (@ (class "text-center"))
-           (a (@ (href ,(ftp-url file))
-                 (class "hlink-yellow-boxed"))
-              "DOWNLOAD")
-           (br)
-           ;; FIXME: Size?
-           ;; "(140MB approx.)"
-           (br)
-           (a (@ (href ,(string-append (ftp-url file) ".sig")))
-              "Get signature"))
+        (p "Download options:")
+        ,(map (lambda (file)
+                `(a (@ (href ,(cdr file)) (class "hlink-download"))
+                   ,file))
+              files)
+        (p "Signatures: "
+           ,(map (lambda (file)
+                   `(a (@ (href ,(string-append (cdr file) ".sig"))
+                          (class "hlink-signature"))
+                      ,(string-append (car file))))
+             files))
         (p "See the "
            (a (@ (href ,(guix-url manual)))
               "installation instructions")
@@ -78,39 +95,24 @@ can be installed as an additional package manager on top of 
an installed
 Linux-based system.")
 
                (div (@ (class "text-center"))
-                     ,@(map (lambda (arch)
-                              (summary-box (string-append "GuixSD "
-                                                          (latest-guix-version)
-                                                          " (" arch ")")
-                                           #:file (string-append
-                                                   "guixsd-usb-install-"
-                                                   (latest-guix-version)
-                                                   "." arch "-linux.xz")
-                                           #:description %usb-image-description
-                                           #:manual %usb-image-manual
-                                           #:image %guixsd-image))
-                            '("x86_64" "i686"))
-                     ,@(map (lambda (arch)
-                              (summary-box (string-append "GNU Guix "
-                                                          (latest-guix-version)
-                                                          " Binary (" arch ")")
-                                           #:file (string-append
-                                                   "guix-binary-"
-                                                   (latest-guix-version)
-                                                   "." arch "-linux.tar.xz")
-                                           #:description 
%binary-tarball-description
-                                           #:manual %binary-tarball-manual
-                                           #:image %guix-image))
-                            '("x86_64" "i686" "mips64el" "armhf"))
-                     ,(summary-box (string-append "GNU Guix "
-                                                  (latest-guix-version)
-                                                  " Source")
-                                   #:file (string-append "guix-"
-                                                         (latest-guix-version)
-                                                         ".tar.gz")
-                                   #:description %source-tarball-description
-                                   #:manual %source-tarball-manual
-                                   #:image %guix-image))
+             ,(download-box (string-append "GuixSD " (latest-guix-version))
+                            #:files (guixsd-files '("x86_64" "i686"))
+                            #:description %usb-image-description
+                            #:manual %usb-image-manual
+                            #:image %guixsd-image)
+             ,(download-box (string-append "GNU Guix " (latest-guix-version)
+                                           " Binary")
+                            #:files (guix-files '("x86_64" "i686" "mips64el"
+                                                  "armhf"))
+                            #:description %binary-tarball-description
+                            #:manual %binary-tarball-manual
+                            #:image %guix-image)
+             ,(download-box (string-append "GNU Guix " (latest-guix-version)
+                                           " Source")
+                            #:files (guix-source-files '("tarball"))
+                            #:description %source-tarball-description
+                            #:manual %source-tarball-manual
+                            #:image %guix-image))
 
                (p "Source code for the Guix System Distribution USB
 installation images as well as GNU Guix can be found on the GNU ftp server for 
"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]