aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2012-01-17 05:01:31 +0000
committerMichael Elkins <melkins@tislabs.com>2012-01-17 05:01:31 +0000
commit525a7a3af91f285a3fe6530adfd898b383bd050d (patch)
treed75b67ea6cf7e1f0b961e5967ebc642ad1385af3
parentdba331c9b422a1845f3c9b4e977a815201300d6b (diff)
Use Twitter Bootstrap CSS Framework to style html templates
svn path=/branches/tk161/; revision=4157
-rw-r--r--rpkid/rpki/gui/app/templates/rpkigui/app_base.html19
-rw-r--r--rpkid/rpki/gui/app/templates/rpkigui/bootstrap_form.html33
-rw-r--r--rpkid/rpki/gui/app/templates/rpkigui/child_list.html9
-rw-r--r--rpkid/rpki/gui/app/templates/rpkigui/object_list.html33
-rw-r--r--rpkid/rpki/gui/app/templates/rpkigui/parent_form.html11
-rw-r--r--rpkid/rpki/gui/app/templates/rpkigui/parent_list.html13
-rw-r--r--rpkid/rpki/gui/app/templates/rpkigui/roa_request_list.html35
7 files changed, 142 insertions, 11 deletions
diff --git a/rpkid/rpki/gui/app/templates/rpkigui/app_base.html b/rpkid/rpki/gui/app/templates/rpkigui/app_base.html
new file mode 100644
index 00000000..a9eaecfe
--- /dev/null
+++ b/rpkid/rpki/gui/app/templates/rpkigui/app_base.html
@@ -0,0 +1,19 @@
+{% extends "base.html" %}
+
+{# This template defines the common structure for the rpki.gui.app application. #}
+
+{% block sidebar %}
+
+<p><strong>{{ request.session.handle }}</strong>
+
+{# common navigation #}
+
+<ul class='unstyled'>
+ <li><a href="{% url rpki.gui.app.views.dashboard %}">dashboard</a></li>
+ <li><a href="{% url rpki.gui.app.views.parent_list %}">parents</a></li>
+ <li><a href="{% url rpki.gui.app.views.child_list %}">children</a></li>
+ <li><a href="{% url rpki.gui.app.views.roa_request_list %}">roas</a></li>
+ <li><a href="{% url rpki.gui.app.views.ghostbusters_list %}">ghostbusters</a></li>
+</ul>
+
+{% endblock sidebar %}
diff --git a/rpkid/rpki/gui/app/templates/rpkigui/bootstrap_form.html b/rpkid/rpki/gui/app/templates/rpkigui/bootstrap_form.html
new file mode 100644
index 00000000..df9620fe
--- /dev/null
+++ b/rpkid/rpki/gui/app/templates/rpkigui/bootstrap_form.html
@@ -0,0 +1,33 @@
+{% if form.non_field_errors %}
+<div class='alert-message error'>
+{{ form.non_field_errors }}
+</div>
+{% endif %}
+
+{% for field in form %}
+
+{% if field.is_hidden %}
+ {{ field }}
+{% else %}
+ <div class='clearfix {% if field.errors %}error{% endif %}'>
+ {{ field.label_tag }}
+ {% if field.required %}<span class='required-field'>*</span>{% endif %}
+ <div class='input'>
+ {{ field }}
+ {% if field.help_text %}
+ <span class='help-inline'>{{ field.help_text }}</span>
+ {% endif %}
+ {% if field.errors %}
+ <ul>
+ {% for error in field.errors %}
+ <li class='help-inline'>{{ error }}</li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ </div><!-- input -->
+ </div><!-- clearfix -->
+{% endif %}
+
+{% endfor %}
+
+<!-- vim: set sw=2: -->
diff --git a/rpkid/rpki/gui/app/templates/rpkigui/child_list.html b/rpkid/rpki/gui/app/templates/rpkigui/child_list.html
new file mode 100644
index 00000000..cd3780fb
--- /dev/null
+++ b/rpkid/rpki/gui/app/templates/rpkigui/child_list.html
@@ -0,0 +1,9 @@
+{% extends "rpkigui/object_list.html" %}
+
+{% block actions %}
+<div class='actions'>
+ <a class='btn' href="{% url rpki.gui.app.views.import_child %}" title="import a new child's identity.xml file">Import</a>
+</div>
+{% endblock actions %}
+
+<!-- vim: set sw=2: -->
diff --git a/rpkid/rpki/gui/app/templates/rpkigui/object_list.html b/rpkid/rpki/gui/app/templates/rpkigui/object_list.html
new file mode 100644
index 00000000..b7b640bb
--- /dev/null
+++ b/rpkid/rpki/gui/app/templates/rpkigui/object_list.html
@@ -0,0 +1,33 @@
+{% extends "rpkigui/app_base.html" %}
+
+{# generic object list #}
+
+{% block content %}
+<!--
+<ul class='breadcrumb'>
+ <li><a href="{% url rpki.gui.app.views.dashboard %}">{{ request.session.handle }}</a> <span class='divider'>/</span></li>
+ <li class='active'>{{ page_title }}</li>
+</ul>
+-->
+
+<div class='page-header'>
+ <h1>{{ page_title }}</h1>
+</div>
+
+{% if object_list %}
+<ul>
+ {% for object in object_list %}
+ {% block object_detail %}
+ <li><a href="{{ object.get_absolute_url }}">{{ object }}</a></li>
+ {% endblock %}
+ {% endfor %}
+</ul>
+{% else %}
+None
+{% endif %}
+
+{% block actions %}{% endblock %}
+
+{% endblock %}
+
+<!-- vim: set sw=2: -->
diff --git a/rpkid/rpki/gui/app/templates/rpkigui/parent_form.html b/rpkid/rpki/gui/app/templates/rpkigui/parent_form.html
deleted file mode 100644
index 4209c537..00000000
--- a/rpkid/rpki/gui/app/templates/rpkigui/parent_form.html
+++ /dev/null
@@ -1,11 +0,0 @@
-{% extends "rpkigui/parent_view.html" %}
-
-{% block form %}
-
-<form method="POST" action="{{ request.get_full_path }}">
-{% csrf_token %}
-{{ form }}
-<input type="submit" value="{{ submit_label }}">
-</form>
-
-{% endblock %}
diff --git a/rpkid/rpki/gui/app/templates/rpkigui/parent_list.html b/rpkid/rpki/gui/app/templates/rpkigui/parent_list.html
new file mode 100644
index 00000000..d921bf57
--- /dev/null
+++ b/rpkid/rpki/gui/app/templates/rpkigui/parent_list.html
@@ -0,0 +1,13 @@
+{% extends "rpkigui/object_list.html" %}
+
+{% block object_detail %}
+<li><a href="{{ object.get_absolute_url }}">{{ object.handle }}</a></li>
+{% endblock object_detail %}
+
+{% block actions %}
+<div class='actions'>
+ <a class='btn' href="{% url rpki.gui.app.views.import_parent %}" title="upload XML response from remote parent">Import</a>
+</div>
+{% endblock actions %}
+
+<!-- vim: set sw=2: -->
diff --git a/rpkid/rpki/gui/app/templates/rpkigui/roa_request_list.html b/rpkid/rpki/gui/app/templates/rpkigui/roa_request_list.html
new file mode 100644
index 00000000..a9ecf9c9
--- /dev/null
+++ b/rpkid/rpki/gui/app/templates/rpkigui/roa_request_list.html
@@ -0,0 +1,35 @@
+{% extends "rpkigui/app_base.html" %}
+
+{# generic object list #}
+
+{% block content %}
+<!--
+<ul class='breadcrumb'>
+ <li><a href="{% url rpki.gui.app.views.dashboard %}">{{ request.session.handle }}</a> <span class='divider'>/</span></li>
+ <li class='active'>{{ page_title }}</li>
+</ul>
+-->
+
+<div class='page-header'>
+ <h1>{{ page_title }}</h1>
+</div>
+
+{% if object_list %}
+<table class='zebra-striped'>
+ <tr><th>Prefix</th><th>Max Length</th><th>ASN</th></tr>
+ {% for object in object_list %}
+ <tr>
+ <td><a href="{{ object.prefix.get_absolute_url }}">{{ object.prefix }}</a></td>
+ <td>{{ object.max_length }}</td>
+ <td>{{ object.roa.asn }}</td>
+ <td><a class='btn danger' href="{{ object.get_absolute_url}}/delete">Delete</a></td>
+ </tr>
+ {% endfor %}
+</table>
+{% else %}
+None
+{% endif %}
+
+{% endblock %}
+
+<!-- vim: set sw=2: -->