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

[tor-commits] [atlas/master] Show family of the current relay, and only link fingerprints



commit e8b2299728918499a96048b87f6f4600a065f85c
Author: Michael Zeltner <m@xxxxxxxx>
Date:   Tue Feb 21 23:47:01 2012 +0100

    Show family of the current relay, and only link fingerprints
---
 js/models/relay.js          |    1 +
 templates/details/main.html |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/js/models/relay.js b/js/models/relay.js
index c0f5a10..b195f01 100644
--- a/js/models/relay.js
+++ b/js/models/relay.js
@@ -132,6 +132,7 @@ define([
                 //console.log(data);
                 var bw = relay.advertised_bandwidth;
                 relay.bandwidth = bw;
+                relay.family = relay.family ? relay.family : null;
                 relay.bandwidth_hr = hrBandwidth(bw);
                 relay.countryname = CountryCodes[relay.country];
                 relay.uptime = model.parsedate(relay.last_restarted);
diff --git a/templates/details/main.html b/templates/details/main.html
index 14bdaa7..ec8fbc3 100644
--- a/templates/details/main.html
+++ b/templates/details/main.html
@@ -63,8 +63,8 @@
     <dd><%= relay.get('last_restarted') %></dd>
 
     <dt><span class"tip" data-content="Other family members of this relay." data-original-title="Family Members">Family Members</span></dt>
-    <dd><pre><% _.each(relay.get('family'), function(member) { %>
-<% member = member.replace("$", "")%><a href="#details/<%= member %>"><%= member %></a><% }); %></pre></dd>
+    <dd><pre><% _.each(relay.get('family'), function(member) { %><% var valid = member.match(RegExp("^\$[A-F0-9]{40}$")); %>
+<% if (valid) { %><a href="#details/<%= member.replace('$', '') %>"><% } %><%= member %><% if (valid) { %></a><% }}); %></pre></dd>
 
     <dt><span class="tip" data-content="Date and time when the relay last published a descriptor to the directory authorities." data-original-title="Descriptor published">Descriptor Published</span></dt>
     <dd><%= relay.get('desc_published') %></dd>



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