diff options
author | Michael Elkins <melkins@tislabs.com> | 2010-07-12 03:04:49 +0000 |
---|---|---|
committer | Michael Elkins <melkins@tislabs.com> | 2010-07-12 03:04:49 +0000 |
commit | 5ced52d7a6e576b23e29dd6936c1389f9a413a94 (patch) | |
tree | 99eac81da64bc5c732323223085fadf851bcbc12 /portal-gui | |
parent | 47444f3cc14fc1d81a6c05eacc01137b24e612fd (diff) |
remove roa link from address ranges which are not properly representably as prefixes
svn path=/portal-gui/rpkigui/myrpki/forms.py; revision=3392
Diffstat (limited to 'portal-gui')
-rw-r--r-- | portal-gui/rpkigui/myrpki/forms.py | 3 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/dashboard.html | 24 |
2 files changed, 17 insertions, 10 deletions
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 %} <table> {% for asn in asns %} -<tr> -<td style='text-align: left'><a href="{{ asn.get_absolute_url }}">{{ asn }}</a></td> -<td><a href="{{ asn.get_absolute_url }}/allocate">give</a></td> -</tr> + <tr> + <td style='text-align: left'><a href="{{ asn.get_absolute_url }}">{{ asn }}</a></td> + <td><a href="{{ asn.get_absolute_url }}/allocate">give</a></td> + </tr> {% endfor %} {% for addr in ars %} -<tr> -<td style='text-align: left'><a href="{{ addr.get_absolute_url }}">{{ addr }}</a></td> -<td><a href="{{ addr.get_absolute_url }}/allocate">give</a> -| <a href="{{ addr.get_absolute_url }}/split">split</a> -| <a href="{{ addr.get_absolute_url }}/roa">roa</a></td> -</tr> + <tr> + <td style='text-align: left'><a href="{{ addr.get_absolute_url }}">{{ addr }}</a></td> + <td> + <a href="{{ addr.get_absolute_url }}/allocate">give</a> + | <a href="{{ addr.get_absolute_url }}/split">split</a> + {% if addr.is_prefix %} + | <a href="{{ addr.get_absolute_url }}/roa">roa</a> + {% endif %} + </td> + </tr> {% endfor %} </table> {% else %} |