diff options
Diffstat (limited to 'releng')
-rw-r--r-- | releng/urls.py | 6 | ||||
-rw-r--r-- | releng/views.py | 24 |
2 files changed, 29 insertions, 1 deletions
diff --git a/releng/urls.py b/releng/urls.py index ca76eb25..57013291 100644 --- a/releng/urls.py +++ b/releng/urls.py @@ -22,9 +22,15 @@ releases_patterns = patterns('releng.views', 'release_torrent', {}, 'releng-release-torrent'), ) +netboot_patterns = patterns('releng.views', + (r'^archlinux\.ipxe$', 'netboot_config', {}, 'releng-netboot-config'), + (r'^$', 'netboot_info', {}, 'releng-netboot-info') +) + urlpatterns = patterns('', (r'^feedback/', include(feedback_patterns)), (r'^releases/', include(releases_patterns)), + (r'^netboot/', include(netboot_patterns)), ) # vim: set ts=4 sw=4 et: diff --git a/releng/views.py b/releng/views.py index 0fb55b29..03ea8a86 100644 --- a/releng/views.py +++ b/releng/views.py @@ -13,7 +13,7 @@ from django.views.generic import DetailView, ListView from .models import (Architecture, BootType, Bootloader, ClockChoice, Filesystem, HardwareType, InstallType, Iso, IsoType, Module, Source, Test, Release) - +from mirrors.models import (Mirror, MirrorUrl, MirrorProtocol) def standard_field(model, empty_label=None, help_text=None, required=True): return forms.ModelChoiceField(queryset=model.objects.all(), @@ -280,4 +280,26 @@ def releases_json(request): response = HttpResponse(to_json, content_type='application/json') return response +def netboot_config(request): + release_qs = Release.objects.filter(available=True).order_by('-release_date') + releases = [ release.version for release in release_qs ] + mirrorurls = MirrorUrl.objects.filter(protocol__protocol='http', + active=True, + mirror__public=True, + mirror__active=True, + mirror__isos=True) + mirrorurls = sorted( mirrorurls, + key=lambda x: x.mirror.name) + mirrorurls = sorted( mirrorurls, + key=lambda x: x.country.name) + context = { + 'archs': [ 'i686', 'x86_64' ], + 'releases': releases, + 'mirrorurls': mirrorurls, + } + return render(request, "releng/archlinux.ipxe", context, content_type='text/plain') + +def netboot_info(request): + return render(request, "releng/netboot.html", None) + # vim: set ts=4 sw=4 et: |