summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2009-09-15 20:13:11 -0500
committerDan McGee <dan@archlinux.org>2009-09-15 20:14:06 -0500
commit9dc89e8287d9f34da140d0494005388b7abc14c2 (patch)
tree63096ac2ac13802545a84f426e9341dd2cb7fc98
parente3ea5232732f442f75a372714b64e1c119c1be7c (diff)
Add a basic mirror view for the dev site
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--devel/views.py6
-rw-r--r--templates/base.html2
-rw-r--r--templates/devel/mirrorlist.html32
-rw-r--r--urls.py2
4 files changed, 41 insertions, 1 deletions
diff --git a/devel/views.py b/devel/views.py
index f9aacec2..402ed26c 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -7,6 +7,7 @@ from django.core.mail import send_mail
from archweb_dev.main.models import Package, Todolist
from archweb_dev.main.models import Arch, Repo
from archweb_dev.main.models import UserProfile, News
+from archweb_dev.main.models import Mirror
import random
from string import ascii_letters, digits
pwletters = ascii_letters + digits
@@ -73,6 +74,11 @@ def siteindex(request):
RequestContext(request,
{'news_updates': news, 'pkg_updates': pkgs, 'repos': repos}))
+def mirrorlist(request):
+ mirrors = Mirror.objects.all()
+ return render_to_response('devel/mirrorlist.html',
+ RequestContext(request, {'mirror_list': mirrors}))
+
class NewUserForm(forms.ModelForm):
class Meta:
model = UserProfile
diff --git a/templates/base.html b/templates/base.html
index f3418974..4c931350 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -31,7 +31,7 @@
<ul>
<li><a href="/accounts/logout/">Logout</a></li>
<li><a href="/devel/profile/">Profile</a></li>
- <li><a href="http://dev.archlinux.org/stats/">Stats</a></li>
+ <li><a href="/mirrors/">Mirrors</a></li>
<li><a href="http://www.archlinux.org/mailman/private/arch-dev/">Archives</a></li>
<li><a href="/todo/">Todos</a></li>
<li><a href="/packages/signoffs/">Signoffs</a></li>
diff --git a/templates/devel/mirrorlist.html b/templates/devel/mirrorlist.html
new file mode 100644
index 00000000..01699daf
--- /dev/null
+++ b/templates/devel/mirrorlist.html
@@ -0,0 +1,32 @@
+{% extends "base.html" %}
+
+{% block content %}
+<div class="greybox">
+ <table class="results" width="100%">
+ <tr>
+ <th>Name</th>
+ <th>Country</th>
+ <th>Admin Email</th>
+ <th>Public</th>
+ <th>Active</th>
+ <th>ISOs</th>
+ <th>Protocols</th>
+ <th>Rsync IPs</th>
+ <th>Notes</th>
+ </tr>
+ {% for mirror in mirror_list %}
+ <tr>
+ <td>{{mirror.name}}</td>
+ <td>{{mirror.country}}</td>
+ <td>{{mirror.admin_email}}</td>
+ <td>{{mirror.public|yesno}}</td>
+ <td>{{mirror.active|yesno}}</td>
+ <td>{{mirror.isos|yesno}}</td>
+ <td>{{mirror.supported_protocols}}</td>
+ <td>{{mirror.rsync_ips.count}}</td>
+ <td>{{mirror.notes}}</td>
+ </tr>
+ {% endfor %}
+ </table>
+</div>
+{% endblock %}
diff --git a/urls.py b/urls.py
index 18d15d80..f57af054 100644
--- a/urls.py
+++ b/urls.py
@@ -41,6 +41,8 @@ urlpatterns = patterns('',
(r'^news/delete/(\d+)/$', 'archweb_dev.news.views.delete'),
(r'^news/$', 'archweb_dev.news.views.list'),
+ (r'^mirrors/$', 'archweb_dev.devel.views.mirrorlist'),
+
(r'^devel/$', 'archweb_dev.devel.views.index'),
(r'^devel/notify/$', 'archweb_dev.devel.views.change_notify'),
(r'^devel/profile/$', 'archweb_dev.devel.views.change_profile'),