[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/develop] Add explanation text for using bridges with TBB.



commit 72fd54d4ab66008fe4bb1980f82bf921832a7a15
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Fri Apr 11 12:14:34 2014 +0000

    Add explanation text for using bridges with TBB.
    
      * REMOVES all mention of Vidalia.
      * FIXES #10803
---
 lib/bridgedb/HTTPServer.py          |   26 +++++++++++++++++++
 lib/bridgedb/templates/bridges.html |    2 +-
 lib/bridgedb/templates/howto.html   |   47 +++++++++++++++++++++++++++++++++++
 lib/bridgedb/templates/index.html   |   14 ++++++-----
 4 files changed, 82 insertions(+), 7 deletions(-)

diff --git a/lib/bridgedb/HTTPServer.py b/lib/bridgedb/HTTPServer.py
index 7a127d9..5e3ba37 100644
--- a/lib/bridgedb/HTTPServer.py
+++ b/lib/bridgedb/HTTPServer.py
@@ -553,6 +553,31 @@ class WebResourceOptions(resource.Resource):
     render_POST = render_GET
 
 
+class WebResourceHowto(resource.Resource):
+    """A resource which explains how to use bridges."""
+
+    isLeaf = True
+
+    def __init__(self):
+        """Create a new WebResource for the Options page"""
+        gettext.install("bridgedb", unicode=True)
+        resource.Resource.__init__(self)
+
+    def render_GET(self, request):
+        rtl = False
+        langs = translations.getLocaleFromHTTPRequest(request)
+
+        try:
+            rtl = translations.usingRTLLang(langs)
+        except Exception as err:  # pragma: no cover
+            logging.exception(err)
+
+        request.setHeader("Content-Type", "text/html; charset=utf-8")
+        return lookup.get_template('howto.html').render(rtl=rtl)
+
+    render_POST = render_GET
+
+
 class WebResourceBridges(resource.Resource):
     """This resource displays bridge lines in response to a request."""
 
@@ -801,6 +826,7 @@ def addWebServer(cfg, dist, sched):
     httpdist.putChild('assets',
                       static.File(os.path.join(template_root, 'assets/')))
     httpdist.putChild('options', WebResourceOptions())
+    httpdist.putChild('howto', WebResourceHowto())
 
     bridgesResource = WebResourceBridges(
         dist, sched, cfg.HTTPS_N_BRIDGES_PER_ANSWER,
diff --git a/lib/bridgedb/templates/bridges.html b/lib/bridgedb/templates/bridges.html
index 4c57c91..f8e5a0e 100644
--- a/lib/bridgedb/templates/bridges.html
+++ b/lib/bridgedb/templates/bridges.html
@@ -32,7 +32,7 @@ ${answer}
 
     <div class="container-fluid" id="howto" style="align-content: left;">
       <p>
-${_("""To use the above lines, follow the instructions on the""" \
+${_("""To enter bridges into %s, follow the instructions on the""" \
     """ %s %s download page %s to start %s.""") % \
    ("""Tor Browser""",
     """<a href="https://www.torproject.org/projects/torbrowser.html.en#downloads-beta"; target="_blank">""",
diff --git a/lib/bridgedb/templates/howto.html b/lib/bridgedb/templates/howto.html
new file mode 100644
index 0000000..42e14ca
--- /dev/null
+++ b/lib/bridgedb/templates/howto.html
@@ -0,0 +1,47 @@
+## -*- coding: utf-8 -*-
+
+<%inherit file="base.html"/>
+
+<div class="container-fluid"
+     style="width: 98%; align: center; margin: auto;">
+<div class="container-fluid"
+     style="width: 95%; align: center;
+            padding-top: 10%; padding-left: 5%; padding-right: 5%;">
+  <div class="panel panel-primary">
+    <div class="panel-heading">
+      <h3 class="panel-title">${_("""How to start using your bridges""")}</h3>
+    </div>
+    <br />
+
+    <div class="container-fluid" id="howto" style="align-content: left;">
+      <p>
+${_("""To enter bridges into %s, follow the instructions on the""" \
+    """ %s %s download page %s to start %s.""") % \
+   ("""Tor Browser""", 
+    """<a href="https://www.torproject.org/projects/torbrowser.html.en#downloads-beta"; target="_blank">""",
+    """Tor Browser""", """</a>""", """Tor Browser""")}
+${_("""When the "Tor Network Settings" dialogue pops up,""" \
+    """ click "Configure" and follow the wizard until it asks:""")}
+      </p>
+      <br />
+      <div class="bs-component">
+        <blockquote>
+          <p>
+${_(""" Does your Internet Service Provider (ISP) block or""" \
+    """ otherwise censor connections to the Tor Network?""")}
+          </p>
+        </blockquote>
+      </div>
+      <p>
+${_(""" Select "Yes" and click "Next" in order to configure your""" \
+    """ new bridges. Select "Enter custom bridges", and copy and""" \
+    """ paste the bridges lines shown above into the text input""" \
+    """ box. Finally, click "Connect", and you should be good""" \
+    """ to go! If you experience trouble, try clicking""" \
+    """ the "Help" button in the "Tor Network Settings" wizard for""" \
+    """ further assistance.""")}
+      </p>
+    </div>
+  </div>
+</div>
+</div>
diff --git a/lib/bridgedb/templates/index.html b/lib/bridgedb/templates/index.html
index da48ddd..243ba10 100644
--- a/lib/bridgedb/templates/index.html
+++ b/lib/bridgedb/templates/index.html
@@ -31,10 +31,12 @@
   <div class="bdb_span7 step-text">
     <span class="lead">
       <span class="step-title">
-        ${_("Step 3")}</span>
-      <span style="margin-left: 20px;">
-        ${_("Now %s add the bridges to Tor %s") % \
-       ("""<a href="https://www.torproject.org/docs/bridges#UsingBridges";>""", "</a>")}</span>
-</span></div>
+        ${_("Step %s3%s") % ("""<u>""", """</u>""")}</span>
+      <span style="margin-left: 20px; margin-right: 20px;">
+        ${_("""Now %s add the bridges to Tor %s""") % \
+           ("""<a href="/howto"
+                  target="_blank" accesskey="3">""",
+            """</a>""")}</span>
+    </span>
+  </div>
 </div>
-



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits