[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tpo/master] Replace databag with macro
commit 7d805317583586b4c2006c8972c4c235a1caebe5
Author: RotationMatrix <52428419+RotationMatrix@xxxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat Sep 7 08:15:45 2019 -0400
Replace databag with macro
Generate Android links with a macro instead of hard-coding in a databag.
---
databags/download-tb-for-android-alpha.ini | 14 --------------
templates/download-options.html | 28 +++++++++++++++++++++-------
templates/macros/downloads.html | 7 +++++++
3 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/databags/download-tb-for-android-alpha.ini b/databags/download-tb-for-android-alpha.ini
deleted file mode 100644
index 5006897..0000000
--- a/databags/download-tb-for-android-alpha.ini
+++ /dev/null
@@ -1,14 +0,0 @@
-[Google Play]
-url = https://play.google.com/store/apps/details?id=org.torproject.torbrowser_alpha
-
-[arch64]
-url = https://dip.torproject.org/web/tpo/master/tor-browser-9.0a6-android-aarch64-multi.apk
-sig = https://dip.torproject.org/web/tpo/master/tor-browser-9.0a6-android-aarch64-multi.apk.asc
-
-[arm]
-url = https://dip.torproject.org/web/tpo/master/tor-browser-9.0a6-android-armv7-multi.apk
-sig = https://dip.torproject.org/web/tpo/master/tor-browser-9.0a6-android-armv7-multi.apk.asc
-
-[x86]
-url = https://dip.torproject.org/web/tpo/master/tor-browser-9.0a6-android-x86-multi.apk
-sig = https://dip.torproject.org/web/tpo/master/tor-browser-9.0a6-android-x86-multi.apk.asc
diff --git a/templates/download-options.html b/templates/download-options.html
index c515669..e0edd8e 100644
--- a/templates/download-options.html
+++ b/templates/download-options.html
@@ -44,13 +44,27 @@
</tr>
</thead>
<tbody>
- {% for id, item in bag('download-tb-for-android-alpha').items() %}
- <tr>
- <td>
- <a href="{{ item.url }}">{{ id }}</a>{% if item.sig %} (<a href="{{ item.sig }}">sig</a>){% endif %}
- </td>
- </tr>
- {% endfor %}
+ <tr>
+ <td>
+ <a href="https://play.google.com/store/apps/details?id=org.torproject.torbrowser_alpha">Google Play</a>
+ </td>
+ </tr>
+ {% from "macros/downloads.html" import render_android %}
+ <tr>
+ <td>
+ {{ render_android(t.version, "aarch64") }}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ {{ render_android(t.version, "armv7") }}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ {{ render_android(t.version, "x86") }}
+ </td>
+ </tr>
</tbody>
</table>
</div>
diff --git a/templates/macros/downloads.html b/templates/macros/downloads.html
index d743245..7581aca 100644
--- a/templates/macros/downloads.html
+++ b/templates/macros/downloads.html
@@ -49,6 +49,13 @@
<a class="downloadLink" href="{{ download_link_32 }}">32-bit</a> (<a href="{{ sig_link_32 }}">sig</a>) / <a href="{{ download_link_64 }}">64-bit</a> (<a href="{{ sig_link_64 }}">sig<a/>)
{% endmacro %}
+{% macro render_android(version, arch) %}
+ {% set download_link = 'https://dist.torproject.org/torbrowser/' + version + '/' + 'tor-browser-' + version + '-android-' + arch + '-multi.apk' %}
+ {% set sig_link = download_link + '.asc' %}
+
+ <a href="{{ download_link }}">{{ arch }}</a> (<a href="{{ sig_link }}">sig</a>)
+{% endmacro %}
+
{% macro render_fdroid() %}
<small class="badge-pill badge-dark mx-1 nick">S00N</small>
{% endmacro %}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits