Commit Graph

20 Commits

Author SHA1 Message Date
Evangelos Foutras
9c1669a737 Remove invalid filter call from mirrors/status_table.html
The filter was passed an undefined variable which caused the template to
be rendered as empty. Since the other table columns default to an empty
string instead of "unknown", simply remove the default:"unknown" filter.

Also correct a closing %} tag.
2017-05-22 12:09:47 +03:00
Jelle van der Waa
6489bd1a2e Port mirrors to pure django template 2017-05-02 21:13:56 +02:00
Dan McGee
713ab837ba Convert mirror status tables to Jinja2
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-08 14:00:09 -06:00
Dan McGee
a8ceba3429 Add details link to mirror status page
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-09-01 16:16:44 -05:00
Dan McGee
9335d3330b Save some space, (secs) -> (s)
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-09-01 15:53:23 -05:00
Dan McGee
9adc2e5312 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 <dan@archlinux.org>
2013-11-27 17:53:37 -05:00
Dan McGee
86f9d6788e Django 1.6 upgrade, deprecation cleanup
PendingDeprecationWarning: 'The `cycle` template tag is changing to
escape its arguments; the non-autoescaping version is deprecated. Load
it from the `future` tag library to start using the new behavior.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-06 21:10:52 -06:00
Dan McGee
76be96ac2c Pull mirror error table into inclusion template
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-05-10 17:59:53 -05:00
Dan McGee
b519c40e0a Remove {% spaceless %} tag from a few more places
This tag is simply not worth the time it takes to do what it does.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-20 11:11:04 -05:00
Dan McGee
0b930fd921 Convert all usages of flag icons to new sprite
This uses a new template tag to avoid repeating construction of the
necessary HTML element all over the place. The site should look exactly
as it did before, except now you don't have to download 20+ images to
see some pages.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-16 00:36:17 -06:00
Dan McGee
6f0ae6746b Drop country column from mirror table
We now always look for this information at the URL level, not the mirror
level. This simplifies quite a bit of code in and around the mirror
views.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14 01:05:54 -06:00
Dan McGee
9616aec563 Add empty 'alt' attribute for all country flag images
These are all used purely for decoration, and the country name itself is
right next to the flag image, so we can safely mark these as "invisible"
to screen readers, text browsers, etc.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-26 12:05:57 -05:00
Dan McGee
2cfd0be715 Mirror status page cleanup
Remove the 'last sync' column; it is not totally useless but mostly
covered by the average delay column, and we are running out of usable
real estate here. Also tweak a few columns so wrapping is permissible.
Thank you to "Macedonia, The Former Yugoslav Republic of" for this.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-25 01:52:19 -05:00
Dan McGee
640e0f5864 Finish django countries implementation
* Add a migration to drop the old countries field.
* Update all templates/views/utility methods to point at the new country
  field and dereference it as necessary.
* Add the flags images to a few views where it makes sense.
* Cleanup the download page layout quite a bit.
* Bump the mirror status JSON version to 3; add country_code attribute.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-25 01:51:58 -05:00
Dan McGee
5555ce0227 Use spaceless tag in mirror status output
This removes a lot of needless whitespace in the generated output,
shrinking the uncompressed page size by 30KB to 54KB total on my current
set of mirror test data.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-29 11:35:40 -05:00
Dan McGee
78a553e558 Add optional country override for individual mirror URLs
This allows a named top-level mirror to have geographically distributed
URLs, e.g. kernel.org and the geo-DNS setup.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-04-12 18:36:20 -05:00
Dan McGee
2c13364880 Mirror status improvements
* 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-30 12:47:30 -05:00
Dan McGee
0dba93a9fc Switch mirror status delay display to average delay
This takes a bit more work to compute, but since we cache all of this anyway
it isn't too big of deal. Using average delay instead of last delay will be
a bit more fair on mirrors that have odd syncing schedules, as well as
exposing those that only sync once a day. Also fix an issue that will arise
with cutoff_time being calculated once, and adjust mirror score to treat
hours delay as a float rather than an integer.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-22 13:28:12 -05:00
Dan McGee
2a296af10d Add ordering, sorting, and a lot more info to mirror status page
This should get this to the point where it is releasable to the general
public for their use and pleasure. Still not sure on how often the check
should be run, and we probably want to incorporate this mined data into some
other things like the mirror list generator.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 17:30:14 -05:00
Dan McGee
40ac4818aa Add mirror status view
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:33 -05:00