From 110e86871e9cbf3c1421f94f1d787f0ab11e43de Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 26 Mar 2014 17:22:49 +0100 Subject: [PATCH] Improve design of the download page. --- static/css/style.css | 11 +- templates/download-splash.html | 74 ++++++------ templates/downloads-index.html | 2 +- templates/modules/release-item.html | 177 +++++++++++----------------- webapp/ui_modules.py | 24 ++-- 5 files changed, 126 insertions(+), 162 deletions(-) diff --git a/static/css/style.css b/static/css/style.css index bd51445..f2463b1 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -2,14 +2,15 @@ body { padding-top: 45px; } -.navbar-inverse .navbar-brand, -.navbar-inverse .navbar-nav > li > a { - color:#DDD; +.navbar-inverse .navbar-brand, .navbar-inverse .navbar-nav > li > a { + color: white; } + .sidenav > li.active > a { - background: #880400; - color: #FFF; + background: #880400; + color: white; } + .container-body { background-color: #FFF; padding: 10px 15px; diff --git a/templates/download-splash.html b/templates/download-splash.html index 0fa2760..9b5eaef 100644 --- a/templates/download-splash.html +++ b/templates/download-splash.html @@ -2,45 +2,19 @@ {% block title %}{{ _("Thanks for downloading IPFire!") }}{% end block %} -{% block body %} -
-

{{ _("Thanks for downloading IPFire!") }}

- - {% if lang == "de" %} -

- Wir möchten jeden, der IPFire herunterlädt einladen, - sich in das Projekt einzubringen, zum Beispiel mit - einer Spende. -

-

- Daher bitten wir um ein paar Euro für das Projekt - oder das - Projekt auf eine andere Weise zu unterstützen. -

- {% else %} -

- We encourage everyone who downloads and uses IPFire to - get involved for example by - donating - a small amount of money. -

-

- Please consider donating a few bucks to the project. - If you can't - afford to donate, there are other ways you can help. -

- {% end %} -
-
- - {{ _("Donate") }} - +{% block header %} +
+
+

{{ _("Thanks for downloading IPFire!") }}

-
+ +{% end header %} + +{% block body %}
-
+

{% if lang == "de" %} Der Download beginnt in Kürze. @@ -56,7 +30,35 @@

- {% module Advertisement("download-splash") %} + {% if lang == "de" %} +

+ Wir möchten jeden, der IPFire herunterlädt einladen, + sich in das Projekt einzubringen, zum Beispiel mit + einer Spende. + Daher bitten wir um ein paar Euro für das Projekt + oder das + Projekt auf eine andere Weise zu unterstützen. +

+ {% else %} +

+ We encourage everyone who downloads and uses IPFire to + get involved for example by + donating + a small amount of money. + Please consider donating a few bucks to the project. + If you can't + afford to donate, there are other ways you can help. +

+ {% end %} + + + +

{{ _("Next steps") }}

diff --git a/templates/downloads-index.html b/templates/downloads-index.html index c643ec7..c93851c 100644 --- a/templates/downloads-index.html +++ b/templates/downloads-index.html @@ -47,7 +47,7 @@ {% if release.stable %} {{ _("Stable") }} {% else %} - {{ _("Development") }} + {{ _("Development") }} {% end %} {{ locale.format_date(release.date, shorter=True) }} diff --git a/templates/modules/release-item.html b/templates/modules/release-item.html index 4be7c27..6aa0d4d 100644 --- a/templates/modules/release-item.html +++ b/templates/modules/release-item.html @@ -1,123 +1,80 @@ -

- {% if latest %}{{ _("Latest release") }}:{% end %} - {{ escape(release.name) }} -

+ {% if release.files %} -
- - -
-
- {% if lang == "de" %} -

- Bitte klicke auf den Button, um IPFire für - i586-kompatible Computer als ISO-Installationsimage - herunterzuladen. - Dies ist das am häufigsten benötigte Medium. - In der Tableiste finden sich alternative Architekturen - und Imageformate zum Download. -

- {% else %} -

- Please click the button to download the IPFire - ISO image for i586-compatible computers. - This is the default image, you will most likely - need to install IPFire. - You may also pick your desired architecture from - the tabs above and see a list of all image - formats. -

- {% end %} + {% if not release.stable %} +
+

{{ _("Caution!") }}

-
- -
- {% module DownloadButton(release) %} -
+ {% if lang == "de" %} + Dieses Release ist nicht als stabile Version + von IPFire freigegeben und nur für Testumgebungen gedacht. + Daher sollte dieses Release nicht in produktiven + Umgebungen eingesetzt werden und Fehler berichtet werden. + {% else %} + This release is not a stable version of IPFire and + intended for testing purposes only. + Do not use this release in production and please + report any bugs. + {% end %} +
+ {% end %} - {% if not release.stable %} -
+
+ {% module DownloadButton(release) %} +
-
-
-
- {{ _("Caution!") }} +
- {% if lang == "de" %} - Dieses Release ist nicht als stabile Version - von IPFire freigegeben und nur für Testumgebungen gedacht. - Daher sollte dieses Release nicht in produktiven - Umgebungen eingesetzt werden und Fehler berichtet werden. - {% else %} - This release is not a stable version of IPFire and - intended for testing purposes only. - Do not use this release in production and please - report any bugs. - {% end %} -
-
-
- {% end %} -
+ {% for arch, files in downloads %} +

{{ arch }}

- {% for arch in files.keys() %} -
- - - - - - - - - {% for file in files[arch] %} - - + + + {% end %} + +
{{ _("Image type") }}{{ _("Size") }}
- {% if file.torrent_hash %} -

- - - - - - -

- {% end %} - {{ _(file.desc) }} -
{{ _(file.rem) }} + + + + + + + + + {% for file in files %} + + - - + {% if file.sha1 %} +

{{ _("SHA1 checksum") }}: {{ file.sha1 }} {% end %} - -
{{ _("Image type") }}{{ _("Size") }}
+ {% if file.torrent_hash %} +

+ + + + + + +

+ {% end %} + {{ _(file.desc) }} +
{{ _(file.rem) }} - {% if file.sha1 %} -

{{ _("SHA1 checksum") }}: {{ file.sha1 }} - {% end %} -
- {{ format_size(file.size) }} -
+
+ {{ format_size(file.size) }} +
+ {% end %} -

- {{ _("Legend:") }} - {{ _("Magnet link") }}, - {{ _("Torrent download") }} -

-
- {% end %} -
-
+

+ {{ _("Legend:") }} + {{ _("Magnet link") }}, + {{ _("Torrent download") }} +

{% else %}
{{ _("There are no downloads available for this release.") }} diff --git a/webapp/ui_modules.py b/webapp/ui_modules.py index 41d681d..3cf68d8 100644 --- a/webapp/ui_modules.py +++ b/webapp/ui_modules.py @@ -161,19 +161,23 @@ class SidebarReleaseModule(UIModule): class ReleaseItemModule(UIModule): def render(self, release, latest=False): - files = { - "i586" : [], - "arm" : [], - } + arches = ("i586", "arm") - for file in release.files: - try: - files[file.arch].append(file) - except KeyError: - pass + downloads = [] + for arch in ("i586", "arm"): + files = [] + + for file in release.files: + if not file.arch == arch: + continue + + files.append(file) + + if files: + downloads.append((arch, files)) return self.render_string("modules/release-item.html", - release=release, latest=latest, files=files) + release=release, latest=latest, downloads=downloads) class SidebarBannerModule(UIModule): -- 2.39.2