[tor-commits] [donate-static/master] Change header add color remove full navbar

hiro at torproject.org hiro at torproject.org
Mon Oct 19 18:31:27 UTC 2020


commit 987d3c6f4ed0e3aaac13ae8a56754735303ecf79
Author: hiro <hiro at torproject.org>
Date:   Mon Oct 19 20:22:55 2020 +0200

    Change header add color remove full navbar
---
 content/contents.lr       |  4 +++-
 lego                      |  2 +-
 models/donate-form.ini    |  4 ++++
 templates/meta.html       |  6 +-----
 templates/navbar-min.html | 49 +++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 58 insertions(+), 7 deletions(-)

diff --git a/content/contents.lr b/content/contents.lr
index 4e429406..f4cc42db 100644
--- a/content/contents.lr
+++ b/content/contents.lr
@@ -84,7 +84,9 @@ tshirt_perk_monthly_label: T-Shirt
 ---
 tshirt_perk_monthly_image: /static/images/donate/t-shirt-take-back-internet.png
 ---
-header_image: /static/css/images/home/png/use-tor.png
+header_image: /static/css/images/donate-banner.png
+---
+header_color: black
 ---
 success_redirect_url:
 ---
diff --git a/lego b/lego
index 96b2d951..a1bf61f3 160000
--- a/lego
+++ b/lego
@@ -1 +1 @@
-Subproject commit 96b2d9518869f95e3dbcc9c9af1f05c5d7f769b4
+Subproject commit a1bf61f36ccf730df140f684e3ea6970b6d6a9d8
diff --git a/models/donate-form.ini b/models/donate-form.ini
index 943f775d..db053c7a 100644
--- a/models/donate-form.ini
+++ b/models/donate-form.ini
@@ -40,6 +40,10 @@ type = markdown
 label = Header Image (centered)
 type = string
 
+[fields.header_color]
+label = Header Color
+type = string
+
 [fields.success_redirect_url]
 label = URL to redirect to after donation completed successfully
 type = url
diff --git a/templates/meta.html b/templates/meta.html
index 9e9c26b0..17a9652f 100644
--- a/templates/meta.html
+++ b/templates/meta.html
@@ -20,9 +20,5 @@
 <title>{{ _("Tor Project") }} | {% block title %}{{ this.title }}{% endblock %}</title>
 <body class="no-gutters">
   <header>
-    {% if this.path == '/download' %}
-      {% include 'navbar-min.html' %}
-    {% else %}
-      {% include 'navbar.html' %}
-    {% endif %}
+    {% include 'navbar-min.html' %}
   </header>
diff --git a/templates/navbar-min.html b/templates/navbar-min.html
new file mode 100644
index 00000000..51e0bc3b
--- /dev/null
+++ b/templates/navbar-min.html
@@ -0,0 +1,49 @@
+{% if not this.color %}
+<div class="container-fluid bg-primary">
+  <nav class="navbar no-background navbar-expand-lg navbar-dark bg-primary p-2">
+{% elif this.color == 'primary' %}
+<div class="container-fluid bg-primary">
+  <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 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 at 2x.png'|asseturl }}" >
+        <span class="sr-only">Tor Logo</span>
+      </a>
+
+      {% 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>





More information about the tor-commits mailing list