[tor-commits] [check/master] Add some useful resources

arlo at torproject.org arlo at torproject.org
Tue Dec 3 06:32:16 UTC 2013


commit 5b491c196e9267f0f072b0e2f5af6d98530c8153
Author: Arlo Breault <arlolra at gmail.com>
Date:   Mon Dec 2 22:30:41 2013 -0800

    Add some useful resources
    
     * Short User Manual
     * Tor Q&A Site
    
    Closes #19
---
 check.pot         |   12 ++++++++++++
 public/base.html  |   12 ++++++++++++
 public/index.html |    8 ++++++++
 utils.go          |   29 +++++++++++++++++++++++++++++
 4 files changed, 61 insertions(+)

diff --git a/check.pot b/check.pot
index 5270b42..6bb9e11 100644
--- a/check.pot
+++ b/check.pot
@@ -68,3 +68,15 @@ msgstr ""
 
 msgid "Go"
 msgstr ""
+
+msgid "Short User Manual"
+msgstr ""
+
+msgid "The short user manual contains information about how to download Tor, how to use it, and what to do if Tor is unable to connect to the network."
+msgstr ""
+
+msgid "Tor Q&A Site"
+msgstr ""
+
+msgid "Questions and answers site for researchers, developers, and users of Tor. Hosted on StackExchange. Currently only available in English."
+msgstr ""
diff --git a/public/base.html b/public/base.html
index 20f2c05..f4dc22a 100644
--- a/public/base.html
+++ b/public/base.html
@@ -56,6 +56,7 @@
     }
     .foot {
       padding: 2em 4em;
+      clear: both;
     }
     .head {
       background-color: #85559f;
@@ -66,6 +67,17 @@
       margin: 0;
       font-size: 0.8em;
     }
+    .other {
+      width: 50%;
+      float: left;
+    }
+    .other p {
+      margin: 1em 4em;
+    }
+    .other p a {
+      display: block;
+      margin-bottom: 0.4em;
+    }
   </style>
 </head>
 <body>
diff --git a/public/index.html b/public/index.html
index bc8b48f..9477480 100644
--- a/public/index.html
+++ b/public/index.html
@@ -40,6 +40,14 @@
       {{ GetText .Lang "If you are attempting to use a Tor client, please refer to the <a href=\"https://www.torproject.org/\">Tor website</a> and specifically the <a href=\"https://www.torproject.org/docs/faq#DoesntWork\">instructions for configuring your Tor client</a>." | UnEscaped }}
     {{ end }}
   </p>
+  <div class="other">
+    <p><a href="https://torproject.org/dist/manual/short-user-manual_{{ UserManual .Lang }}.xhtml">{{ GetText .Lang "Short User Manual" }}</a>
+    {{ GetText .Lang "The short user manual contains information about how to download Tor, how to use it, and what to do if Tor is unable to connect to the network." }}</p>
+  </div>
+  <div class="other">
+    <p><a href="http://tor.stackexchange.com/">{{ GetText .Lang "Tor Q&A Site" }}</a>
+    {{ GetText .Lang "Questions and answers site for researchers, developers, and users of Tor. Hosted on StackExchange. Currently only available in English." }}</p>
+  </div>
 {{ end }}
 {{ define "foot" }}
 <script>
diff --git a/utils.go b/utils.go
index 8b0bda2..d4912e7 100644
--- a/utils.go
+++ b/utils.go
@@ -49,6 +49,29 @@ func GetQS(q url.Values, param string, deflt int) (num int, str string) {
 	return
 }
 
+var HaveManual = map[string]bool{
+	"ar":    true,
+	"zh_CN": true,
+	"cs":    true,
+	"nl":    true,
+	"en":    true,
+	"fa":    true,
+	"fr":    true,
+	"de":    true,
+	"el":    true,
+	"hu":    true,
+	"it":    true,
+	"ja":    true,
+	"lv":    true,
+	"nb":    true,
+	"pl":    true,
+	"pt_BR": true,
+	"ru":    true,
+	"es":    true,
+	"sv":    true,
+	"tr":    true,
+}
+
 func FuncMap(domain *gettext.Domain) template.FuncMap {
 	return template.FuncMap{
 		"UnEscaped": func(x string) interface{} {
@@ -69,6 +92,12 @@ func FuncMap(domain *gettext.Domain) template.FuncMap {
 		"And": func(a bool, b bool) bool {
 			return a && b
 		},
+		"UserManual": func(lang string) string {
+			if _, ok := HaveManual[lang]; !ok {
+				lang = "en"
+			}
+			return lang
+		},
 	}
 }
 



More information about the tor-commits mailing list