[tor-commits] [lego/master] First step in localize donate button properly

hiro at torproject.org hiro at torproject.org
Mon Nov 25 16:31:29 UTC 2019


commit 6d90910337fbc0b383cbf5483aa61be9460e08d2
Author: hiro <hiro at torproject.org>
Date:   Mon Nov 25 17:31:19 2019 +0100

    First step in localize donate button properly
---
 templates/navbar.html | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/templates/navbar.html b/templates/navbar.html
index 0210587..e8800d9 100644
--- a/templates/navbar.html
+++ b/templates/navbar.html
@@ -14,7 +14,12 @@
       <span class="sr-only">Tor Logo</span>
     </a>
 
-    <a href="https://www.torproject.org/donate/{{ this.alt }}" title="{{ _("Donate") }}"><h4><span class="badge badge-warning p-2">{{ _("Donate Now") }}</span></h4></a>
+    {% set link = bag('links', this.alt, 'donate') %}
+    {% if link %}
+      <a href="link" title="{{ _("Donate") }}"><h4><span class="badge badge-warning p-2">{{ _("Donate Now") }}</span></h4></a>
+    {% else %}
+      <a href="https://www.torproject.org/donate/{{ this.alt }}" title="{{ _("Donate") }}"><h4><span class="badge badge-warning p-2">{{ _("Donate Now") }}</span></h4></a>
+    {% endif %}
 
     <label for="nav-toggle">
       <a class="btn btn-lg btn-primary navbar-toggler text-white p-3" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">



More information about the tor-commits mailing list