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

[tor-commits] [atlas/master] Removed deprecated family field. Displaying effective and alleged family instead.



commit d7bbd232b69cce930cb97abca79769207cfa976b
Author: orlando <cristobal.leiva@xxxxxxxx>
Date:   Sat Nov 28 00:27:13 2015 -0300

    Removed deprecated family field. Displaying effective and alleged family instead.
---
 css/style.css                 |    4 ++++
 js/models/relay.js            |    8 +++++++-
 templates/details/router.html |    6 ++++--
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/css/style.css b/css/style.css
index 5040128..71a63b9 100644
--- a/css/style.css
+++ b/css/style.css
@@ -48,3 +48,7 @@
 .container #content {
     padding-top: 60px;
 }
+
+a.alleged {
+	color: #FE9F30;
+}
diff --git a/js/models/relay.js b/js/models/relay.js
index ea5c987..c8604db 100644
--- a/js/models/relay.js
+++ b/js/models/relay.js
@@ -154,7 +154,13 @@ define([
                     relay.obandwidth = relay.observed_bandwidth ? hrBandwidth(relay.observed_bandwidth) : null;
                     relay.bandwidth = relay.advertised_bandwidth ? relay.advertised_bandwidth : null;
                     relay.bandwidth_hr = relay.advertised_bandwidth ? hrBandwidth(relay.advertised_bandwidth) : null;
-                    relay.family = relay.family ? relay.family : null;
+                    if(relay.alleged_family || relay.effective_family) {
+						relay.effective_family = relay.effective_family ? relay.effective_family : null;
+						relay.alleged_family = relay.alleged_family ? relay.alleged_family : null;
+						relay.empty_family = false;
+					} else {
+						relay.empty_family = true;
+					}
                     if (relay.is_bridge) {
                         var new_addresses = [];
                         _.each(relay.or_addresses, function(or_addr) {
diff --git a/templates/details/router.html b/templates/details/router.html
index 1aedfe5..50d0ccc 100644
--- a/templates/details/router.html
+++ b/templates/details/router.html
@@ -91,8 +91,10 @@
     <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) { %><% var valid = member.match(RegExp("^\$[A-F0-9]{40}$")); %>
-<% if (valid) { %><a href="#details/<%= member.replace('$', '') %>"><% } %><%= member %><% if (valid) { %></a><% }}); %></pre></dd>
+    <dd><pre><% if (relay.get('effective_family') !== null) { %><% _.each(relay.get('effective_family'), function(member) { %><% var valid = member.match(RegExp("^\$[A-F0-9]{40}$")); %>
+<% if (valid) { %><a href="#details/<%= member.replace('$', '') %>" title="Effective family member"><% } %><%= member %><% if (valid) { %></a><% }}); %><% } %>
+<% if (relay.get('alleged_family') !== null) { %><% _.each(relay.get('alleged_family'), function(member) { %><% var valid = member.match(RegExp("^\$[A-F0-9]{40}$")); %>
+<% if (valid) { %><a href="#details/<%= member.replace('$', '') %>" title="Alleged family member" class="alleged"><% } %><%= 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