[tor-commits] [atlas/master] Don't display country flag if country is not defined.

irl at torproject.org irl at torproject.org
Tue Jan 31 22:53:38 UTC 2017


commit 8bd498be6013ef8042c4bc0e0c8a145fadf0f165
Author: Raphael Bergmann <raphael at cc-ltd.net>
Date:   Tue Jan 31 16:42:05 2017 +0100

    Don't display country flag if country is not defined.
---
 templates/details/router.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/details/router.html b/templates/details/router.html
index 80beb03..de68424 100644
--- a/templates/details/router.html
+++ b/templates/details/router.html
@@ -84,7 +84,7 @@
     </dd>
 
     <dt><span class="tip" title="Country as found in a GeoIP database by resolving the relay's first onion-routing address." data-original-title="Country">Country</span></dt>
-    <dd><img class="inline country" title="<%= relay.get('countryname') %>" alt="" src="img/cc/<%= relay.get('country') %>.png"/> <%= relay.get('countryname') %></dd>
+    <dd><% if (relay.get('country')) { %><img class="inline country" title="<%= relay.get('countryname') %>" alt="" src="img/cc/<%= relay.get('country') %>.png"/> <%= relay.get('countryname') %><% } else { %>Unknown<% } %></dd>
 
     <dt><span class="tip" title="Autonomous System Number" data-original-title="AS Number">AS Number</span></dt>
     <dd><%= _.escape(relay.get('as_no')) %></dd>





More information about the tor-commits mailing list