[tor-commits] [tpo/master] Add download-languages and download-options pages

hiro at torproject.org hiro at torproject.org
Thu Jan 24 18:07:47 UTC 2019


commit d2feed9deb2c77d43ce8150f05479506e2c3e60b
Author: hiro <hiro at torproject.org>
Date:   Thu Jan 24 19:04:29 2019 +0100

    Add download-languages and download-options pages
---
 content/download/languages/contents.lr | 11 ++++++++++
 content/download/options/contents.lr   | 11 ++++++++++
 templates/download-languages.html      | 39 ++++++++++++++++++++++++++++++++++
 templates/download-options.html        | 39 ++++++++++++++++++++++++++++++++++
 templates/header.html                  |  4 ++--
 templates/hero-download-languages.html |  6 ++++++
 templates/hero-download-options.html   |  6 ++++++
 templates/hero-download.html           | 20 ++++++++++++++---
 templates/macros/downloads.html        | 36 +++++++++++++++++++++++++++++++
 9 files changed, 167 insertions(+), 5 deletions(-)

diff --git a/content/download/languages/contents.lr b/content/download/languages/contents.lr
new file mode 100644
index 0000000..64f6e8c
--- /dev/null
+++ b/content/download/languages/contents.lr
@@ -0,0 +1,11 @@
+_template: jumbotron.html
+---
+section: download
+---
+html: download-languages.html
+---
+color: dark
+---
+title: Download Tor Browser in your language
+---
+body:
diff --git a/content/download/options/contents.lr b/content/download/options/contents.lr
new file mode 100644
index 0000000..6f6ecf9
--- /dev/null
+++ b/content/download/options/contents.lr
@@ -0,0 +1,11 @@
+_template: jumbotron.html
+---
+section: download
+---
+html: download-options.html
+---
+color: dark
+---
+title: Download Tor Browser Alpha
+---
+body:
diff --git a/templates/download-languages.html b/templates/download-languages.html
new file mode 100644
index 0000000..71d39c2
--- /dev/null
+++ b/templates/download-languages.html
@@ -0,0 +1,39 @@
+<div class="container py-3">
+  <div class="row">
+    <p>We need copy here. Tor Browser is made in large part by volunteers around the world. That’s why we offer it in 90 languages (and why there’s heart and soul in every.)</p>
+  </div>
+</div>
+<div class="container py-3">
+  <div class="row">
+    <table class="table">
+      <thead>
+        <tr>
+          <th scope="col">Language</th>
+          <th scope="col">Windows</th>
+          <th scope="col">MacOS</th>
+          <th scope="col">GNU/Linux</th>
+        </tr>
+      </thead>
+      <tbody>
+        {% set t = bag('versions', 'torbrowser-stable') %}
+        {% for id, item in bag('alternatives').items() %}
+          <tr>
+            <td>{{ item.language }}</td>
+            <td>
+              {% from "macros/downloads.html" import render_windows %}
+              {{ render_windows(t.version, id) }}
+            </td>
+            <td>
+              {% from "macros/downloads.html" import render_mac %}
+              {{ render_mac(t.version, id) }}
+            </td>
+            <td>
+              {% from "macros/downloads.html" import render_linux %}
+              {{ render_linux(t.version, id) }}
+            </td>
+          </tr>
+        {% endfor %}
+      </tbody>
+    </table>
+  </div>
+</div>
diff --git a/templates/download-options.html b/templates/download-options.html
new file mode 100644
index 0000000..353a4c6
--- /dev/null
+++ b/templates/download-options.html
@@ -0,0 +1,39 @@
+<div class="container py-3">
+  <div class="row">
+    <p>We need two lines here about why we release alphas, how it works in the development cycle and also a link to repos or documentation.</p>
+  </div>
+</div>
+<div class="container py-3">
+  <div class="row">
+    <table class="table">
+      <thead>
+        <tr>
+          <th scope="col">Language</th>
+          <th scope="col">Windows</th>
+          <th scope="col">MacOS</th>
+          <th scope="col">GNU/Linux</th>
+        </tr>
+      </thead>
+      <tbody>
+        {% set t = bag('versions', 'torbrowser-alpha') %}
+        {% for id, item in bag('alternatives').items() %}
+          <tr>
+            <td>{{ item.language }}</td>
+            <td>
+              {% from "macros/downloads.html" import render_windows %}
+              {{ render_windows(t.version, id) }}
+            </td>
+            <td>
+              {% from "macros/downloads.html" import render_mac %}
+              {{ render_mac(t.version, id) }}
+            </td>
+            <td>
+              {% from "macros/downloads.html" import render_linux %}
+              {{ render_linux(t.version, id) }}
+            </td>
+          </tr>
+        {% endfor %}
+      </tbody>
+    </table>
+  </div>
+</div>
diff --git a/templates/header.html b/templates/header.html
index fa3b6e7..40f3faa 100644
--- a/templates/header.html
+++ b/templates/header.html
@@ -12,10 +12,10 @@
       <div class="row">
         <div class="col-12 content-center pt-5">
           <div class="row">
-            <h6 class="mx-auto text-white text-uppercase">{% block section %}{{ this.section }}{% endblock %}</h1>
+            <h6 class="mx-auto text-white text-uppercase">{% block section %}{{ this.section }}{% endblock %}</h6>
           </div>
           <div class="row pb-5">
-            <h2 class="mx-auto display-3 text-white text-capitalize">{% block title %}{{ this.title }}{% endblock %}</h1>
+            <h2 class="mx-auto display-3 text-white text-capitalize">{% block title %}{{ this.title }}{% endblock %}</h2>
           </div>
         </div>
       </div>
diff --git a/templates/hero-download-languages.html b/templates/hero-download-languages.html
new file mode 100644
index 0000000..a29408e
--- /dev/null
+++ b/templates/hero-download-languages.html
@@ -0,0 +1,6 @@
+<div class="row">
+  <h6 class="mx-auto text-white text-uppercase">{% block section %}Defend yourself{% endblock %}</h6>
+</div>
+<div class="row p-5">
+  <h2 class="mx-auto display-3 text-white text-capitalize">{% block title %}{{ this.title }}{% endblock %}</h2>
+</div>
diff --git a/templates/hero-download-options.html b/templates/hero-download-options.html
new file mode 100644
index 0000000..a29408e
--- /dev/null
+++ b/templates/hero-download-options.html
@@ -0,0 +1,6 @@
+<div class="row">
+  <h6 class="mx-auto text-white text-uppercase">{% block section %}Defend yourself{% endblock %}</h6>
+</div>
+<div class="row p-5">
+  <h2 class="mx-auto display-3 text-white text-capitalize">{% block title %}{{ this.title }}{% endblock %}</h2>
+</div>
diff --git a/templates/hero-download.html b/templates/hero-download.html
index cd19a35..442f416 100644
--- a/templates/hero-download.html
+++ b/templates/hero-download.html
@@ -9,7 +9,21 @@
     <div class="col-3">
       <div class="oval-2 bg-darker justify-content-center">
         {% set distro = 'static/images/' + id + '-logo/png/Shape.png' %}
-        <a href="{{ item.path|url }}">
+        {% set t = bag('versions', 'torbrowser-stable') %}
+        {% set download_prefix = 'https://www.torproject.org/dist/torbrowser/' + t.version + '/' %}
+        {% if alt == 'en' %}
+          {% set alt = 'en-US' %}
+        {% endif %}
+        {% if id == 'linux' %}
+          {% set download_link = download_prefix + 'tor-browser-linux64-' + t.version + '_' + alt + '.tar.xz' %}
+        {% elif id == 'windows' %}
+          {% set download_link = download_prefix + 'torbrowser-install-win64-' + t.version + '_' + alt + '.exe' %}
+        {% elif id == 'apple' %}
+          {% set download_link = download_prefix + 'TorBrowser-' + t.version + '-osx64' + '_' + alt + '.dmg' %}
+        {% else %}
+          {% set download_link = '#android' %}
+        {% endif %}
+        <a href="{{ download_link }}">
           <img class="shape" src="{{ distro|asseturl }}">
         </a>
       </div>
