[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tpo/develop] Add language selector on top for download page
commit 2800e53b384a873a76cb6cf2c898fd6a26f5fee1
Author: hiro <hiro@xxxxxxxxxxxxxx>
Date: Mon Feb 24 13:48:44 2020 +0100
Add language selector on top for download page
---
lego | 2 +-
templates/navbar-min.html | 49 ++++++++++++++++++++++++++++++++++-------------
2 files changed, 37 insertions(+), 14 deletions(-)
diff --git a/lego b/lego
index e9dd0810..fb083d69 160000
--- a/lego
+++ b/lego
@@ -1 +1 @@
-Subproject commit e9dd081027132aa21f6abd74be708323ff3b9180
+Subproject commit fb083d69aa0191f891d1e3243db89e474a1c8c0d
diff --git a/templates/navbar-min.html b/templates/navbar-min.html
index 3eb4ba16..51e0bc3b 100644
--- a/templates/navbar-min.html
+++ b/templates/navbar-min.html
@@ -6,21 +6,44 @@
<nav class="navbar no-background navbar-expand-lg navbar-dark bg-primary p-2">
{% else %}
<div class="container-fluid bg-dark">
- <nav class="navbar no-background navbar-expand-lg navbar-dark bg-dark p-2">
+ <nav class="navbar no-background navbar-expand-lg navbar-dark bg-dark p-2 d-flex justify-content-between">
{% endif %}
+ <div>
+ <div class="row">
+ <a class="navbar-brand" href="{{ '/'|url(alt=this.alt) }}">
+ <img alt="{{ 'The Tor Project' }}" src="{{ '/static/images/tor-logo@xxxxxx'|asseturl }}" >
+ <span class="sr-only">Tor Logo</span>
+ </a>
- <a class="navbar-brand" href="{{ '/'|url(alt=this.alt) }}">
- <img alt="{{ 'The Tor Project' }}" src="{{ '/static/images/tor-logo@xxxxxx'|asseturl }}" >
- <span class="sr-only">Tor Logo</span>
- </a>
-
- {% set link = bag('links', this.alt, 'donate') %}
- {% if link %}
- <h4 class="pl-2 pr-2"><a href="{{ link }}" title="{{ _("Donate") }}"><span class="badge badge-warning p-2">{{ _("Donate Now") }}</span></a></h4>
- {% else %}
- <h4 class="pl-2 pr-2"><a href="https://www.torproject.org/donate/{{ this.alt }}" title="{{ _("Donate") }}"><span class="badge badge-warning p-2">{{ _("Donate Now") }}</span></a></h4>
- {% endif %}
-
+ {% set link = bag('links', this.alt, 'donate') %}
+ {% if link %}
+ <h4 class="pl-2 pr-2 pt-3"><a href="{{ link }}" title="{{ _("Donate") }}"><span class="badge badge-warning p-2">{{ _("Donate Now") }}</span></a></h4>
+ {% else %}
+ <h4 class="pl-2 pr-2 pt-3"><a href="https://www.torproject.org/donate/{{ this.alt }}" title="{{ _("Donate") }}"><span class="badge badge-warning p-2">{{ _("Donate Now") }}</span></a></h4>
+ {% endif %}
</div>
+ </div>
+ {% set alts = bag('alternatives').items() %}
+ {% if alts|length > 1 %}
+ <div class="btn-group dropdown float-right">
+ {% if not this.color %}
+ <button type="button" class="btn btn-primary bg-primary dropdown-toggle btn-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ {% elif 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 %}
+ </div>
+ </div>
+ {% endif %}
+
</nav>
</div>
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits