From 116751e4bab183b3cca93ab13f7f4f21c752be4e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 24 Apr 2012 23:22:23 -0500 Subject: Rename mirror country fields to country_old in prep for normalization We're going to move to using ISO 2 character codes via django countries, so start by moving the old data out of the way first. Signed-off-by: Dan McGee --- templates/mirrors/mirror_details.html | 2 +- templates/mirrors/mirrors.html | 2 +- templates/public/download.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/mirrors/mirror_details.html b/templates/mirrors/mirror_details.html index 249b36f2..bb3b417c 100644 --- a/templates/mirrors/mirror_details.html +++ b/templates/mirrors/mirror_details.html @@ -21,7 +21,7 @@ Country: - {{ mirror.country }} + {{ mirror.country_old }} Has ISOs: diff --git a/templates/mirrors/mirrors.html b/templates/mirrors/mirrors.html index 3aff8ea6..4b59058a 100644 --- a/templates/mirrors/mirrors.html +++ b/templates/mirrors/mirrors.html @@ -27,7 +27,7 @@ {{ mirror.name }} {{mirror.get_tier_display}} - {{mirror.country}} + {{mirror.country_old}} {{mirror.isos|yesno|capfirst}} {{mirror.supported_protocols|join:", "}} {% if user.is_authenticated %} diff --git a/templates/public/download.html b/templates/public/download.html index 67c70be1..fbadb7c0 100644 --- a/templates/public/download.html +++ b/templates/public/download.html @@ -160,9 +160,9 @@ {% for mirror_url in mirror_url_list %} - {% ifchanged mirror_url.mirror.country %} + {% ifchanged mirror_url.mirror.country_old %} - {{mirror_url.mirror.country}} + {{mirror_url.mirror.country_old}} {% endifchanged %} {% ifchanged mirror_url.mirror.name %} -- cgit v1.2.3-2-g168b From 640e0f58645a7fd07f3c6185d9583b4d218e2468 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 25 Apr 2012 01:32:57 -0500 Subject: 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 --- templates/mirrors/mirror_details.html | 2 +- templates/mirrors/mirrorlist.txt | 2 +- templates/mirrors/mirrorlist_status.txt | 3 ++- templates/mirrors/mirrors.html | 16 ++++++------ templates/mirrors/status.html | 2 +- templates/mirrors/status_table.html | 2 +- templates/public/download.html | 43 ++++++++++++--------------------- 7 files changed, 30 insertions(+), 40 deletions(-) (limited to 'templates') diff --git a/templates/mirrors/mirror_details.html b/templates/mirrors/mirror_details.html index bb3b417c..6fe68f36 100644 --- a/templates/mirrors/mirror_details.html +++ b/templates/mirrors/mirror_details.html @@ -21,7 +21,7 @@ Country: - {{ mirror.country_old }} + {{ mirror.country.name|default:'Worldwide' }} Has ISOs: diff --git a/templates/mirrors/mirrorlist.txt b/templates/mirrors/mirrorlist.txt index 24b52fa1..d3dd6e4e 100644 --- a/templates/mirrors/mirrorlist.txt +++ b/templates/mirrors/mirrorlist.txt @@ -8,6 +8,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 %}{% ifchanged %} -## {{ mirror_url.real_country }}{% endifchanged %} +## {{ mirror_url.real_country.name|default:'Worldwide' }}{% endifchanged %} #Server = {{ mirror_url.url}}$repo/os/$arch{% endfor %} {% endautoescape %} diff --git a/templates/mirrors/mirrorlist_status.txt b/templates/mirrors/mirrorlist_status.txt index e3504395..523794b2 100644 --- a/templates/mirrors/mirrorlist_status.txt +++ b/templates/mirrors/mirrorlist_status.txt @@ -7,7 +7,8 @@ content right, and then go back later to fix it all up. ## Arch Linux repository mirrorlist ## Sorted by mirror score from mirror status page ## Generated on {% now "Y-m-d" %} +## {% for mirror_url in mirror_urls %} -## Score: {{ mirror_url.score|floatformat:1|default:'unknown' }}, {{ mirror_url.real_country }} +## Score: {{ mirror_url.score|floatformat:1|default:'unknown' }}, {{ mirror_url.real_country.name|default:'Worldwide' }} #Server = {{ mirror_url.url}}$repo/os/$arch{% endfor %} {% endautoescape %} diff --git a/templates/mirrors/mirrors.html b/templates/mirrors/mirrors.html index 4b59058a..19c6ea27 100644 --- a/templates/mirrors/mirrors.html +++ b/templates/mirrors/mirrors.html @@ -26,15 +26,15 @@ {{ mirror.name }} - {{mirror.get_tier_display}} - {{mirror.country_old}} - {{mirror.isos|yesno|capfirst}} - {{mirror.supported_protocols|join:", "}} + {{ mirror.get_tier_display }} + {% if mirror.country %} {% endif %}{{ mirror.country.name }} + {{ mirror.isos|yesno|capfirst }} + {{ mirror.supported_protocols|join:", " }} {% if user.is_authenticated %} - {{mirror.public|yesno|capfirst}} - {{mirror.active|yesno|capfirst}} - {{mirror.admin_email}} - {{mirror.notes|linebreaks}} + {{ mirror.public|yesno|capfirst }} + {{ mirror.active|yesno|capfirst }} + {{ mirror.admin_email }} + {{ mirror.notes|linebreaks }} {% endif %} {% endfor %} diff --git a/templates/mirrors/status.html b/templates/mirrors/status.html index 225572ee..8f814448 100644 --- a/templates/mirrors/status.html +++ b/templates/mirrors/status.html @@ -92,7 +92,7 @@ {% spaceless %} {{ log.url__url }} {{ log.url__protocol__protocol }} - {{ log.country }} + {% if log.country %} {% endif %}{{ log.country.name }} {{ log.error }} {{ log.last_occurred|date:'Y-m-d H:i' }} {{ log.error_count }} diff --git a/templates/mirrors/status_table.html b/templates/mirrors/status_table.html index bd70115c..3a20c068 100644 --- a/templates/mirrors/status_table.html +++ b/templates/mirrors/status_table.html @@ -18,7 +18,7 @@ {% spaceless %} {{ m_url.url }} {{ m_url.protocol }} - {{ m_url.real_country }} + {% if m_url.real_country %} {% endif %}{{ m_url.real_country.name }} {{ m_url.last_sync|date:'Y-m-d H:i'|default:'unknown' }} {{ m_url.completion_pct|percentage:1 }} {{ m_url.delay|duration|default:'unknown' }} diff --git a/templates/public/download.html b/templates/public/download.html index fbadb7c0..4d75268a 100644 --- a/templates/public/download.html +++ b/templates/public/download.html @@ -77,7 +77,7 @@ Download - Downloads and installs packages versions via FTP for absolute freshness. + Downloads and installs packages versions via mirrors for absolute freshness. @@ -131,10 +131,10 @@ title="Release Engineering ISO feedback">Feedback -

