From e557545ca803fa215b3a7f43f4c421dff1259fe3 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 27 Nov 2013 16:00:49 -0500 Subject: Use pkg_details_link tag on differences report page Signed-off-by: Dan McGee --- templates/packages/differences.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/packages/differences.html b/templates/packages/differences.html index f137126d..f4d93151 100644 --- a/templates/packages/differences.html +++ b/templates/packages/differences.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% load cycle from future %} {% load static from staticfiles %} +{% load package_extras %} {% block title %}Arch Linux - Package Differences Reports{% endblock %} {% block navbarclass %}anb-packages{% endblock %} @@ -78,12 +79,10 @@ {% for pkg1, pkg2 in multilib_differences %} - {{ pkg1.pkgname }} + {% pkg_details_link pkg1 %} {{ pkg1.full_version }} {{ pkg2.full_version }} - {{ pkg2.pkgname }} + {% pkg_details_link pkg2 %} {{ pkg2.repo }} {{ pkg1.last_update|date }} {{ pkg2.last_update|date }} -- cgit v1.2.3-2-g168b From 58356ec5b38c71204895eb77856a45ffd7ac1725 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 27 Nov 2013 16:07:49 -0500 Subject: Allow pkg_details_link to honor package flag state This allows the tag to be used in a few more places we weren't already able to use it, and hopefully speeds up rendering a tad on the package differences page. Signed-off-by: Dan McGee --- templates/packages/differences.html | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/templates/packages/differences.html b/templates/packages/differences.html index f4d93151..5ebe18e2 100644 --- a/templates/packages/differences.html +++ b/templates/packages/differences.html @@ -46,14 +46,10 @@ {{ diff.pkgname }} {{ diff.repo.name }} {% if diff.pkg_a %} - - {{ diff.pkg_a.full_version }} + {% pkg_details_link diff.pkg_a diff.pkg_a.full_version True %} {% else %}-{% endif %} {% if diff.pkg_b %} - - {{ diff.pkg_b.full_version }} + {% pkg_details_link diff.pkg_b diff.pkg_b.full_version True %} {% else %}-{% endif %} {% endfor %} -- cgit v1.2.3-2-g168b From 9adc2e53124daa6d13090166830396ffff9013d3 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 27 Nov 2013 17:49:58 -0500 Subject: Stop using Django-provided floatformat template tag It turns out this is a HUGE part of our slow mirror status template rendering, due to the internal workings. Everything is converted to a Python decimal object which is way slower than just staying in native floating point. Given we are always dealing with floats when we need to do our formatting, a home-rolled template tag can accomplish this much faster. Signed-off-by: Dan McGee --- templates/mirrors/mirror_details.html | 6 +++--- templates/mirrors/mirrorlist_status.txt | 4 ++-- templates/mirrors/status_table.html | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'templates') diff --git a/templates/mirrors/mirror_details.html b/templates/mirrors/mirror_details.html index f2ffce20..e1962b85 100644 --- a/templates/mirrors/mirror_details.html +++ b/templates/mirrors/mirror_details.html @@ -110,9 +110,9 @@ {{ 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|floatformat:2 }} - {{ m_url.duration_stddev|floatformat:2 }} - {{ m_url.score|floatformat:1|default:'∞' }} + {{ m_url.duration_avg|floatvalue:2 }} + {{ m_url.duration_stddev|floatvalue:2 }} + {{ m_url.score|floatvalue:1|default:'∞' }} {% endfor %} diff --git a/templates/mirrors/mirrorlist_status.txt b/templates/mirrors/mirrorlist_status.txt index 575d19f7..c69075a3 100644 --- a/templates/mirrors/mirrorlist_status.txt +++ b/templates/mirrors/mirrorlist_status.txt @@ -1,4 +1,4 @@ -{% comment %} +{% load mirror_status %}{% comment %} Yes, ugly templates are ugly, but in order to keep line breaks where we want them, sacrifices have to be made. If editing this template, it is easiest to forget about where line breaks are happening until you are done getting the @@ -9,6 +9,6 @@ content right, and then go back later to fix it all up. ## Generated on {% now "Y-m-d" %} ## {% for mirror_url in mirror_urls %} -## Score: {{ mirror_url.score|floatformat:1|default:'unknown' }}, {{ mirror_url.country.name|default:'Worldwide' }} +## Score: {{ mirror_url.score|floatvalue:1|default:'unknown' }}, {{ mirror_url.country.name|default:'Worldwide' }} #Server = {{ mirror_url.url}}$repo/os/$arch{% endfor %} {% endautoescape %} diff --git a/templates/mirrors/status_table.html b/templates/mirrors/status_table.html index 6fc07a31..00b9c1df 100644 --- a/templates/mirrors/status_table.html +++ b/templates/mirrors/status_table.html @@ -20,9 +20,9 @@ {% country_flag m_url.country %}{{ m_url.country.name }} {{ m_url.completion_pct|percentage:1 }} {{ m_url.delay|duration|default:'unknown' }} - {{ m_url.duration_avg|floatformat:2 }} - {{ m_url.duration_stddev|floatformat:2 }} - {{ m_url.score|floatformat:1|default:'∞' }} + {{ m_url.duration_avg|floatvalue:2 }} + {{ m_url.duration_stddev|floatvalue:2 }} + {{ m_url.score|floatvalue:1|default:'∞' }} {% endfor %} -- cgit v1.2.3-2-g168b