From 5ced52d7a6e576b23e29dd6936c1389f9a413a94 Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Mon, 12 Jul 2010 03:04:49 +0000 Subject: remove roa link from address ranges which are not properly representably as prefixes svn path=/portal-gui/rpkigui/myrpki/forms.py; revision=3392 --- portal-gui/rpkigui/myrpki/forms.py | 3 +++ portal-gui/rpkigui/templates/myrpki/dashboard.html | 24 +++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'portal-gui') diff --git a/portal-gui/rpkigui/myrpki/forms.py b/portal-gui/rpkigui/myrpki/forms.py index 68827066..76936b53 100644 --- a/portal-gui/rpkigui/myrpki/forms.py +++ b/portal-gui/rpkigui/myrpki/forms.py @@ -136,6 +136,9 @@ def PrefixRoaForm(prefix, *args, **kwargs): return self.cleaned_data['asns'] def clean(self): + if not prefix.is_prefix(): + raise forms.ValidationError, \ + '%s can not be represented as a prefix.' % (prefix,) if prefix.allocated: raise forms.ValidationError, \ 'Prefix is allocated to a child.' diff --git a/portal-gui/rpkigui/templates/myrpki/dashboard.html b/portal-gui/rpkigui/templates/myrpki/dashboard.html index be3b70b1..49f03a7d 100644 --- a/portal-gui/rpkigui/templates/myrpki/dashboard.html +++ b/portal-gui/rpkigui/templates/myrpki/dashboard.html @@ -103,18 +103,22 @@ td { border: solid 1px; text-align: center; padding-left: 1em; padding-right: 1e {% if asns or ars %} {% for asn in asns %} - - - - + + + + {% endfor %} {% for addr in ars %} - - - - + + + + {% endfor %}
{{ asn }}give
{{ asn }}give
{{ addr }}give -| split -| roa
{{ addr }} + give + | split + {% if addr.is_prefix %} + | roa + {% endif %} +
{% else %} -- cgit v1.2.3