From 7f6a05fc2bd7e611c2f9e11dc5960868df482d3c Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 25 Jan 2023 21:11:28 -0700 Subject: templates: make them human-readable, housekeeping --- allium/templates/relay-list.html | 286 ++++++++++++++++++++++----------------- 1 file changed, 160 insertions(+), 126 deletions(-) (limited to 'allium/templates/relay-list.html') 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 -%} -

{% block header -%}{% endblock -%}

-

{% block description -%}{% endblock -%}

- - - - - - - - - - - - - - - -{% 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 -%} - -{% 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'] -%} - -{% else -%} - -{% endif -%} - -{% if relay['effective_family']|length > 1 -%} - -{% else -%} - -{% endif -%} - -{% if key != 'contact' -%} -{% if relay['contact'] -%} - -{% else -%} - -{% endif -%} -{% else -%} - -{% endif -%} - - - - - -{% if relay['as'] -%} -{% if key != 'as' -%} - -{% else -%} - -{% endif -%} -{% else -%} - -{% endif -%} - -{% if relay['as_name'] -%} - -{% else -%} - -{% endif -%} - -{% if relay['country'] -%} -{% if key != 'country' -%} - -{% else -%} - -{% endif -%} -{% else -%} - -{% endif -%} - -{% if key != 'platform' -%} - -{% else -%} - -{% endif -%} - - - -{% if key != 'first_seen' -%} - -{% else -%} - -{% endif -%} - -{% endfor -%} - -
NicknameContactBandwidthIP AddressAS NumberAS NameCountryPlatformFlagsFirst Seen
-{{ relay['nickname']|truncate(8)|escape -}} ({{ -relay['effective_family']| length }}){{ relay['nickname']|truncate(10)|escape -}}{{ relay['contact_md5'][0:8] -}}none{{ relay['contact_md5'][0:8] -}}{{ obs_bandwidth }}{{ -relay['or_addresses'][0].split(':', 1)[0]|escape }}{{ -relay['as']|escape }}{{ relay['as']|escape }}Unknown{{ -relay['as_name']|escape|truncate(length=20) }}Unknown{{
-relay['country_name']|escape }}{{
-relay['country_name']|escape }}X{{ -relay['platform']|truncate(length=10)|escape }}{{ relay['platform']|truncate(length=10)|escape }}{% for flag in relay['flags'] -%}{% if flag != 'StaleDesc' -%}{{ flag|escape }} {% endif -%}{% endfor --%}{{ -relay['first_seen'].split(' ', 1)[0]|escape }}{{ relay['first_seen'].split(' ', 1)[0]|escape -}}
+{% block title -%} + Tor Relays {% endblock -%} +{% block body -%} +

+ {% block header -%} + {% endblock -%} +

+

+ {% block description -%} + {% endblock -%} +

+ + + + + + + + + + + + + + + + {% 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 -%} + + {% 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'] -%} + + {% else -%} + + {% endif -%} + {% if relay['effective_family']|length > 1 -%} + + {% else -%} + + {% endif -%} + {% if key != 'contact' -%} + {% if relay['contact'] -%} + + {% else -%} + + {% endif -%} + {% else -%} + + {% endif -%} + + + {% if relay['as'] -%} + {% if key != 'as' -%} + + {% else -%} + + {% endif -%} + {% else -%} + + {% endif -%} + {% if relay['as_name'] -%} + + {% else -%} + + {% endif -%} + {% if relay['country'] -%} + {% if key != 'country' -%} + + {% else -%} + + {% endif -%} + {% else -%} + + {% endif -%} + {% if key != 'platform' -%} + + {% else -%} + + {% endif -%} + + {% if key != 'first_seen' -%} + + {% else -%} + + {% endif -%} + + {% endfor -%} + +
NicknameContactBandwidthIP AddressAS NumberAS NameCountryPlatformFlagsFirst Seen
+ + + + + {{ relay['nickname']|truncate(8)|escape + }} ({{ + relay['effective_family']| length }}) + + {{ relay['nickname']|truncate(10)|escape + }} + + {{ relay['contact_md5'][0:8] + }} + + none + + {{ relay['contact_md5'][0:8] + }} + {{ obs_bandwidth }} + {{ + relay['or_addresses'][0].split(':', 1)[0]|escape }} + + {{ + relay['as']|escape }} + {{ relay['as']|escape }}Unknown + {{ + relay['as_name']|escape|truncate(length=20) }} + Unknown + + {{ relay['country_name']|escape }} + + + {{ relay['country_name']|escape }} + X + {{ + relay['platform']|truncate(length=10)|escape }} + {{ relay['platform']|truncate(length=10)|escape }} + {% for flag in relay['flags'] -%} + {% if flag != 'StaleDesc' -%} + + {{ flag|escape }} + + {% endif -%} + {% endfor + -%} + + {{ + relay['first_seen'].split(' ', 1)[0]|escape }} + + {{ relay['first_seen'].split(' ', 1)[0]|escape + }} +
+ {% endblock -%} -- cgit v1.2.3-54-g00ecf