diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-16 01:16:52 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-16 01:16:52 -0400 |
commit | 7aabbe788bb4e26ee9c7cfc0e18692b487e11099 (patch) | |
tree | e1032beb86e35caafb164e694d2aa7e2e9664de2 /templates/mirrors | |
parent | 046e6c8b6152a8142ed838e5c406cc04c18f2533 (diff) | |
parent | 155bf43a28e404f327a7bcff214c22e212627673 (diff) |
Merge branch 'archweb-generic'
Diffstat (limited to 'templates/mirrors')
-rw-r--r-- | templates/mirrors/error_table.html.jinja (renamed from templates/mirrors/error_table.html) | 8 | ||||
-rw-r--r-- | templates/mirrors/mirror_details.html | 40 | ||||
-rw-r--r-- | templates/mirrors/mirror_details_urls.html.jinja | 36 | ||||
-rw-r--r-- | templates/mirrors/status.html | 6 | ||||
-rw-r--r-- | templates/mirrors/status_table.html | 30 | ||||
-rw-r--r-- | templates/mirrors/status_table.html.jinja | 28 | ||||
-rw-r--r-- | templates/mirrors/url_details.html | 29 | ||||
-rw-r--r-- | templates/mirrors/url_details_logs.html.jinja | 26 |
8 files changed, 99 insertions, 104 deletions
diff --git a/templates/mirrors/error_table.html b/templates/mirrors/error_table.html.jinja index cd7265af..52f68135 100644 --- a/templates/mirrors/error_table.html +++ b/templates/mirrors/error_table.html.jinja @@ -1,5 +1,3 @@ -{% load cycle from future %} -{% load flags mirror_status %} <table id="errorlog_mirrors" class="results"> <thead> <tr> @@ -12,12 +10,12 @@ </tr> </thead> <tbody> - {% for log in error_logs %}<tr class="{% cycle 'odd' 'even' %}"> + {% for log in error_logs %}<tr class="{{ loop.cycle('odd', 'even') }}"> <td>{{ log.url__url }}</td> <td>{{ log.url__protocol__protocol }}</td> - <td class="country">{% country_flag log.country %}{{ log.country.name }}</td> + <td class="country">{{ country_flag(log.country) }}{{ log.country.name }}</td> <td class="wrap">{{ log.error|linebreaksbr }}</td> - <td>{{ log.last_occurred|date:'Y-m-d H:i' }}</td> + <td>{{ log.last_occurred|date('Y-m-d H:i') }}</td> <td>{{ log.error_count }}</td> </tr>{% endfor %} </tbody> diff --git a/templates/mirrors/mirror_details.html b/templates/mirrors/mirror_details.html index ffaacfe6..3220195d 100644 --- a/templates/mirrors/mirror_details.html +++ b/templates/mirrors/mirror_details.html @@ -90,46 +90,10 @@ </table> <h3>Available URLs</h3> - - <table id="available_urls" class="results"> - <thead> - <tr> - <th>Mirror URL</th> - <th>Protocol</th> - <th>Country</th> - <th>IPv4</th> - <th>IPv6</th> - <th>Last Sync</th> - <th>Completion %</th> - <th>μ Delay (hh:mm)</th> - <th>μ Duration (s)</th> - <th>σ Duration (s)</th> - <th>Score</th> - <th>Details</th> - </tr> - </thead> - <tbody> - {% for m_url in urls %} - <tr class="{% cycle 'odd' 'even' %}"> - <td>{% if m_url.protocol.is_download %}<a href="{{ m_url.url }}">{{ m_url.url }}</a>{% else %}{{ m_url.url }}{% endif %}</td> - <td>{{ m_url.protocol }}</td> - <td class="country">{% country_flag m_url.country %}{{ m_url.country.name }}</td> - <td>{{ m_url.has_ipv4|yesno|capfirst }}</td> - <td>{{ m_url.has_ipv6|yesno|capfirst }}</td> - <td>{{ m_url.last_sync|date:'Y-m-d H:i'|default:'unknown' }}</td> - <td>{{ m_url.completion_pct|percentage:1 }}</td> - <td>{{ m_url.delay|duration|default:'unknown' }}</td> - <td>{{ m_url.duration_avg|floatvalue:2 }}</td> - <td>{{ m_url.duration_stddev|floatvalue:2 }}</td> - <td>{{ m_url.score|floatvalue:1|default:'∞' }}</td> - <td><a href="{{ m_url.id }}/">Details</a></td> - </tr> - {% endfor %} - </tbody> - </table> + {% include "mirrors/mirror_details_urls.html.jinja" %} <h3>Error Log</h3> - {% include "mirrors/error_table.html" %} + {% include "mirrors/error_table.html.jinja" %} </div> <div class="box"> 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 @@ +<table id="available_urls" class="results"> + <thead> + <tr> + <th>Mirror URL</th> + <th>Protocol</th> + <th>Country</th> + <th>IPv4</th> + <th>IPv6</th> + <th>Last Sync</th> + <th>Completion %</th> + <th>μ Delay (hh:mm)</th> + <th>μ Duration (s)</th> + <th>σ Duration (s)</th> + <th>Score</th> + <th>Details</th> + </tr> + </thead> + <tbody> + {% for m_url in urls %} + <tr class="{{ loop.cycle('odd', 'even') }}"> + <td>{% if m_url.protocol.is_download %}<a href="{{ m_url.url }}">{{ m_url.url }}</a>{% else %}{{ m_url.url }}{% endif %}</td> + <td>{{ m_url.protocol }}</td> + <td class="country">{{ country_flag(m_url.country) }}{{ m_url.country.name }}</td> + <td>{{ m_url.has_ipv4|yesno|capfirst }}</td> + <td>{{ m_url.has_ipv6|yesno|capfirst }}</td> + <td>{{ m_url.last_sync|date('Y-m-d H:i')|default('unknown') }}</td> + <td>{{ m_url.completion_pct|percentage(1) }}</td> + <td>{{ m_url.delay|duration|default('unknown') }}</td> + <td>{{ m_url.duration_avg|floatvalue(2) }}</td> + <td>{{ m_url.duration_stddev|floatvalue(2) }}</td> + <td>{{ m_url.score|floatvalue(1)|default('∞') }}</td> + <td><a href="{{ m_url.id }}/">Details</a></td> + </tr> + {% endfor %} + </tbody> +</table> diff --git a/templates/mirrors/status.html b/templates/mirrors/status.html index 250d9bad..f11d57ca 100644 --- a/templates/mirrors/status.html +++ b/templates/mirrors/status.html @@ -60,18 +60,18 @@ <a name="outofsync" id="outofsync"></a> <h3>Out of Sync Mirrors</h3> {% with urls=bad_urls table_id='outofsync_mirrors' %} - {% include "mirrors/status_table.html" %} + {% include "mirrors/status_table.html.jinja" %} {% endwith %} <a name="successful" id="successful"></a> <h3>Successfully Syncing Mirrors</h3> {% with urls=good_urls table_id='successful_mirrors' %} - {% include "mirrors/status_table.html" %} + {% include "mirrors/status_table.html.jinja" %} {% endwith %} <a name="errorlog" id="errorlog"></a> <h3>Mirror Syncing Error Log</h3> - {% include "mirrors/error_table.html" %} + {% include "mirrors/error_table.html.jinja" %} </div> {% endblock %} diff --git a/templates/mirrors/status_table.html b/templates/mirrors/status_table.html deleted file mode 100644 index 83538303..00000000 --- a/templates/mirrors/status_table.html +++ /dev/null @@ -1,30 +0,0 @@ -{% load cycle from future %} -{% load flags mirror_status %} -<table id="{{ table_id }}" class="results"> - <thead> - <tr> - <th>Mirror URL</th> - <th>Protocol</th> - <th>Country</th> - <th>Completion %</th> - <th>μ Delay (hh:mm)</th> - <th>μ Duration (s)</th> - <th>σ Duration (s)</th> - <th>Mirror Score</th> - <th></th> - </tr> - </thead> - <tbody> - {% for m_url in urls %}<tr class="{% cycle 'odd' 'even' %}"> - <td>{{ m_url.url }}</td> - <td>{{ m_url.protocol }}</td> - <td class="country">{% country_flag m_url.country %}{{ m_url.country.name }}</td> - <td>{{ m_url.completion_pct|percentage:1 }}</td> - <td>{{ m_url.delay|duration|default:'unknown' }}</td> - <td>{{ m_url.duration_avg|floatvalue:2 }}</td> - <td>{{ m_url.duration_stddev|floatvalue:2 }}</td> - <td>{{ m_url.score|floatvalue:1|default:'∞' }}</td> - <td><a href="{{ m_url.get_absolute_url }}">details</a></td> - </tr>{% endfor %} - </tbody> -</table> diff --git a/templates/mirrors/status_table.html.jinja b/templates/mirrors/status_table.html.jinja new file mode 100644 index 00000000..598a1af0 --- /dev/null +++ b/templates/mirrors/status_table.html.jinja @@ -0,0 +1,28 @@ +<table id="{{ table_id }}" class="results"> + <thead> + <tr> + <th>Mirror URL</th> + <th>Protocol</th> + <th>Country</th> + <th>Completion %</th> + <th>μ Delay (hh:mm)</th> + <th>μ Duration (s)</th> + <th>σ Duration (s)</th> + <th>Mirror Score</th> + <th></th> + </tr> + </thead> + <tbody> + {% for m_url in urls %}<tr class="{{ loop.cycle('odd', 'even') }}"> + <td>{{ m_url.url }}</td> + <td>{{ m_url.protocol }}</td> + <td class="country">{{ country_flag(m_url.country) }}{{ m_url.country.name }}</td> + <td>{{ m_url.completion_pct|percentage(1) }}</td> + <td>{{ m_url.delay|duration|default('unknown') }}</td> + <td>{{ m_url.duration_avg|floatvalue(2) }}</td> + <td>{{ m_url.duration_stddev|floatvalue(2) }}</td> + <td>{{ m_url.score|floatvalue(1)|default('∞') }}</td> + <td><a href="{{ m_url.get_absolute_url() }}">details</a></td> + </tr>{% endfor %} + </tbody> +</table> diff --git a/templates/mirrors/url_details.html b/templates/mirrors/url_details.html index c47e0508..96fcc49d 100644 --- a/templates/mirrors/url_details.html +++ b/templates/mirrors/url_details.html @@ -1,5 +1,4 @@ {% extends "base.html" %} -{% load cycle from future %} {% load static from staticfiles %} {% load mirror_status %} {% load flags %} @@ -58,33 +57,7 @@ </table> <h3>Check Logs</h3> - - <table id="check_logs" class="results"> - <thead> - <tr> - <th>Check Time</th> - <th>Check Location</th> - <th>Check IP</th> - <th>Last Sync</th> - <th>Delay (hh:mm)</th> - <th>Duration (s)</th> - <th>Success?</th> - <th>Error Message</th> - </tr> - </thead> - <tbody> - {% for log in logs %}<tr class="{% cycle 'odd' 'even' %}"> - <td>{{ log.check_time|date:'Y-m-d H:i' }}</td> - <td class="country">{% country_flag log.location.country %}{{ log.location.country.name }}</td> - <td>{{ log.location.source_ip }}</td> - <td>{{ log.last_sync|date:'Y-m-d H:i' }}</td> - <td>{{ log.delay|duration }}</td> - <td>{{ log.duration|floatvalue }}</td> - <td>{{ log.is_success|yesno|capfirst }}</td> - <td class="wrap">{{ log.error|linebreaksbr }}</td> - </tr>{% endfor %} - </tbody> - </table> + {% include "mirrors/url_details_logs.html.jinja" %} </div> {% endblock %} diff --git a/templates/mirrors/url_details_logs.html.jinja b/templates/mirrors/url_details_logs.html.jinja new file mode 100644 index 00000000..58f179d8 --- /dev/null +++ b/templates/mirrors/url_details_logs.html.jinja @@ -0,0 +1,26 @@ +<table id="check_logs" class="results"> + <thead> + <tr> + <th>Check Time</th> + <th>Check Location</th> + <th>Check IP</th> + <th>Last Sync</th> + <th>Delay (hh:mm)</th> + <th>Duration (s)</th> + <th>Success?</th> + <th>Error Message</th> + </tr> + </thead> + <tbody> + {% for log in logs %}<tr class="{{ loop.cycle('odd', 'even') }}"> + <td>{{ log.check_time|date('Y-m-d H:i') }}</td> + <td class="country">{{ country_flag(log.location.country) }}{{ log.location.country.name }}</td> + <td>{{ log.location.source_ip }}</td> + <td>{{ log.last_sync|date('Y-m-d H:i') }}</td> + <td>{{ log.delay|duration }}</td> + <td>{{ log.duration|floatvalue }}</td> + <td>{{ log.is_success|yesno|capfirst }}</td> + <td class="wrap">{{ log.error|linebreaksbr }}</td> + </tr>{% endfor %} + </tbody> +</table> |