[tor-commits] [lego/master] Fix navbar language dropdown when there are no alts

hiro at torproject.org hiro at torproject.org
Tue Jun 25 15:10:14 UTC 2019


commit 55784cf553a4dbac0ef1bb49e33be6d0b23c91f1
Author: hiro <hiro at torproject.org>
Date:   Tue Jun 25 17:10:10 2019 +0200

    Fix navbar language dropdown when there are no alts
---
 templates/navbar.html | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/templates/navbar.html b/templates/navbar.html
index 7514edc..0064779 100644
--- a/templates/navbar.html
+++ b/templates/navbar.html
@@ -37,25 +37,25 @@
   	{% endfor %}
         </ul>
       </div>
-      <div class="btn-group dropdown pull-right">
-        {% if this.color == 'primary' %}
-          <button type="button" class="btn btn-primary bg-primary dropdown-toggle btn-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-        {% else %}
-          <button type="button" class="btn btn-dark bg-dark dropdown-toggle btn-block my-3 my-sm-0" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-        {% endif %}
-        {{ bag('alternatives', this.alt, 'language') }}
-        </button>
-        <div class="dropdown-menu">
-          {% set alts = bag('alternatives').items() %}
-          {% if alts|length > 1 %}
+      {% set alts = bag('alternatives').items() %}
+      {% if alts|length > 1 %}
+        <div class="btn-group dropdown pull-right">
+          {% if this.color == 'primary' %}
+            <button type="button" class="btn btn-primary bg-primary dropdown-toggle btn-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+          {% else %}
+            <button type="button" class="btn btn-dark bg-dark dropdown-toggle btn-block my-3 my-sm-0" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+          {% endif %}
+          {{ bag('alternatives', this.alt, 'language') }}
+          </button>
+          <div class="dropdown-menu">
             {% for id, item in bag('alternatives').items() %}
               {% if this.alt != id %}
                 <a class="dropdown-item" href="{{ this.path|url(alt=id) }}">{{ item.language }}</a>
               {% endif %}
             {% endfor %}
-          {% endif %}
+          </div>
         </div>
-      </div>
+      {% endif %}
       {% set download = site.get('/download') %}
       <div class="pull-right">
         {% if download == None %}



More information about the tor-commits mailing list