commit abb8dff5d3f196e824351b1805d322af351f806a Author: Tom Ritter tom@ritter.vg Date: Wed Mar 18 11:01:57 2015 -0700
Better recommended versions display
This will highlight the individual versions that are different between an authority and the consensus. --- website.py | 46 ++++++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 28 deletions(-)
diff --git a/website.py b/website.py index d33d3fc..e75eca0 100755 --- a/website.py +++ b/website.py @@ -355,35 +355,25 @@ class WebsiteWriter: vote = self.votes[dirauth_nickname] if vote.client_versions: - if self.consensus.client_versions == vote.client_versions: - self.site.write(" <tr>\n" - + " <td>" + dirauth_nickname + "</td>\n" - + " <td>client-versions ") - self.site.write(", ".join([str(v) for v in vote.client_versions])) - self.site.write( "</td>\n" - + " </tr>\n"); - else: - self.site.write(" <tr>\n" - + " <td><span class="oiv">" + dirauth_nickname + "</span></td>\n" - + " <td><span class="oiv">client-versions ") - self.site.write(", ".join([str(v) for v in vote.client_versions])) - self.site.write("</span></td>\n" - + " </tr>\n") + self.site.write(" <tr>\n" + + " <td>" + dirauth_nickname + "</td>\n" + + " <td>client-versions ") + self.site.write(", ".join([(str(v) if v in self.consensus.client_versions else "<span class="oiv">" + str(v) + "</span>") + for v in vote.client_versions])) + self.site.write("".join([(", <span class="oiv"><s>" + str(v) + "</s></span>") + for v in self.consensus.client_versions if v not in vote.client_versions])) + self.site.write("</td>\n" + + " </tr>\n") if vote.server_versions: - if self.consensus.server_versions == vote.server_versions: - self.site.write(" <tr>\n" - + " <td> </td>\n" - + " <td>server-versions ") - self.site.write(", ".join([str(v) for v in vote.server_versions])) - self.site.write("</td>\n" - + " </tr>\n"); - else: - self.site.write(" <tr>\n" - + " <td><span class="oiv">" + dirauth_nickname + "</span></td>\n" - + " <td><span class="oiv">server-versions "); - self.site.write(", ".join([str(v) for v in vote.server_versions])) - self.site.write("</span></td>\n" - + " </tr>\n") + self.site.write(" <tr>\n" + + " <td>" + dirauth_nickname + "</td>\n" + + " <td>server-versions ") + self.site.write(", ".join([(str(v) if v in self.consensus.server_versions else "<span class="oiv">" + str(v) + "</span>") + for v in vote.server_versions])) + self.site.write("".join([(", <span class="oiv"><s>" + str(v) + "</s></span>") + for v in self.consensus.server_versions if v not in vote.server_versions])) + self.site.write("</td>\n" + + " </tr>\n") else: self.site.write(" <tr>\n" + " <td>" + dirauth_nickname + "</td>\n"
tor-commits@lists.torproject.org