HTTP/FTP Direct Downloads

+

HTTP Direct Downloads

In addition to the BitTorrent links above, install images can also be - downloaded via HTTP or FTP from the mirror sites listed below. Please + downloaded via HTTP from the mirror sites listed below. Please ensure the download image matches the checksum from the md5sums.txt or sha1sums.txt file in the same directory as the image.

@@ -150,30 +150,19 @@ {% cache 600 download-mirrors %} - - - - - - - - - - - - -

Server Location

Download

- {% for mirror_url in mirror_url_list %} - {% ifchanged mirror_url.mirror.country_old %} -
{{mirror_url.mirror.country_old}} - {% endifchanged %} - {% ifchanged mirror_url.mirror.name %} -
{{mirror_url.mirror.name}} - {% endifchanged %} - {{mirror_url.protocol.protocol|upper}} - {% endfor %} -
+
+ {% regroup mirror_urls by real_country as grouped_urls %} + {% for country in grouped_urls %} + {% if country.grouper %}
{{ country.grouper.name }}
+ {% else %}
Worldwide
{% endif %} + + {% endfor %} +
{% endcache %} {% endwith %} -- cgit v1.2.3-2-g168b From 2cfd0be715b93632a85608092726c5df926ed9ae Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 25 Apr 2012 01:52:19 -0500 Subject: 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 --- templates/mirrors/status.html | 14 +++++--------- templates/mirrors/status_table.html | 4 +--- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'templates') diff --git a/templates/mirrors/status.html b/templates/mirrors/status.html index 8f814448..c04aa204 100644 --- a/templates/mirrors/status.html +++ b/templates/mirrors/status.html @@ -18,10 +18,6 @@
  • Mirror URL: Mirrors are checked on a per-URL basis. If both FTP and HTTP access are provided, both will be listed here.
  • -
  • Last Sync: The timestamp retrieved from the - lastsync file on the mirror. If this file could not be - retrieved or contained data we didn't recognize, this column will show - 'unknown'.
  • Completion %: The number of mirror checks that have successfully connected and disconnected from the given URL. If this is below 100%, the mirror may be unreliable.
  • @@ -92,8 +88,8 @@ {% spaceless %} {{ log.url__url }} {{ log.url__protocol__protocol }} - {% if log.country %} {% endif %}{{ log.country.name }} - {{ log.error }} + {% if log.country %} {% endif %}{{ log.country.name }} + {{ log.error }} {{ log.last_occurred|date:'Y-m-d H:i' }} {{ log.error_count }} @@ -107,11 +103,11 @@