diff options
author | Michael Elkins <melkins@tislabs.com> | 2010-07-06 18:41:24 +0000 |
---|---|---|
committer | Michael Elkins <melkins@tislabs.com> | 2010-07-06 18:41:24 +0000 |
commit | 702735e08d32d6120db12eecc4b3cd860b7e9090 (patch) | |
tree | 13547307a04ce9e8aad40fd90a0196de507b6a1e | |
parent | d1c8737ce06d726f1077424d2f355aa7482b0f02 (diff) |
improve css for tables to improve readability
make the child and parent views prettier
add css block to base template
check for allocation to child in roa form validator
svn path=/portal-gui/rpkigui/myrpki/forms.py; revision=3342
-rw-r--r-- | portal-gui/rpkigui/myrpki/forms.py | 6 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/base.html | 3 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/child_view.html | 19 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/dashboard.html | 10 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/parent_view.html | 11 | ||||
-rw-r--r-- | portal-gui/rpkigui/templates/myrpki/prefix_view.html | 12 |
6 files changed, 38 insertions, 23 deletions
diff --git a/portal-gui/rpkigui/myrpki/forms.py b/portal-gui/rpkigui/myrpki/forms.py index d0ddc462..c4338de6 100644 --- a/portal-gui/rpkigui/myrpki/forms.py +++ b/portal-gui/rpkigui/myrpki/forms.py @@ -260,6 +260,12 @@ def PrefixRoaForm(prefix, *args, **kwargs): 'Must be a list of integers separated by commas.' return self.cleaned_data['asns'] + def clean(self): + if prefix.allocated: + raise forms.ValidationError, \ + 'Prefix is allocated to a child.' + return self.cleaned_data + return _wrapper(*args, **kwargs) def PrefixDeleteForm(prefix, *args, **kwargs): diff --git a/portal-gui/rpkigui/templates/base.html b/portal-gui/rpkigui/templates/base.html index aa5f924a..1cb56664 100644 --- a/portal-gui/rpkigui/templates/base.html +++ b/portal-gui/rpkigui/templates/base.html @@ -2,9 +2,8 @@ <head> <title>{% block title %}MyRPKI{% endblock %}</title> {% block head %}{% endblock %} - <style type="text/css"><!-- + <style type="text/css"> {% block css %}{% endblock %} - --> </style> </head> <body> diff --git a/portal-gui/rpkigui/templates/myrpki/child_view.html b/portal-gui/rpkigui/templates/myrpki/child_view.html index 77e2cf51..718e089d 100644 --- a/portal-gui/rpkigui/templates/myrpki/child_view.html +++ b/portal-gui/rpkigui/templates/myrpki/child_view.html @@ -6,22 +6,25 @@ <p>Child: {{ child.handle }} <h2>Delegated Addresses</h2> -<table> - <tr><td>Low</td><td>High</td><td></td></tr> +{% if child.address_range.all %} +<ul> {% for a in child.address_range.all %} -<tr> - <td>{{ a.lo }}</td> - <td>{{ a.hi }}</td> - <td><a href="{{ a.get_absolute_url }}">view</a></td> -</tr> +<li><a href="{{ a.get_absolute_url }}">{{ a }}</a> {% endfor %} -</table> +</ul> +{% else %} +<p>--none-- +{% endif %} <h2>Delegated ASNs</h2> +{% if child.asn.all %} <ul> {% for a in child.asn.all %} <li><a href="{{ a.get_absolute_url }}">{{ a }}</a> {% endfor %} </ul> +{% else %} +<p>--none-- +{% endif %} {% endblock %} diff --git a/portal-gui/rpkigui/templates/myrpki/dashboard.html b/portal-gui/rpkigui/templates/myrpki/dashboard.html index 07df5ad6..24ad515b 100644 --- a/portal-gui/rpkigui/templates/myrpki/dashboard.html +++ b/portal-gui/rpkigui/templates/myrpki/dashboard.html @@ -1,5 +1,11 @@ {% extends "base.html" %} +{% block css %} +table { border-collapse: collapse } +th { border: solid 1px; padding: 1em } +td { border: solid 1px; text-align: center; padding-left: 1em; padding-right: 1em } +{% endblock %} + {% block content %} <p>Handle: {{ request.session.handle }} | <a href="/myrpki/conf/export">export identity</a> @@ -12,7 +18,7 @@ {% for parent in request.session.handle.parents.all %} <li><a href="{{ parent.get_absolute_url }}">{{ parent.handle }}</a> <p> -<table style="width:100%; border: solid 1px"> +<table> <tr><th>Accepted Resource</th><th>Not Before</th><th>Not After</th></tr> {% for cert in parent.resources.all %} @@ -74,7 +80,7 @@ <div style="border: outset"> <h1 style="text-align: center">My ROA [request]s</h1> -<table style="border: groove; width: 100%" border="1"> +<table> <tr> <th>Prefix</th> <th>ASN</th> diff --git a/portal-gui/rpkigui/templates/myrpki/parent_view.html b/portal-gui/rpkigui/templates/myrpki/parent_view.html index 9756c83a..41411375 100644 --- a/portal-gui/rpkigui/templates/myrpki/parent_view.html +++ b/portal-gui/rpkigui/templates/myrpki/parent_view.html @@ -5,18 +5,13 @@ <h1>Parent View</h1> <p>Parent: {{ parent.handle }} <h2>Delegated Addresses</h2> -<table> - <tr><td>Low</td><td>High</td><td></td></tr> +<ul> {% for c in parent.resources.all %} {% for a in c.address_range.all %} -<tr> - <td>{{ a.lo }}</td> - <td>{{ a.hi }}</td> - <td><a href="{{ a.get_absolute_url }}">view</a></td> -</tr> +<li><a href="{{ a.get_absolute_url }}">{{ a }}</a> {% endfor %} {% endfor %} -</table> +</ul> <h2>Delegated ASNs</h2> <ul> diff --git a/portal-gui/rpkigui/templates/myrpki/prefix_view.html b/portal-gui/rpkigui/templates/myrpki/prefix_view.html index 74bf45d8..be273f05 100644 --- a/portal-gui/rpkigui/templates/myrpki/prefix_view.html +++ b/portal-gui/rpkigui/templates/myrpki/prefix_view.html @@ -1,5 +1,11 @@ {% extends "base.html" %} +{% block css %} +table { border: solid 1px; border-collapse: collapse } +th { border: solid 1px; padding: 1em } +td { border: solid 1px; text-align: center; padding-left: 1em; padding-right: 1em } +{% endblock %} + {% block content %} <p>Handle: <a href="/myrpki/">{{ request.session.handle }}</a> @@ -41,12 +47,12 @@ {% if addr.roa_requests %} <h2>ROA requests</h2> -<table style='border: solid 1px; width:100%'> +<table> <tr><th>ASN</th><th>Max Length</th></tr> {% for r in addr.roa_requests.all %} - <tr><td style='text-align: center'>{{ r.roa.asn }}</td> - <td style='text-align: center'>{{ r.max_length }}</td> + <tr><td>{{ r.roa.asn }}</td> + <td>{{ r.max_length }}</td> <td><a href="{{ r.get_absolute_url }}/delete">delete</a></tr> {% endfor %} |