[tor-commits] [tpo/master] Fix links in footer

hiro at torproject.org hiro at torproject.org
Wed Feb 20 13:27:55 UTC 2019


commit 34dc6570d71681a0acf993deb3d2755c3009c0a1
Author: hiro <hiro at torproject.org>
Date:   Wed Feb 20 14:27:49 2019 +0100

    Fix links in footer
---
 templates/contact.html          | 5 +++--
 templates/download-android.html | 6 ++++--
 templates/footer.html           | 8 +++++++-
 templates/macros/contact.html   | 3 +++
 templates/macros/downloads.html | 8 ++++++++
 5 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/templates/contact.html b/templates/contact.html
index d24eace..300d625 100644
--- a/templates/contact.html
+++ b/templates/contact.html
@@ -4,7 +4,8 @@
 <div class="container">
   <div class="row">
     <div class="col-md-8 py-3">
-            <h3 class="text-secondary display-5 mb-4"><i class="fas fa-table-tennis text-primary pr-2"></i> {{ _('Chat with us on <a href="https://webchat.oftc.net/" title="Tor Project IRC" target="_blank">OFTC IRC</a>')|safe }}</h3>
+      {% from "macros/contact.html" import render_oftc %}
+      <h3 class="text-secondary display-5 mb-4"><i class="fas fa-table-tennis text-primary pr-2"></i> {{ _('Chat with us on') }} {{ render_oftc() }}</h3>
       <p class="text-tpo"><span class="text-primary nick">#tor</span> - {{ _("Ask questions about using Tor.") }}</p>
       <p class="text-tpo"><span class="text-primary nick">#tor-dev</span> - {{ _("Discuss Tor-related coding, protocols, and ideas are all welcome.") }}</p>
       <p class="text-tpo"><span class="text-primary nick">#tor-project</span> - {{ _("Discuss organization and community related topics: meetups, outreach, translation, or website improvements.") }}</p>
@@ -92,7 +93,7 @@
   <div class="row">
     <div class="col-md-8 p-0 pr-5">
       <h3 class="text-primary display-5">{{ _('Email us') }}</h3>
-      <p class="text-tpo">{{ _('For questions and comments about Tor the non-profit organization: trademark questions, affiliation and coordination, contract inquiries, etc, please email') }}<a href="mailto:frontdesk at rt.torproject.org">frontdesk at rt.torproject.org</a>. {{ _('For donor-related questions, contact') }} <a href="mailto:giving at torproject.org">giving at torproject.org</a>.</p>
+      <p class="text-tpo">{{ _('For questions and comments about Tor the non-profit organization: trademark questions, affiliation and coordination, contract inquiries, etc, please email frontdesk at rt.torproject.org. For donor-related questions, contact giving at torproject.org') }}.</p>
     </div>
     <div class="d-block d-sm-none container py-3">
       <div class="row border-bottom border-light"><p></p></div>
diff --git a/templates/download-android.html b/templates/download-android.html
index 41433fb..9dce52f 100644
--- a/templates/download-android.html
+++ b/templates/download-android.html
@@ -17,10 +17,12 @@
       <div class="row my-5">
           <a class="btn btn-lg btn-light text-primary py-3 px-4 my-1 mx-auto" href="">{{ _('Download .apk') }}</a>
           <a class="btn btn-lg btn-light text-primary py-3 px-4 my-1 mx-auto" href="">{{ _('Go to Google Play') }}</a>
-          <a class="btn btn-lg btn-light text-primary py-3 px-4 my-1 mx-auto disabled" href="">{{ _('Go to F-droid <small class="badge-pill badge-dark mx-1 nick">S00N</small>')|safe }}</a>
+          {% from "macros/downloads.html" import render_fdroid %}
+          <a class="btn btn-lg btn-light text-primary py-3 px-4 my-1 mx-auto disabled" href="">{{ _('Go to F-droid %s')|format(render_fdroid())|safe }}</a>
       </div>
       <div class="row">
-        <p class="text-light mx-auto nick">{{ _('Are you a iOS user? We encourage you to try <a class="mx-auto" href=""><u>Onion Browser.</u></a>')|safe }}</p>
+        {% from "macros/downloads.html" import render_onion_browser %}
+        <p class="text-light mx-auto nick">{{ _('Are you a iOS user? We encourage you to try %s')|format(render_onion_browser())|safe }} </p>
       </div>
     </div>
     <div class="d-none d-lg-block col-lg-4">
diff --git a/templates/footer.html b/templates/footer.html
index 4aa7aa2..6fe4248 100644
--- a/templates/footer.html
+++ b/templates/footer.html
@@ -26,7 +26,13 @@
           {% set menubag = 'menu_footer+' + this.alt %}
           {% for id, item in bag(menubag).items() %}
           <li{% if this.is_child_of(item.path) %} class="nav-item active" {% else %} class="nav-item"{% endif %}>
-            <a class="nav-link text-light" href="{{ item.path }}">{{ item.label }}
+          {% set link = site.get(item.path) %}
+          {% if link %}
+            <a class="nav-link text-light" href="{{ item.path|url }}">
+          {% else %}
+            <a class="nav-link text-light" href="{{ item.path }}">
+          {% endif %}
+          {{ item.label }}
               {% if this.is_child_of(item.path) %}
               <span class="sr-only">(current)</span>
               {% endif %}
diff --git a/templates/macros/contact.html b/templates/macros/contact.html
new file mode 100644
index 0000000..9a91967
--- /dev/null
+++ b/templates/macros/contact.html
@@ -0,0 +1,3 @@
+{% macro render_oftc() %}
+  <a href="https://webchat.oftc.net/" title="Tor Project IRC" target="_blank">OFTC IRC</a>
+{% endmacro %}
diff --git a/templates/macros/downloads.html b/templates/macros/downloads.html
index 4694b40..70ff5bd 100644
--- a/templates/macros/downloads.html
+++ b/templates/macros/downloads.html
@@ -34,3 +34,11 @@
 
   <a class="downloadLink" href="{{ download_link_32 }}">32-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_fdroid() %}
+  <small class="badge-pill badge-dark mx-1 nick">S00N</small>
+{% endmacro %}
+
+{% macro render_onion_browser() %}
+  <a class="mx-auto" href=""><u>Onion Browser.</u></a>
+{% endmacro %}



More information about the tor-commits mailing list