From 886d2934ec672e0d4533f73e8b38248fdff9a6d5 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 8 Nov 2014 14:12:32 -0600 Subject: Break out available URLs into Jinja2 template Signed-off-by: Dan McGee --- templates/mirrors/mirror_details.html | 38 +----------------------- templates/mirrors/mirror_details_urls.html.jinja | 36 ++++++++++++++++++++++ templates/mirrors/url_details.html | 2 +- templates/mirrors/url_details_logs.html.jinja | 2 -- 4 files changed, 38 insertions(+), 40 deletions(-) create mode 100644 templates/mirrors/mirror_details_urls.html.jinja (limited to 'templates/mirrors') diff --git a/templates/mirrors/mirror_details.html b/templates/mirrors/mirror_details.html index e4ae55b4..64009380 100644 --- a/templates/mirrors/mirror_details.html +++ b/templates/mirrors/mirror_details.html @@ -93,43 +93,7 @@

Available URLs

- - - - - - - - - - - - - - - - - - - - {% for m_url in urls %} - - - - - - - - - - - - - - - {% endfor %} - -
Mirror URLProtocolCountryIPv4IPv6Last SyncCompletion %μ Delay (hh:mm)μ Duration (s)σ Duration (s)ScoreDetails
{% if m_url.protocol.is_download %}{{ m_url.url }}{% else %}{{ m_url.url }}{% endif %}{{ m_url.protocol }}{% country_flag m_url.country %}{{ m_url.country.name }}{{ m_url.has_ipv4|yesno|capfirst }}{{ m_url.has_ipv6|yesno|capfirst }}{{ m_url.last_sync|date:'Y-m-d H:i'|default:'unknown' }}{{ m_url.completion_pct|percentage:1 }}{{ m_url.delay|duration|default:'unknown' }}{{ m_url.duration_avg|floatvalue:2 }}{{ m_url.duration_stddev|floatvalue:2 }}{{ m_url.score|floatvalue:1|default:'∞' }}Details
+ {% include "mirrors/mirror_details_urls.html.jinja" %}

Error Log

{% include "mirrors/error_table.html.jinja" %} diff --git a/templates/mirrors/mirror_details_urls.html.jinja b/templates/mirrors/mirror_details_urls.html.jinja new file mode 100644 index 00000000..7ab1548b --- /dev/null +++ b/templates/mirrors/mirror_details_urls.html.jinja @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + {% for m_url in urls %} + + + + + + + + + + + + + + + {% endfor %} + +
Mirror URLProtocolCountryIPv4IPv6Last SyncCompletion %μ Delay (hh:mm)μ Duration (s)σ Duration (s)ScoreDetails
{% if m_url.protocol.is_download %}{{ m_url.url }}{% else %}{{ m_url.url }}{% endif %}{{ m_url.protocol }}{{ country_flag(m_url.country) }}{{ m_url.country.name }}{{ m_url.has_ipv4|yesno|capfirst }}{{ m_url.has_ipv6|yesno|capfirst }}{{ m_url.last_sync|date('Y-m-d H:i')|default('unknown') }}{{ m_url.completion_pct|percentage(1) }}{{ m_url.delay|duration|default('unknown') }}{{ m_url.duration_avg|floatvalue(2) }}{{ m_url.duration_stddev|floatvalue(2) }}{{ m_url.score|floatvalue(1)|default('∞') }}Details
diff --git a/templates/mirrors/url_details.html b/templates/mirrors/url_details.html index 8b7646b8..b61033cd 100644 --- a/templates/mirrors/url_details.html +++ b/templates/mirrors/url_details.html @@ -56,8 +56,8 @@ {% endif %} +

Check Logs

{% include "mirrors/url_details_logs.html.jinja" %} - {% endblock %} diff --git a/templates/mirrors/url_details_logs.html.jinja b/templates/mirrors/url_details_logs.html.jinja index 09742f76..58f179d8 100644 --- a/templates/mirrors/url_details_logs.html.jinja +++ b/templates/mirrors/url_details_logs.html.jinja @@ -1,5 +1,3 @@ -

Check Logs

- -- cgit v1.2.3-2-g168b