diff options
author | Dan McGee <dan@archlinux.org> | 2010-09-23 18:15:00 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-09-24 19:39:37 -0500 |
commit | 1c6099f4b27f31c100b8bfa0d18f439075cceff0 (patch) | |
tree | 172405ceeba848ae2c6186febbbd164f6783c287 /mirrors/views.py | |
parent | 46dec163468f0e53b00b68f5c370b5e7b5e4cfc3 (diff) |
Make general mirror list view public
Hide some columns when not logged in because they aren't relevant for the
general public, but this will work nicely as a base page for all of our
known mirrors.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors/views.py')
-rw-r--r-- | mirrors/views.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mirrors/views.py b/mirrors/views.py index 5c157894..9380f810 100644 --- a/mirrors/views.py +++ b/mirrors/views.py @@ -70,6 +70,12 @@ def find_mirrors(request, countries=None, protocols=None, use_status=False): }, mimetype='text/plain') +def mirrors(request): + mirrors = Mirror.objects.select_related().order_by('tier', 'country') + if not request.user.is_authenticated(): + mirrors = mirrors.filter(public=True, active=True) + return direct_to_template(request, 'mirrors/mirrors.html', + {'mirror_list': mirrors}) def status(request): bad_timedelta = datetime.timedelta(days=3) |