[tor-commits] [lego/master] Localize donate button everywhere

hiro at torproject.org hiro at torproject.org
Mon Nov 25 16:55:57 UTC 2019


commit ae416478e7bd9df03e7f14fc1ee97000d2261fdb
Author: hiro <hiro at torproject.org>
Date:   Mon Nov 25 17:52:27 2019 +0100

    Localize donate button everywhere
---
 templates/banner.html | 7 ++++++-
 templates/footer.html | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/templates/banner.html b/templates/banner.html
index 3d2647c..37d49be 100644
--- a/templates/banner.html
+++ b/templates/banner.html
@@ -15,7 +15,12 @@
           </h2>
         </div>
         <div class="row">
-          <a class="btn-lg rectangle mb-3 mr-3" href="https://torproject.org/donate/donate-tbi-hp1">{{ _('DONATE NOW') }}</a>
+          {% set link = bag('links', this.alt, 'donate') %}
+          {% if link %}
+            <a class="btn-lg rectangle mb-3 mr-3" href="{{ link }}">{{ _('DONATE NOW') }}</a>
+          {% else %}
+            <a class="btn-lg rectangle mb-3 mr-3" href="https://torproject.org/donate/donate-tbi-hp1">{{ _('DONATE NOW') }}</a>
+          {% endif %}
           <p class="give-today-and-mozi">{{ _('Give today, and Mozilla will match your donation.') }}</p>
         </div>
       </div>
diff --git a/templates/footer.html b/templates/footer.html
index 897e736..246c133 100644
--- a/templates/footer.html
+++ b/templates/footer.html
@@ -46,7 +46,12 @@
           </li>
           {% endfor %}
         </ul>
-        <a href="https://www.torproject.org/donate/{{ this.alt }}" title="{{ _("Donate") }}"><h5><span class="badge badge-warning p-2 mt-2">{{ _("Donate Now") }}</span></h5></a>
+        {% set link = bag('links', this.alt, 'donate') %}
+        {% if link %}
+          <a href="{{ link }}" title="{{ _("Donate") }}"><h5><span class="badge badge-warning p-2 mt-2">{{ _("Donate Now") }}</span></h5></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 %}
       </div>
     </div>
     <div class="col-12 d-flex justify-content-center border">



More information about the tor-commits mailing list