@@ -17,8 +31,8 @@
   {% endfor %}
 </div>
 <div class="row">
-  <a class="mx-auto text-white p-5" href=""><u>Download in another language</u></a>
-  <a class="mx-auto text-white p-5" href=""><u>Advanced Install Options</u></a>
+  <a class="mx-auto text-white p-5" href="{{ 'languages'|url }}"><u>Download in another language</u></a>
+  <a class="mx-auto text-white p-5" href="{{ 'options'|url }}"><u>Advanced Install Options</u></a>
 </div>
 <div class="row p-5 justify-content-center window-bg">
   <a class="mx-auto text-white p-5" href=""><u>Read the latest release announcements</u></a>
diff --git a/templates/macros/downloads.html b/templates/macros/downloads.html
new file mode 100644
index 0000000..c355523
--- /dev/null
+++ b/templates/macros/downloads.html
@@ -0,0 +1,36 @@
+{% macro render_windows(version, alt) %}
+  {% set download_prefix = 'https://www.torproject.org/dist/torbrowser/' + version + '/' %}
+  {% if alt == 'en' %}
+    {% set alt = 'en-US' %}
+  {% endif %}
+  {% set download_link_64 = download_prefix + 'torbrowser-install-win64-' + version + '_' + alt + '.exe' %}
+  {% set download_link_32 = download_prefix + 'torbrowser-install-' + version + '_' + alt + '.exe' %}
+  {% set sig_link_64 = download_link_64 + '.asc' %}
+  {% set sig_link_32 = download_link_32 + '.asc' %}
+
+  <a href="{{ download_link_32 }}">32/64-bit</a> (<a href="{{ sig_link_32 }}">sig</a>) / <a href="{{ download_link_32 }}">64-bit</a> (<a href="{{ sig_link_64 }}">sig<a/>)
+{% endmacro %}
+
+{% macro render_mac(version, alt) %}
+  {% set download_prefix = 'https://www.torproject.org/dist/torbrowser/' + version + '/' %}
+  {% if alt == 'en' %}
+    {% set alt = 'en-US' %}
+  {% endif %}
+  {% set download_link = download_prefix + 'TorBrowser-' + version + '-osx64' + '_' + alt + '.dmg' %}
+  {% set sig_link = download_link + '.asc' %}
+
+  <a href="{{ download_link }}">64-bit</a> (<a href="{{ sig_link }}">sig</a>)
+{% endmacro %}
+
+{% macro render_linux(version, alt) %}
+  {% set download_prefix = 'https://www.torproject.org/dist/torbrowser/' + version + '/' %}
+  {% if alt == 'en' %}
+    {% set alt = 'en-US' %}
+  {% endif %}
+  {% set download_link_64 = download_prefix + 'tor-browser-linux64-' + version + '_' + alt + '.tar.xz' %}
+  {% set download_link_32 = download_prefix + 'tor-browser-linux32-' + version + '_' + alt + '.tar.xz' %}
+  {% set sig_link_64 = download_link_64 + '.asc' %}
+  {% set sig_link_32 = download_link_32 + '.asc' %}
+
+  <a href="{{ download_link_32 }}">32/64-bit</a> (<a href="{{ sig_link_32 }}">sig</a>) / <a href="{{ download_link_32 }}">64-bit</a> (<a href="{{ sig_link_64 }}">sig<a/>)
+{% endmacro %}



More information about the tor-commits mailing list