summaryrefslogtreecommitdiffstats
path: root/mirrors/templatetags
AgeCommit message (Collapse)AuthorFilesLines
2019-02-18mirrors: replace self-written floatvalue with floatformatJelle van der Waa1-5/+0
In 2013 floatformat was very slow in the mirror status page, these days floatformat is not that much slower.
2018-01-29More code refactoring / tests (#79)jelle van der Waa1-0/+7
* main: move tests to main/tests Move the templatetags tests to main/tests/test_templatetags. * main: Add test for templatetags country Create a test for the templatetag country_flag. * main: remove duplicate floatvalue floatvalue is only used in the mirrors templates and the same exact function exists in the mirror_status templatetags. * main: Remove duplicate hours filter The hours filter is also defined in the mirror_status and only used in mirrors. * main: move percentage filter to mirrors Move the percentage filter to the only user of it and add a test for basic use cases. * main: remove duplicate duration implementation The duration templatetag filter is also defined in mirror_status.py * templates: remove unrequired import flags * main: Add missing testcase for country_flag Add the None test case, so that the function is fully covered. * todolists: create tests for Todolist model Add basic tests for the Todolist model
2017-05-02Remove the last piece of django-jinja existanceJelle van der Waa1-53/+0
2014-11-08Remove percentage filter from Django templates filtersrelease_2014-11-08Dan McGee1-7/+0
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-11-08Convert mirror status tables to Jinja2Dan McGee1-0/+22
Yay for way improved performance. Local testing showed render times going from 265 ms to 135 ms. Signed-off-by: Dan McGee <dan@archlinux.org>
2014-11-08Convert some of URL details to Jinja2Dan McGee1-0/+31
Anytime we have a loop with >100 items, the Django template engine begins to be the bottleneck. This one is relatively straightforward to convert, and sets the stage for converting the mirror status page as well. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-27Stop using Django-provided floatformat template tagrelease_2013-11-30Dan McGee1-3/+8
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 <dan@archlinux.org>
2011-12-11PyLint suggested cleanupsDan McGee1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-30Mirror status improvementsDan McGee1-2/+23
* Fix sorting issues. '', 'unknown', and '∞' should now always sort after anything else in the list. * Add a completion percentage column; this will tell you at a glance if a mirror is sometimes unresponsive. This should probably be incorporated into the mirror score. * Make a few more things dynamic in the template, like the time back the page reflects. * Add some additional template tags for formatting things. Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21Add mirror status viewDan McGee2-0/+15
Signed-off-by: Dan McGee <dan@archlinux.org>