aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan <me@jordan.im>2023-01-25 21:11:28 -0700
committerJordan <me@jordan.im>2023-01-25 21:11:28 -0700
commit7f6a05fc2bd7e611c2f9e11dc5960868df482d3c (patch)
tree97ebb63388abf54948f071905cce40e572bc480a
parent76eaf7138df8e9f27d294a988ca109f32201300a (diff)
downloadallium-7f6a05fc2bd7e611c2f9e11dc5960868df482d3c.tar.gz
allium-7f6a05fc2bd7e611c2f9e11dc5960868df482d3c.zip
templates: make them human-readable, housekeeping
-rw-r--r--allium/templates/all.html11
-rw-r--r--allium/templates/as.html23
-rw-r--r--allium/templates/contact.html26
-rw-r--r--allium/templates/country.html21
-rw-r--r--allium/templates/family.html26
-rw-r--r--allium/templates/first_seen.html23
-rw-r--r--allium/templates/flag.html28
-rw-r--r--allium/templates/index.html16
-rw-r--r--allium/templates/misc-families.html161
-rw-r--r--allium/templates/misc-networks.html143
-rw-r--r--allium/templates/platform.html24
-rw-r--r--allium/templates/relay-info.html376
-rw-r--r--allium/templates/relay-list.html286
-rw-r--r--allium/templates/skeleton.html112
14 files changed, 742 insertions, 534 deletions
diff --git a/allium/templates/all.html b/allium/templates/all.html
index 7d63705..8f9f8b9 100644
--- a/allium/templates/all.html
+++ b/allium/templates/all.html
@@ -1,8 +1,9 @@
{% extends "relay-list.html" %}
{% set relay_count = relays.json['relays']|length %}
{% block title %}Tor Relays :: All{% endblock %}
-{% block header %}<a href="./">Home</a> :: All Relays{% endblock %}
-{% block description %}All known (non-guard) relays, {{ relay_count }} in total.
-A smaller browser-friendly subset (top 500) is <a href="./">available
-here</a>.{% endblock %}
-
+{% block header %}<a href="../">Home</a> :: All Relays{% endblock %}
+{% block description %}
+ All known (non-guard) relays, {{ relay_count }} in total.
+ A smaller browser-friendly subset (top 500) is <a href="../">available
+ here</a>.
+{% endblock %}
diff --git a/allium/templates/as.html b/allium/templates/as.html
index 137447d..1e9a467 100644
--- a/allium/templates/as.html
+++ b/allium/templates/as.html
@@ -2,10 +2,19 @@
{% set as_number = relays.json['relay_subset'][0]['as']|escape %}
{% set as_name = relays.json['relay_subset'][0]['as_name']|escape %}
{% block title %}Tor Relays :: {{ as_number }}{% endblock %}
-{% block header %}<a href="../../">Home</a> :: {{ as_number }}{% endblock %} {%
-block description %}{{ as_number }} {% if as_name %}({{ as_name }}){% endif %}
-is responsible for ~{{ bandwidth }} MB/s of traffic, with {% if middle_count
-> 0 %}{{ middle_count }} middle relay{% if middle_count > 1 %}s{% endif %}{% if
-exit_count > 0 %} and {% endif %}{% endif %}{% if exit_count > 0 %}{{
-exit_count }} exit relay{% if exit_count > 1 %}s{% endif %}{% endif %}.{%
-endblock %}
+{% block header %}<a href="../../">Home</a> :: {{ as_number }}{% endblock %}
+{% block description %}{{ as_number }}
+{% if as_name %}({{ as_name }}) {% endif %}
+is responsible for ~{{ bandwidth }} MB/s of traffic, with
+{% if middle_count > 0 %}
+ {{ middle_count }} middle relay
+ {%- if middle_count > 1 -%}s{% endif %}
+ {% if exit_count > 0 %}
+ and
+ {% endif %}
+{% endif %}
+{% if exit_count > 0 %}
+ {{ exit_count }} exit relay
+ {%- if exit_count > 1 -%}s{%- endif -%}
+{%- endif -%}
+.{% endblock %}
diff --git a/allium/templates/contact.html b/allium/templates/contact.html
index d060a2d..cc3edd1 100644
--- a/allium/templates/contact.html
+++ b/allium/templates/contact.html
@@ -6,10 +6,22 @@
{% set contact = 'none' %}
{% endif %}
{% block title %}Tor Relays :: Contact {{ contact_hash }}{% endblock %}
-{% block header %}<a href="../../">Home</a> :: Contact {{ contact_hash }}{%
-endblock %}
-{% block description %}Relays with contact info <code>{{ contact }}</code> are
-responsible for ~{{ bandwidth }} MB/s of traffic, with {% if middle_count
-> 0 %}{{ middle_count }} middle relay{% if middle_count > 1 %}s{% endif %}{% if
-exit_count > 0 %} and {% endif %}{% endif %}{% if exit_count > 0 %}{{ exit_count
-}} exit relay{% if exit_count > 1 %}s{% endif %}{% endif %}.{% endblock %}
+{% block header %}
+ <a href="../../">Home</a> :: Contact {{ contact_hash }}{% endblock %}
+ {% block description %}
+ Relays with contact info <code>{{ contact }}</code> are
+ responsible for ~{{ bandwidth }} MB/s of traffic, with
+ {% if middle_count > 0 %}
+ {{ middle_count }} middle relay
+ {%- if middle_count > 1 -%}s{%- endif -%}
+ {% if exit_count > 0 %}
+ and
+ {% endif %}
+ {% endif %}
+ {% if exit_count > 0 %}
+ {{ exit_count
+ }} exit relay
+ {%- if exit_count > 1 -%}s{%- endif -%}
+ {%- endif -%}
+ .
+ {% endblock %}
diff --git a/allium/templates/country.html b/allium/templates/country.html
index 77c3d51..46273fc 100644
--- a/allium/templates/country.html
+++ b/allium/templates/country.html
@@ -8,8 +8,19 @@
{% endif %}
{% block title %}Tor Relays :: {{ country_orig }}{% endblock %}
{% block header %}<a href="../../">Home</a> :: {{ country_name }}{% endblock %}
-{% block description %}{{ country_name }} ({{ country_abbr }}) is responsible
-for ~{{ bandwidth }} MB/s of traffic, with {% if middle_count > 0 %}{{
-middle_count }} middle relay{% if middle_count > 1 %}s{% endif %}{% if
-exit_count > 0 %} and {% endif %}{% endif %}{% if exit_count > 0 %}{{ exit_count
-}} exit relay{% if exit_count > 1 %}s{% endif %}{% endif %}.{% endblock %}
+{% block description %}
+ {{ country_name }} ({{ country_abbr }}) is responsible
+ for ~{{ bandwidth }} MB/s of traffic, with
+ {% if middle_count > 0 %}
+ {{ middle_count }} middle relay
+ {%- if middle_count > 1 -%}s{%- endif -%}
+ {% if exit_count > 0 %}
+ and
+ {% endif %}
+ {% endif %}
+ {% if exit_count > 0 %}
+ {{ exit_count }} exit relay
+ {%- if exit_count > 1 -%}s{%- endif -%}
+ {%- endif -%}
+ .
+{% endblock %}
diff --git a/allium/templates/family.html b/allium/templates/family.html
index 454ca21..c883956 100644
--- a/allium/templates/family.html
+++ b/allium/templates/family.html
@@ -1,10 +1,20 @@
{% extends "relay-list.html" %}
{% block title %}Tor Relays :: Family {{ value|escape }}{% endblock %}
-{% block header %}<a href="../../">Home</a> :: Family <code>{{ value|escape
-}}</code>{% endblock %}
-{% block description %}Relays with effective family member <code>{{ value|escape
-}}</code> are responsible for ~{{ bandwidth }} MB/s of traffic, with {% if
-middle_count > 0 %}{{ middle_count }} middle relay{% if middle_count > 1 %}s{%
-endif %}{% if exit_count > 0 %} and {% endif %}{% endif %}{% if exit_count
-> 0 %}{{ exit_count }} exit relay{% if exit_count > 1 %}s{% endif %}{% endif
-%}.{% endblock %}
+{% block header %}
+ <a href="../../">Home</a> :: Family <code>{{ value|escape }}</code>
+{% endblock %}
+{% block description %}
+ Relays with effective family member
+ <code> {{ value|escape }}</code> are responsible for ~{{ bandwidth }} MB/s of
+ traffic, with
+ {% if middle_count > 0 %}
+ {{ middle_count }} middle relay
+ {%- if middle_count > 1 -%}s{% endif %}
+ {% if exit_count > 0 %} and{% endif %}
+ {% endif %}
+ {% if exit_count > 0 %}
+ {{ exit_count }} exit relay
+ {%- if exit_count > 1 -%}s{%- endif -%}
+ {%- endif -%}
+ .
+ {% endblock %}
diff --git a/allium/templates/first_seen.html b/allium/templates/first_seen.html
index 374760a..cbb5546 100644
--- a/allium/templates/first_seen.html
+++ b/allium/templates/first_seen.html
@@ -1,8 +1,21 @@
{% extends "relay-list.html" %}
{% block title %}Tor Relays :: {{ value }}{% endblock %}
{% block header %}<a href="../../">Home</a> :: {{ value }}{% endblock %}
-{% block description %}Relays started on {{ value }} are responsible for ~{{
-bandwidth }} MB/s of traffic, with {% if middle_count > 0 %}{{ middle_count }}
-middle relay{% if middle_count > 1 %}s{% endif %}{% if exit_count > 0 %} and {%
-endif %}{% endif %}{% if exit_count > 0 %}{{ exit_count }} exit relay{% if
-exit_count > 1 %}s{% endif %}{% endif %}.{% endblock %}
+{% block description %}
+ Relays started on {{ value }} are responsible for ~{{
+ bandwidth }} MB/s of traffic, with
+ {% if middle_count > 0 %}
+ {{ middle_count }}
+ middle relay
+ {%- if middle_count > 1 -%}s{%- endif %}
+ {% if exit_count > 0 %}
+ and {% endif %}
+ {% endif %}
+ {% if exit_count > 0 %}
+ {{ exit_count }} exit relay
+ {%- if exit_count > 1 -%}
+ s
+ {%- endif -%}
+ {%- endif -%}
+ .
+{% endblock %}
diff --git a/allium/templates/flag.html b/allium/templates/flag.html
index e174af4..28e409e 100644
--- a/allium/templates/flag.html
+++ b/allium/templates/flag.html
@@ -1,9 +1,23 @@
{% extends "relay-list.html" %}
{% block title %}Tor Relays :: {{ value|escape }} Relays{% endblock %}
-{% block header %}<a href="../../">Home</a> :: {{ value|escape }} Relays{%
-endblock %}
-{% block description %}Relays with the {{ value }} flag are responsible for ~{{
-bandwidth }} MB/s of traffic, with {% if middle_count > 0 %}{{ middle_count }}
-middle relay{% if middle_count > 1 %}s{% endif %}{% if exit_count > 0 %} and {%
-endif %}{% endif %}{% if exit_count > 0 %}{{ exit_count }} exit relay{% if
-exit_count > 1 %}s{% endif %}{% endif %}.{% endblock %}
+{% block header %}
+ <a href="../../">Home</a> :: {{ value|escape }} Relays{%
+ endblock %}
+ {% block description %}
+ Relays with the {{ value }} flag are responsible for ~{{
+ bandwidth }} MB/s of traffic, with
+ {% if middle_count > 0 %}
+ {{ middle_count }}
+ middle relay
+ {%- if middle_count > 1 -%}s{%- endif %}
+ {% if exit_count > 0 %}
+ and {% endif %}
+ {% endif %}
+ {% if exit_count > 0 %}
+ {{ exit_count }} exit relay
+ {%- if exit_count > 1 -%}
+ s
+ {%- endif -%}
+ {%- endif -%}
+ .
+ {% endblock %}
diff --git a/allium/templates/index.html b/allium/templates/index.html
index 247f77c..5911ae9 100644
--- a/allium/templates/index.html
+++ b/allium/templates/index.html
@@ -1,10 +1,10 @@
{% extends "relay-list.html" %}
{% block title %}Tor Relays{% endblock %}
-{% block header %}Allium (<a
-href="http://d6amkx45augz4kskvjryv3bmmwyf7vw4k3uwxsh5egnibw2igl5aozqd.onion/">v3</a>,
-<a href="https://github.com/tempname1024/allium">git</a>){% endblock %}
-{% block description %}Relay listings are statically generated every hour. Last
-fetch was at {{ relays.timestamp }}. Listing top 500 relays; <a
-href="misc/all.html">view full list</a>, <a
-href="./misc/networks-by-bandwidth.html">networks</a>, or <a
-href="./misc/families-by-bandwidth.html">families</a>.{% endblock %}
+{% block header %}
+ Allium (<a href="http://d6amkx45augz4kskvjryv3bmmwyf7vw4k3uwxsh5egnibw2igl5aozqd.onion/">v3</a>,
+ <a href="https://github.com/tempname1024/allium">git</a>)
+{% endblock %}
+{% block description %}
+ Relay listings are statically generated every hour. Last
+ fetch was at {{ relays.timestamp }}. Listing top 500 relays; <a href="misc/all.html">view full list</a>, <a href="./misc/networks-by-bandwidth.html">networks</a>, or <a href="./misc/families-by-bandwidth.html">families</a>.
+{% endblock %}
diff --git a/allium/templates/misc-families.html b/allium/templates/misc-families.html
index 12773c8..d8dc82f 100644
--- a/allium/templates/misc-families.html
+++ b/allium/templates/misc-families.html
@@ -1,79 +1,90 @@
{% extends "skeleton.html" -%}
{% set sorted_by_label = sorted_by.split(',')[0].split('.')[1] -%}
-{% block title -%}Tor Relays :: Families By {{ sorted_by_label|replace('_',
-' ')|title }}{% endblock -%}
+{% block title -%}
+ Tor Relays :: Families By {{ sorted_by_label|replace('_',
+ ' ')|title }}
+{% endblock -%}
{% block body -%}
-<h2><a href={{ path_prefix }}>Home</a> :: Families By {{
-sorted_by_label|replace('_', ' ')|title }}</h2>
-<p>The set of all relay families with > 1 effective members, sorted by {{
-sorted_by_label|replace('_', ' ') }}. The first seen parameter is taken from the
-oldest relay in the family.</p>
-<table class="table table-condensed">
-<tr>
-<th>Family</th>
-
-{% if sorted_by_label == 'bandwidth' -%}
-<th>Bandwidth</th>
-{% else -%}
-<th><a href="families-by-bandwidth.html">Bandwidth</a></th>
-{% endif -%}
-
-<th class="visible-md visible-lg">Contact</th>
-
-{% if sorted_by_label == 'exit_count' -%}
-<th>Exit / <a href="families-by-middle-count.html">Middle</a></th>
-{% elif sorted_by_label == 'middle_count' -%}
-<th><a href="families-by-exit-count.html">Exit</a> / Middle</th>
-{% else -%}
-<th><a href="families-by-exit-count.html">Exit</a> / <a
-href="families-by-middle-count.html">Middle</a></th>
-{% endif -%}
-
-{% if sorted_by_label == 'first_seen' -%}
-<th>First Seen</th>
-{% else -%}
-<th><a href="families-by-first-seen.html">First Seen</a></th>
-{% endif -%}
-</tr>
-
-<tbody>
-{% set processed = dict() -%}
-{% for k, v in relays.json['sorted']['family'].items()|sort(attribute=sorted_by,
-reverse=True) -%}
-{% if relays.json['relays'][v['relays'][0]]['fingerprint'] not in processed -%}
-<tr>
-{% if v['bandwidth'] > 1000000 -%}
-{% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000000)|round(2,
-'common'), 'MB/s') -%}
-{% else -%}
-{% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000)|round(2,
-'common'), 'KB/s') -%}{% endif -%}
-
-<td><code><a href="{{ path_prefix}}family/{{ k|escape }}/">{{ k|escape
-}}</a></code></td>
-
-<td>{{ obs_bandwidth }}</td>
-
-{% if v['contact'] -%}
-<td class="visible-md visible-lg"><code><a href="{{ path_prefix }}contact/{{
-v['contact_md5'] }}/" title="{{ v['contact']|escape }}">{{
-v['contact']|truncate(50)|escape }}<a></td></code>
-{% else -%}
-<td class="visible-md visible-lg">none</td>
-{% endif -%}
-
-<td>{{ v['exit_count'] }} / {{ v['middle_count'] }}</td>
-
-<td><a href="{{ path_prefix }}first_seen/{{ v['first_seen'].split(' ',
-1)[0]|escape }}">{{ v['first_seen'].split(' ', 1)[0]|escape }}</a></td>
-
-{% for r in v['relays'] -%}
-{% set _dummy = processed.update({relays.json['relay_subset'][r]['fingerprint']:
-None}) -%}
-{% endfor -%}
-</tr>
-{% endif -%}
-{% endfor -%}
-</tbody>
-</table>
+ <h2>
+ <a href={{ path_prefix }}>Home</a> :: Families By {{
+ sorted_by_label|replace('_', ' ')|title }}
+ </h2>
+ <p>
+ The set of all relay families with > 1 effective members, sorted by {{
+ sorted_by_label|replace('_', ' ') }}. The first seen parameter is taken from the
+ oldest relay in the family.
+ </p>
+ <table class="table table-condensed">
+ <tr>
+ <th>Family</th>
+ {% if sorted_by_label == 'bandwidth' -%}
+ <th>Bandwidth</th>
+ {% else -%}
+ <th>
+ <a href="families-by-bandwidth.html">Bandwidth</a>
+ </th>
+ {% endif -%}
+ <th class="visible-md visible-lg">Contact</th>
+ {% if sorted_by_label == 'exit_count' -%}
+ <th>
+ Exit / <a href="families-by-middle-count.html">Middle</a>
+ </th>
+ {% elif sorted_by_label == 'middle_count' -%}
+ <th>
+ <a href="families-by-exit-count.html">Exit</a> / Middle
+ </th>
+ {% else -%}
+ <th>
+ <a href="families-by-exit-count.html">Exit</a> / <a href="families-by-middle-count.html">Middle</a>
+ </th>
+ {% endif -%}
+ {% if sorted_by_label == 'first_seen' -%}
+ <th>First Seen</th>
+ {% else -%}
+ <th>
+ <a href="families-by-first-seen.html">First Seen</a>
+ </th>
+ {% endif -%}
+ </tr>
+ <tbody>
+ {% set processed = dict() -%}
+ {% for k, v in relays.json['sorted']['family'].items()|sort(attribute=sorted_by,
+ reverse=True) -%}
+ {% if relays.json['relays'][v['relays'][0]]['fingerprint'] not in processed -%}
+ <tr>
+ {% if v['bandwidth'] > 1000000 -%}
+ {% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000000)|round(2,
+ 'common'), 'MB/s') -%}
+ {% else -%}
+ {% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000)|round(2,
+ 'common'), 'KB/s') -%}
+ {% endif -%}
+ <td>
+ <code><a href="{{ path_prefix }}family/{{ k|escape }}/">{{ k|escape
+ }}</a></code>
+ </td>
+ <td>{{ obs_bandwidth }}</td>
+ {% if v['contact'] -%}
+ <td class="visible-md visible-lg">
+ <code><a href="{{ path_prefix }}contact/{{ v['contact_md5'] }}/"
+ title="{{ v['contact']|escape }}">{{
+ v['contact']|truncate(50)|escape }}<a>
+ </td>
+ </code>
+ {% else -%}
+ <td class="visible-md visible-lg">none</td>
+ {% endif -%}
+ <td>{{ v['exit_count'] }} / {{ v['middle_count'] }}</td>
+ <td>
+ <a href="{{ path_prefix }}first_seen/{{ v['first_seen'].split(' ', 1)[0]|escape }}">{{ v['first_seen'].split(' ', 1)[0]|escape }}</a>
+ </td>
+ {% for r in v['relays'] -%}
+ {% set _dummy = processed.update({relays.json['relay_subset'][r]['fingerprint']:
+ None}) -%}
+ {% endfor -%}
+ </tr>
+ {% endif -%}
+ {% endfor -%}
+ </tbody>
+ </table>
{% endblock -%}
diff --git a/allium/templates/misc-networks.html b/allium/templates/misc-networks.html
index afc856d..b68aab0 100644
--- a/allium/templates/misc-networks.html
+++ b/allium/templates/misc-networks.html
@@ -1,69 +1,82 @@
{% extends "skeleton.html" -%}
{% set sorted_by_label = sorted_by.split(',')[0].split('.')[1] -%}
-{% block title -%}Tor Relays :: Networks By {{ sorted_by_label|replace('_',
-' ')|title }}{% endblock -%}
+{% block title -%}
+ Tor Relays :: Networks By {{ sorted_by_label|replace('_',
+ ' ')|title }}
+{% endblock -%}
{% block body -%}
-<h2><a href={{ path_prefix }}>Home</a> :: Networks By {{
-sorted_by_label|replace('_', ' ')|title }}</h2>
-<p>The set of all ({{ relays.json['sorted']['as']|length }}) recognized networks
-running at least one relay sorted by {{ sorted_by_label|replace('_', ' ') }}.
-This data is onionoo-derived and might be out of date with respect to other
-sources.</p>
-<table class="table table-condensed">
-<tr>
-<th>AS Number</th>
-<th>AS Name</th>
-<th>Country</th>
-{% if sorted_by_label == 'bandwidth' -%}
-<th>Bandwidth</th>
-{% else -%}
-<th><a href="networks-by-bandwidth.html">Bandwidth</a></th>
-{% endif -%}
-
-{% if sorted_by_label == 'exit_count' -%}
-<th>Exit / <a href="networks-by-middle-count.html">Middle</a></th>
-{% elif sorted_by_label == 'middle_count' -%}
-<th><a href="networks-by-exit-count.html">Exit</a> / Middle</th>
-{% else -%}
-<th><a href="networks-by-exit-count.html">Exit</a> / <a
-href="networks-by-middle-count.html">Middle</a></th>
-{% endif -%}
-</tr>
-
-<tbody>
-{% for k, v in relays.json['sorted']['as'].items()|sort(attribute=sorted_by,
-reverse=True) -%}
-<tr>
-{% if v['bandwidth'] > 1000000 -%}
-{% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000000)|round(2,
-'common'), 'MB/s') -%}
-{% else -%}
-{% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000)|round(2,
-'common'), 'KB/s') -%}{% endif -%}
-
-<td><a href="{{ path_prefix}}as/{{ k|escape }}/">{{ k|escape }}</a></td>
-
-{% if v['as_name'] -%}
-<td title="{{ v['as_name']|escape }}"><a href="https://bgp.he.net/{{ k|escape
-}}">{{ v['as_name']|truncate(20)|escape }}</a></td>
-{% else -%}
-<td>Unknown</td>
-{% endif -%}
-
-{% if v['country'] -%}
-<td><a href="{{ path_prefix }}country/{{ v['country']|escape }}/"><img src="{{
-path_prefix }}static/images/cc/{{ v['country']|escape }}.png" title="{{
-v['country_name']|escape }}"alt="{{ v['country_name']|escape
-}}"></a></td>
-{% else -%}
-<td>X</td>
-{% endif -%}
-
-<td>{{ obs_bandwidth }}</td>
-
-<td>{{ v['exit_count'] }} / {{ v['middle_count'] }}</td>
-</tr>
-{% endfor -%}
-</tbody>
-</table>
+ <h2>
+ <a href={{ path_prefix }}>Home</a> :: Networks By {{
+ sorted_by_label|replace('_', ' ')|title }}
+ </h2>
+ <p>
+ The set of all ({{ relays.json['sorted']['as']|length }}) recognized networks
+ running at least one relay sorted by {{ sorted_by_label|replace('_', ' ') }}.
+ This data is onionoo-derived and might be out of date with respect to other
+ sources.
+ </p>
+ <table class="table table-condensed">
+ <tr>
+ <th>AS Number</th>
+ <th>AS Name</th>
+ <th>Country</th>
+ {% if sorted_by_label == 'bandwidth' -%}
+ <th>Bandwidth</th>
+ {% else -%}
+ <th>
+ <a href="networks-by-bandwidth.html">Bandwidth</a>
+ </th>
+ {% endif -%}
+ {% if sorted_by_label == 'exit_count' -%}
+ <th>
+ Exit / <a href="networks-by-middle-count.html">Middle</a>
+ </th>
+ {% elif sorted_by_label == 'middle_count' -%}
+ <th>
+ <a href="networks-by-exit-count.html">Exit</a> / Middle
+ </th>
+ {% else -%}
+ <th>
+ <a href="networks-by-exit-count.html">Exit</a> / <a href="networks-by-middle-count.html">Middle</a>
+ </th>
+ {% endif -%}
+ </tr>
+ <tbody>
+ {% for k, v in relays.json['sorted']['as'].items()|sort(attribute=sorted_by,
+ reverse=True) -%}
+ <tr>
+ {% if v['bandwidth'] > 1000000 -%}
+ {% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000000)|round(2,
+ 'common'), 'MB/s') -%}
+ {% else -%}
+ {% set obs_bandwidth = '%s %s'|format((v['bandwidth'] / 1000)|round(2,
+ 'common'), 'KB/s') -%}
+ {% endif -%}
+ <td>
+ <a href="{{ path_prefix }}as/{{ k|escape }}/">{{ k|escape }}</a>
+ </td>
+ {% if v['as_name'] -%}
+ <td title="{{ v['as_name']|escape }}">
+ <a href="https://bgp.he.net/{{ k|escape }}">{{ v['as_name']|truncate(20)|escape }}</a>
+ </td>
+ {% else -%}
+ <td>Unknown</td>
+ {% endif -%}
+ {% if v['country'] -%}
+ <td>
+ <a href="{{ path_prefix }}country/{{ v['country']|escape }}/">
+ <img src="{{ path_prefix }}static/images/cc/{{ v['country']|escape }}.png"
+ title="{{ v['country_name']|escape }}"
+ alt="{{ v['country_name']|escape }}">
+ </a>
+ </td>
+ {% else -%}
+ <td>X</td>
+ {% endif -%}
+ <td>{{ obs_bandwidth }}</td>
+ <td>{{ v['exit_count'] }} / {{ v['middle_count'] }}</td>
+ </tr>
+ {% endfor -%}
+ </tbody>
+ </table>
{% endblock -%}
diff --git a/allium/templates/platform.html b/allium/templates/platform.html
index 4f6d941..2cac2ab 100644
--- a/allium/templates/platform.html
+++ b/allium/templates/platform.html
@@ -2,8 +2,22 @@
{% set platform = relays.json['relay_subset'][0]['platform']|escape %}
{% block title %}Tor Relays :: {{ platform }}{% endblock %}
{% block header %}<a href="../../">Home</a> :: {{ platform }}{% endblock %}
-{% block description %}{{ platform }} systems are responsible for ~{{ bandwidth
-}} MB/s of traffic, with {% if middle_count > 0 %}{{ middle_count }} middle
-relay{% if middle_count > 1 %}s{% endif %}{% if exit_count > 0 %} and {% endif
-%}{% endif %}{% if exit_count > 0 %}{{ exit_count }} exit relay{% if exit_count
-> 1 %}s{% endif %}{% endif %}.{% endblock %}
+{% block description %}
+ {{ platform }} systems are responsible for ~{{ bandwidth
+ }} MB/s of traffic, with
+ {% if middle_count > 0 %}
+ {{ middle_count }} middle
+ relay
+ {%- if middle_count > 1 -%}s{%- endif %}
+ {% if exit_count > 0 %}
+ and
+ {% endif %}
+ {% endif %}
+ {% if exit_count > 0 %}
+ {{ exit_count }} exit relay
+ {%- if exit_count > 1 -%}
+ s
+ {%- endif -%}
+ {%- endif -%}
+ .
+{% endblock %}
diff --git a/allium/templates/relay-info.html b/allium/templates/relay-info.html
index f2aabe7..ee726e1 100644
--- a/allium/templates/relay-info.html
+++ b/allium/templates/relay-info.html
@@ -1,103 +1,143 @@
{% extends "skeleton.html" -%}
-{% block title -%}Tor Relays :: {{ relay['nickname'] }}{% endblock -%}
+{% block title -%}
+ Tor Relays :: {{ relay['nickname'] }}
+{% endblock -%}
{% block body -%}
-<div id="content">
-<h2><a href="{{ path_prefix }}">Home</a> :: Relay "{{ relay['nickname'] }}"</h2>
-<div class="row">
-<div class="col-md-6">
-<dl>
-<dt>Nickname</dt>
-<dd>{{ relay['nickname']|escape }}</dd>
-
-<dt>OR Address</dt>
-<dd><pre class="pre-scrollable">{% for address in relay['or_addresses'] -%}
+ <div id="content">
+ <h2>
+ <a href="{{ path_prefix }}">Home</a> :: Relay "{{ relay['nickname'] }}"
+ </h2>
+ <div class="row">
+ <div class="col-md-6">
+ <dl>
+ <dt>
+ Nickname
+ </dt>
+ <dd>
+ {{ relay['nickname']|escape }}
+ </dd>
+ <dt>
+ OR Address
+ </dt>
+ <dd>
+ <pre class="pre-scrollable">{% for address in relay['or_addresses'] -%}
{{ address }}
{% endfor -%}
-</pre></dd>
-
-<dt>Contact</dt>
-{% if relay['contact'] -%}
-<dd><a href="{{ path_prefix }}contact/{{ relay['contact_md5'] }}">{{
-relay['contact']|escape }}</a></dd>
-{% else -%}
-<dd><a href="{{ path_prefix }}contact/{{ relay['contact_md5'] }}">none</a></dd>
-{% endif -%}
-
-<dt>Dir Address</dt>
-{% if relay['dir_address'] -%}
-<dd><a href="http://{{ relay['dir_address']|escape }}">{{
-relay['dir_address']|escape }}</a></dd>
-{% else -%}
-<dd>none</dd>
-{% endif -%}
-
-<dt>Exit Address</dt>
-{% if relay['exit_address'] -%}
-<dd>{{ relay['exit_address']|escape }}</dd>
-{% else -%}
-<dd>none</dd>
-{% endif -%}
-
-<dt>Observed Bandwidth</dt>
-{% if relay['observed_bandwidth'] > 1000000 -%}
-{% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth']
-/ 1000000)|round(2, 'common'), 'MB/s') -%}
-{% else -%}
-{% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth']
-/ 1000)|round(2, 'common'), 'KB/s') -%}{% endif -%}
-<dd>{{ obs_bandwidth }}</dd>
-
-<dt>IPv4 Exit Policy Summary</dt>
-<dd>
-{% if relay['exit_policy_summary'] -%}
-{%- set v4_summary = relay['exit_policy_summary'].items() -%}
-<pre class="pre-scrollable">{% for k, v in v4_summary -%}
+</pre>
+ </dd>
+ <dt>
+ Contact
+ </dt>
+ {% if relay['contact'] -%}
+ <dd>
+ <a href="{{ path_prefix }}contact/{{ relay['contact_md5'] }}">{{
+ relay['contact']|escape }}</a>
+ </dd>
+ {% else -%}
+ <dd>
+ <a href="{{ path_prefix }}contact/{{ relay['contact_md5'] }}">none</a>
+ </dd>
+ {% endif -%}
+ <dt>
+ Dir Address
+ </dt>
+ {% if relay['dir_address'] -%}
+ <dd>
+ <a href="http://{{ relay['dir_address']|escape }}">{{
+ relay['dir_address']|escape }}</a>
+ </dd>
+ {% else -%}
+ <dd>
+ none
+ </dd>
+ {% endif -%}
+ <dt>
+ Exit Address
+ </dt>
+ {% if relay['exit_address'] -%}
+ <dd>
+ {{ relay['exit_address']|escape }}
+ </dd>
+ {% else -%}
+ <dd>
+ none
+ </dd>
+ {% endif -%}
+ <dt>
+ Observed Bandwidth
+ </dt>
+ {% if relay['observed_bandwidth'] > 1000000 -%}
+ {% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth']
+ / 1000000)|round(2, 'common'), 'MB/s') -%}
+ {% else -%}
+ {% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth']
+ / 1000)|round(2, 'common'), 'KB/s') -%}
+ {% endif -%}
+ <dd>
+ {{ obs_bandwidth }}
+ </dd>
+ <dt>
+ IPv4 Exit Policy Summary
+ </dt>
+ <dd>
+ {% if relay['exit_policy_summary'] -%}
+ {%- set v4_summary = relay['exit_policy_summary'].items() -%}
+ <pre class="pre-scrollable">{% for k, v in v4_summary -%}
{{ k|escape }}: {{ '\n ' + v|join('\n ')|escape }}
{% endfor -%}
</pre>
-{% else -%}
-<pre>none</pre>
-{% endif -%}
-</dd>
-
-<dt>IPv6 Exit Policy Summary</dt>
-<dd>
-{% if relay['exit_policy_v6_summary'] -%}
-{%- set v6_summary = relay['exit_policy_v6_summary'].items() -%}
-<pre class="pre-scrollable">{% for k, v in v6_summary -%}
+ {% else -%}
+ <pre>none</pre>
+ {% endif -%}
+ </dd>
+ <dt>
+ IPv6 Exit Policy Summary
+ </dt>
+ <dd>
+ {% if relay['exit_policy_v6_summary'] -%}
+ {%- set v6_summary = relay['exit_policy_v6_summary'].items() -%}
+ <pre class="pre-scrollable">{% for k, v in v6_summary -%}
{{ k|escape }}: {{ '\n ' + v|join('\n ')|escape }}
{% endfor -%}
</pre>
-{% else -%}
-<pre>none</pre>
-{% endif -%}
-</dd>
-
-<dt>Exit Policy</dt>
-<dd><pre class="pre-scrollable">{% for policy in relay['exit_policy'] -%}
+ {% else -%}
+ <pre>none</pre>
+ {% endif -%}
+ </dd>
+ <dt>
+ Exit Policy
+ </dt>
+ <dd>
+ <pre class="pre-scrollable">{% for policy in relay['exit_policy'] -%}
{{ policy|escape }}
{% endfor -%}
-</pre></dd>
-
-{% if relay['effective_family']|length > 1 -%}
-<dt>Effective Family Members (<a href="{{ path_prefix }}family/{{
-relay['fingerprint']|escape }}">view</a>)</dt>
-{% else -%}
-<dt>Effective Family Members</dt>
-{% endif -%}
-<dd><pre class="pre-scrollable">{% for e_relay in relay['effective_family'] -%}
+</pre>
+ </dd>
+ {% if relay['effective_family']|length > 1 -%}
+ <dt>
+ Effective Family Members (<a href="{{ path_prefix }}family/{{ relay['fingerprint']|escape }}">view</a>)
+ </dt>
+ {% else -%}
+ <dt>
+ Effective Family Members
+ </dt>
+ {% endif -%}
+ <dd>
+ <pre class="pre-scrollable">{% for e_relay in relay['effective_family'] -%}
{% if relay['effective_family']|length > 1 -%}
<a href="{{ e_relay|escape }}.html">{{ e_relay|escape }}</a>
{% else -%}
{{ e_relay|escape }}
{% endif -%}
{% endfor -%}
-</pre></dd>
-
-<dt>Alleged Family Members</dt>
-<dd>
-{% if relay['alleged_family'] -%}
-<pre class="pre-scrollable">{% for a_relay in relay['alleged_family'] -%}
+</pre>
+ </dd>
+ <dt>
+ Alleged Family Members
+ </dt>
+ <dd>
+ {% if relay['alleged_family'] -%}
+ <pre class="pre-scrollable">{% for a_relay in relay['alleged_family'] -%}
{% if relay['alleged_family']|length > 1 -%}
<a href="{{ a_relay|escape }}.html">{{ a_relay|escape }}</a>
{% else -%}
@@ -107,86 +147,106 @@ relay['fingerprint']|escape }}">view</a>)</dt>
{% else -%}
<pre class="pre-scrollable">none
{% endif -%}
-</pre></dd>
+</pre>
+</dd>
</dl>
</div>
<div class="col-md-6">
<dl>
-<dt>Fingerprint</dt>
-<dd><pre>{{ relay['fingerprint']|escape }}</pre></dd>
-
-<dt>Flags</dt>
+<dt>
+Fingerprint
+</dt>
<dd>
-{% for flag in relay['flags'] -%}
-{% if flag != 'StaleDesc' -%}
-<a href="{{ path_prefix }}flag/{{ flag.lower()|escape }}"><img src="{{
-path_prefix}}static/images/flags/{{ flag.lower()|escape }}.png" title="{{
-flag|escape }}" alt="{{ flag|escape }}"></a> {{ flag|escape }}
-{% endif -%}
-{% endfor -%}
-</dd>
-
-<dt>Host Name</dt>
-<dd>
-{% if relay['verified_host_names'] -%}
-<pre class="verified-hostname" title="verified hostname">{{
+<pre>{{ relay['fingerprint']|escape }}</pre>
+ </dd>
+ <dt>
+ Flags
+ </dt>
+ <dd>
+ {% for flag in relay['flags'] -%}
+ {% if flag != 'StaleDesc' -%}
+ <a href="{{ path_prefix }}flag/{{ flag.lower()|escape }}">
+ <img src="{{ path_prefix }}static/images/flags/{{ flag.lower()|escape }}.png"
+ title="{{ flag|escape }}"
+ alt="{{ flag|escape }}">
+ </a> {{ flag|escape }}
+ {% endif -%}
+ {% endfor -%}
+ </dd>
+ <dt>
+ Host Name
+ </dt>
+ <dd>
+ {% if relay['verified_host_names'] -%}
+ <pre class="verified-hostname" title="verified hostname">{{
relay['verified_host_names']|join('\n')|escape }}</pre>
-{% elif relay['unverified_host_names'] -%}
-<pre class="unverified-hostname" title="unverified hostname">{{
+ {% elif relay['unverified_host_names'] -%}
+ <pre class="unverified-hostname" title="unverified hostname">{{
relay['unverified_host_names']|join('\n')|escape }}</pre>
-{% else -%}
-<pre>none</pre>
-{% endif -%}
-
-<dt>Country</dt>
-<dd>
-{% if relay['country'] -%}
-<a href="{{ path_prefix }}country/{{ relay['country']|escape }}/"><img src="{{
-path_prefix }}static/images/cc/{{ relay['country']|escape }}.png" title="{{
-relay['country_name']|escape }}" alt="{{ relay['country_name']|escape
-}}"></a> {{ relay['country_name']|escape }}
-{% else -%}
-unknown
-{% endif -%}
-</dd>
-
-<dt>AS Number</dt>
-<dd>
-{% if relay['as'] -%}
-<a href='{{ path_prefix }}as/{{ relay['as']|escape }}'>{{ relay['as']|escape
-}}</a>
-{% else -%}
-unknown
-{% endif -%}
-
-<dt>AS Name</dt>
-<dd>
-{% if relay['as_name'] -%}
-{{ relay['as_name']|escape }} (<a href='https://bgp.he.net/{{ relay['as']|escape
-}}'>BGP</a>)
-{% else -%}
-unknown
-{% endif -%}
-
-<dt>First Seen</dt>
-<dd><a href="{{ path_prefix }}first_seen/{{ relay['first_seen'].split(' ',
-1)[0]|escape }}">{{ relay['first_seen']|escape }}</a></dd>
-
-<dt>Last Restarted</dt>
-<dd>{{ relay['last_restarted']|escape }}</dd>
-
-<dt>Consensus Weight</dt>
-<dd>{{ relay['consensus_weight_fraction']|escape }} ({{
-relay['consensus_weight']|escape }})</dd>
-
-<dt>Platform</dt>
-<dd>
-<a href='{{ path_prefix}}platform/{{ relay['platform']|escape }}'>{{
-relay['platform'] }}</a>
-</dd>
-
-</dl>
-</div>
-</div>
-</div>
-{% endblock -%}
+ {% else -%}
+ <pre>none</pre>
+ {% endif -%}
+ <dt>
+ Country
+ </dt>
+ <dd>
+ {% if relay['country'] -%}
+ <a href="{{ path_prefix }}country/{{ relay['country']|escape }}/">
+ <img src="{{ path_prefix }}static/images/cc/{{ relay['country']|escape }}.png"
+ title="{{ relay['country_name']|escape }}"
+ alt="{{ relay['country_name']|escape }}">
+ </a> {{ relay['country_name']|escape }}
+ {% else -%}
+ unknown
+ {% endif -%}
+ </dd>
+ <dt>
+ AS Number
+ </dt>
+ <dd>
+ {% if relay['as'] -%}
+ <a href='{{ path_prefix }}as/{{ relay['as']|escape }}'>{{ relay['as']|escape
+ }}</a>
+ {% else -%}
+ unknown
+ {% endif -%}
+ <dt>
+ AS Name
+ </dt>
+ <dd>
+ {% if relay['as_name'] -%}
+ {{ relay['as_name']|escape }} (<a href='https://bgp.he.net/{{ relay['as']|escape }}'>BGP</a>)
+ {% else -%}
+ unknown
+ {% endif -%}
+ <dt>
+ First Seen
+ </dt>
+ <dd>
+ <a href="{{ path_prefix }}first_seen/{{ relay['first_seen'].split(' ', 1)[0]|escape }}">{{ relay['first_seen']|escape }}</a>
+ </dd>
+ <dt>
+ Last Restarted
+ </dt>
+ <dd>
+ {{ relay['last_restarted']|escape }}
+ </dd>
+ <dt>
+ Consensus Weight
+ </dt>
+ <dd>
+ {{ relay['consensus_weight_fraction']|escape }} ({{
+ relay['consensus_weight']|escape }})
+ </dd>
+ <dt>
+ Platform
+ </dt>
+ <dd>
+ <a href='{{ path_prefix }}platform/{{ relay['platform']|escape }}'>{{
+ relay['platform'] }}</a>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+ {% endblock -%}
diff --git a/allium/templates/relay-list.html b/allium/templates/relay-list.html
index 16be960..658d608 100644
--- a/allium/templates/relay-list.html
+++ b/allium/templates/relay-list.html
@@ -1,128 +1,162 @@
{% extends "skeleton.html" -%}
-{% block title -%}Tor Relays{% endblock -%}
-{% block body -%}
-<h2>{% block header -%}{% endblock -%}</h2>
-<p>{% block description -%}{% endblock -%}</p>
-<table class="table table-condensed">
-<tr>
-<th></th>
-<th>Nickname</th>
-<th>Contact</th>
-<th>Bandwidth</th>
-<th class="visible-md visible-lg">IP Address</th>
-<th>AS Number</th>
-<th>AS Name</th>
-<th>Country</th>
-<th>Platform</th>
-<th class="visible-md visible-lg">Flags</th>
-<th class="visible-md visible-lg">First Seen</th>
-</tr>
-<tbody>
-{% if is_index -%}{% set relay_list = relays.json['relay_subset'][:500] -%}
-{% else -%}{% set relay_list = relays.json['relay_subset'] -%}{% endif -%}
-{% for relay in relay_list -%}
-<tr>
-{% if relay['observed_bandwidth'] > 1000000 -%}
-{% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth']
-/ 1000000)|round(2, 'common'), 'MB/s') -%}
-{% else -%}
-{% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth'] / 1000)|
-round(2, 'common'), 'KB/s') -%}{% endif -%}
-
-{% if relay['running'] -%}
-<td><span class="circle circle-online" title="This relay is online"></span></td>
-{% else -%}
-<td><span class="circle circle-offline" title="This relay is offline"></span>
-</td>
-{% endif -%}
-
-{% if relay['effective_family']|length > 1 -%}
-<td title="{{ relay['nickname']|escape }}"><a href="{{ path_prefix }}relay/{{
-relay['fingerprint']|escape }}.html">{{ relay['nickname']|truncate(8)|escape
-}}</a> (<a href="{{ path_prefix }}family/{{ relay['fingerprint']|escape }}/">{{
-relay['effective_family']| length }}</a>)</td>
-{% else -%}
-<td title="{{ relay['nickname']|escape }}"><a href="{{ path_prefix}}relay/{{
-relay['fingerprint']|escape }}.html">{{ relay['nickname']|truncate(10)|escape
-}}</a></td>
-{% endif -%}
-
-{% if key != 'contact' -%}
-{% if relay['contact'] -%}
-<td><code><a href="{{ path_prefix }}contact/{{ relay['contact_md5'] }}/"
-title="{{ relay['contact']|escape }}">{{ relay['contact_md5'][0:8]
-}}</a></code></td>
-{% else -%}
-<td title="none"><code>none</code></td>
-{% endif -%}
-{% else -%}
-<td title="{{ relay['contact']|escape }}"><code>{{ relay['contact_md5'][0:8]
-}}</code></td>
-{% endif -%}
-
-<td>{{ obs_bandwidth }}</td>
-
-<td class="visible-md visible-lg"><a href="https://bgp.he.net/ip/{{
-relay['or_addresses'][0].split(':', 1)[0]|escape }}">{{
-relay['or_addresses'][0].split(':', 1)[0]|escape }}</a></td>
-
-{% if relay['as'] -%}
-{% if key != 'as' -%}
-<td><a href="{{ path_prefix }}as/{{ relay['as']|escape }}/">{{
-relay['as']|escape }}</a></td>
-{% else -%}
-<td>{{ relay['as']|escape }}</td>
-{% endif -%}
-{% else -%}
-<td>Unknown</td>
-{% endif -%}
-
-{% if relay['as_name'] -%}
-<td><a href="https://bgp.he.net/{{ relay['as']|escape }}" title="{{
-relay['as_name']|escape }}">{{
-relay['as_name']|escape|truncate(length=20) }}</a></td>
-{% else -%}
-<td>Unknown</td>
-{% endif -%}
-
-{% if relay['country'] -%}
-{% if key != 'country' -%}
-<td><a href="{{ path_prefix }}country/{{ relay['country']|escape }}/"><img
-src="{{ path_prefix }}static/images/cc/{{ relay['country']|escape
-}}.png" title="{{ relay['country_name']|escape }}" alt="{{
-relay['country_name']|escape }}"></a></td>
-{% else -%}
-<td><img src="{{ path_prefix }}static/images/cc/{{ relay['country']|escape
-}}.png" title="{{ relay['country_name']|escape }}" alt="{{
-relay['country_name']|escape }}"></td>
-{% endif -%}
-{% else -%}
-<td>X</td>
-{% endif -%}
-
-{% if key != 'platform' -%}
-<td><a href="{{ path_prefix }}platform/{{ relay['platform']|escape }}/">{{
-relay['platform']|truncate(length=10)|escape }}</a></td>
-{% else -%}
-<td>{{ relay['platform']|truncate(length=10)|escape }}</td>
-{% endif -%}
-
-<td class="visible-md visible-lg">{% for flag in relay['flags'] -%}{% if flag != 'StaleDesc' -%}<a href="{{
-path_prefix }}flag/{{ flag.lower()|escape }}"><img src="{{
-path_prefix}}static/images/flags/{{ flag.lower()|escape }}.png"
-title="{{ flag|escape }}" alt="{{ flag|escape }}"></a> {% endif -%}{% endfor
--%}</td>
-
-{% if key != 'first_seen' -%}
-<td class="visible-md visible-lg"><a href="{{ path_prefix }}first_seen/{{
-relay['first_seen'].split(' ', 1)[0]|escape }}">{{
-relay['first_seen'].split(' ', 1)[0]|escape }}</a></td>
-{% else -%}
-<td class="visible-md visible-lg">{{ relay['first_seen'].split(' ', 1)[0]|escape
-}}</td>
-{% endif -%}
-</tr>
-{% endfor -%}
-</tbody>
-</table>
+{% block title -%}
+ Tor Relays
{% endblock -%}
+{% block body -%}
+ <h2>
+ {% block header -%}
+ {% endblock -%}
+ </h2>
+ <p>
+ {% block description -%}
+ {% endblock -%}
+ </p>
+ <table class="table table-condensed">
+ <tr>
+ <th></th>
+ <th>Nickname</th>
+ <th>Contact</th>
+ <th>Bandwidth</th>
+ <th class="visible-md visible-lg">IP Address</th>
+ <th>AS Number</th>
+ <th>AS Name</th>
+ <th>Country</th>
+ <th>Platform</th>
+ <th class="visible-md visible-lg">Flags</th>
+ <th class="visible-md visible-lg">First Seen</th>
+ </tr>
+ <tbody>
+ {% if is_index -%}
+ {% set relay_list = relays.json['relay_subset'][:500] -%}
+ {% else -%}
+ {% set relay_list = relays.json['relay_subset'] -%}
+ {% endif -%}
+ {% for relay in relay_list -%}
+ <tr>
+ {% if relay['observed_bandwidth'] > 1000000 -%}
+ {% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth']
+ / 1000000)|round(2, 'common'), 'MB/s') -%}
+ {% else -%}
+ {% set obs_bandwidth = '%s %s'|format((relay['observed_bandwidth'] / 1000)|
+ round(2, 'common'), 'KB/s') -%}
+ {% endif -%}
+ {% if relay['running'] -%}
+ <td>
+ <span class="circle circle-online" title="This relay is online"></span>
+ </td>
+ {% else -%}
+ <td>
+ <span class="circle circle-offline" title="This relay is offline"></span>
+ </td>
+ {% endif -%}
+ {% if relay['effective_family']|length > 1 -%}
+ <td title="{{ relay['nickname']|escape }}">
+ <a href="{{ path_prefix }}relay/{{ relay['fingerprint']|escape }}.html">{{ relay['nickname']|truncate(8)|escape
+ }}</a> (<a href="{{ path_prefix }}family/{{ relay['fingerprint']|escape }}/">{{
+ relay['effective_family']| length }}</a>)
+ </td>
+ {% else -%}
+ <td title="{{ relay['nickname']|escape }}">
+ <a href="{{ path_prefix }}relay/{{ relay['fingerprint']|escape }}.html">{{ relay['nickname']|truncate(10)|escape
+ }}</a>
+ </td>
+ {% endif -%}
+ {% if key != 'contact' -%}
+ {% if relay['contact'] -%}
+ <td>
+ <code><a href="{{ path_prefix }}contact/{{ relay['contact_md5'] }}/"
+ title="{{ relay['contact']|escape }}">{{ relay['contact_md5'][0:8]
+ }}</a></code>
+ </td>
+ {% else -%}
+ <td title="none">
+ <code>none</code>
+ </td>
+ {% endif -%}
+ {% else -%}
+ <td title="{{ relay['contact']|escape }}">
+ <code>{{ relay['contact_md5'][0:8]
+ }}</code>
+ </td>
+ {% endif -%}
+ <td>{{ obs_bandwidth }}</td>
+ <td class="visible-md visible-lg">
+ <a href="https://bgp.he.net/ip/{{ relay['or_addresses'][0].split(':', 1)[0]|escape }}">{{
+ relay['or_addresses'][0].split(':', 1)[0]|escape }}</a>
+ </td>
+ {% if relay['as'] -%}
+ {% if key != 'as' -%}
+ <td>
+ <a href="{{ path_prefix }}as/{{ relay['as']|escape }}/">{{
+ relay['as']|escape }}</a>
+ </td>
+ {% else -%}
+ <td>{{ relay['as']|escape }}</td>
+ {% endif -%}
+ {% else -%}
+ <td>Unknown</td>
+ {% endif -%}
+ {% if relay['as_name'] -%}
+ <td>
+ <a href="https://bgp.he.net/{{ relay['as']|escape }}"
+ title="{{ relay['as_name']|escape }}">{{
+ relay['as_name']|escape|truncate(length=20) }}</a>
+ </td>
+ {% else -%}
+ <td>Unknown</td>
+ {% endif -%}
+ {% if relay['country'] -%}
+ {% if key != 'country' -%}
+ <td>
+ <a href="{{ path_prefix }}country/{{ relay['country']|escape }}/">
+ <img src="{{ path_prefix }}static/images/cc/{{ relay['country']|escape }}.png"
+ title="{{ relay['country_name']|escape }}"
+ alt="{{ relay['country_name']|escape }}">
+ </a>
+ </td>
+ {% else -%}
+ <td>
+ <img src="{{ path_prefix }}static/images/cc/{{ relay['country']|escape }}.png"
+ title="{{ relay['country_name']|escape }}"
+ alt="{{ relay['country_name']|escape }}">
+ </td>
+ {% endif -%}
+ {% else -%}
+ <td>X</td>
+ {% endif -%}
+ {% if key != 'platform' -%}
+ <td>
+ <a href="{{ path_prefix }}platform/{{ relay['platform']|escape }}/">{{
+ relay['platform']|truncate(length=10)|escape }}</a>
+ </td>
+ {% else -%}
+ <td>{{ relay['platform']|truncate(length=10)|escape }}</td>
+ {% endif -%}
+ <td class="visible-md visible-lg">
+ {% for flag in relay['flags'] -%}
+ {% if flag != 'StaleDesc' -%}
+ <a href="{{ path_prefix }}flag/{{ flag.lower()|escape }}">
+ <img src="{{ path_prefix }}static/images/flags/{{ flag.lower()|escape }}.png"
+ title="{{ flag|escape }}"
+ alt="{{ flag|escape }}">
+ </a>
+ {% endif -%}
+ {% endfor
+ -%}
+ </td>
+ {% if key != 'first_seen' -%}
+ <td class="visible-md visible-lg">
+ <a href="{{ path_prefix }}first_seen/{{ relay['first_seen'].split(' ', 1)[0]|escape }}">{{
+ relay['first_seen'].split(' ', 1)[0]|escape }}</a>
+ </td>
+ {% else -%}
+ <td class="visible-md visible-lg">
+ {{ relay['first_seen'].split(' ', 1)[0]|escape
+ }}
+ </td>
+ {% endif -%}
+ </tr>
+ {% endfor -%}
+ </tbody>
+ </table>
+ {% endblock -%}
diff --git a/allium/templates/skeleton.html b/allium/templates/skeleton.html
index 94c6c20..28278a7 100644
--- a/allium/templates/skeleton.html
+++ b/allium/templates/skeleton.html
@@ -1,57 +1,63 @@
{% block head %}
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <title>{% block title %}{% endblock %}</title>
- <meta name="description" content="Javascript-free Tor metrics generated from
- an hourly API request.">
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="{{ path_prefix }}static/css/bootstrap.min.css">
- <!--source: metrics.torproject.org-->
- <style>
- .circle {
- display: inline-block;
- vertical-align: middle;
- background: #999999;
- width: 7px;
- height: 7px;
- -moz-border-radius: 50%;
- -webkit-border-radius: 50%;
- border-radius: 50%;
- }
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+ <title>
+ {% block title %}{% endblock %}
+ </title>
+ <meta name="description"
+ content="Javascript-free Tor metrics generated from an hourly API request.">
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <link rel="stylesheet" href="{{ path_prefix }}static/css/bootstrap.min.css">
+ <!--source: metrics.torproject.org-->
+ <style>
+ .circle {
+ display: inline-block;
+ vertical-align: middle;
+ background: #999999;
+ width: 7px;
+ height: 7px;
+ -moz-border-radius: 50%;
+ -webkit-border-radius: 50%;
+ border-radius: 50%;
+ }
- .circle-online {
- background: #25d918;
- }
+ .circle-online {
+ background: #25d918;
+ }
- .circle-offline {
- background: #ff1515;
- }
- .verified-hostname {
- color: #FE9F30;
- }
- .verified-hostname {
- color: #68b030;
- }
- .unverified-hostname {
- color: #FE9F30;
- }
- </style>
-</head>
-{% endblock %}
-<body>
-<div class="container">
-{% block body %}
-{% endblock %}
-</div>
-</body>
-{% block footer %}
-<footer class="page-footer font-small">
-<div class="footer-copyright text-center text-muted">
-<p>generated by <a href="https://github.com/tempname1024/allium">allium</a> on
-{{ relays.timestamp }}</p>
-</div>
-</footer>
-</html>
+ .circle-offline {
+ background: #ff1515;
+ }
+
+ .verified-hostname {
+ color: #FE9F30;
+ }
+
+ .verified-hostname {
+ color: #68b030;
+ }
+
+ .unverified-hostname {
+ color: #FE9F30;
+ }
+ </style>
+ </head>
+ {% endblock %}
+ <body>
+ <div class="container">
+ {% block body %}{% endblock %}
+ </div>
+ </body>
+ {% block footer %}
+ <footer class="page-footer font-small">
+ <div class="footer-copyright text-center text-muted">
+ <p>
+ generated by <a href="https://github.com/tempname1024/allium">allium</a> on
+ {{ relays.timestamp }}
+ </p>
+ </div>
+ </footer>
+ </html>
{% endblock %}