=== modified file 'dashboard_app/templates/dashboard_app/base.html'
@@ -5,6 +5,7 @@
{% block extension_navigation %}
<ul>
<li><a href="{% url dashboard_app.views.bundle_stream_list %}">{% trans "Bundle Streams" %}</a></li>
+ <li><a href="{% url dashboard_app.views.data_view_list %}">{% trans "Data Views" %}</a></li>
<li><a href="{% url dashboard_app.views.report_list %}">{% trans "Reports" %}</a></li>
<li><a href="{% url dashboard_app.views.dashboard_xml_rpc_handler %}">{% trans "XML-RPC (dashboard only)" %}</a></li>
</ul>
=== added file 'dashboard_app/templates/dashboard_app/data_view_detail.html'
@@ -0,0 +1,41 @@
+{% extends "dashboard_app/base.html" %}
+{% load i18n %}
+
+{% block title %}
+{{ block.super }} | {% trans "Data Views" %} | {{ data_view.name }}
+{% endblock %}
+
+
+{% block breadcrumbs %}
+<li><a href="{% url dashboard_app.views.data_view_list %}">{% trans "Data Views" %}</a></li>
+<li><a href="{% url dashboard_app.views.data_view_detail data_view.name %}">{{ data_view.name }}</a></li>
+{% endblock %}
+
+
+{% block content %}
+<dl>
+ <dt>Name:</dt>
+ <dd>{{ data_view.name }}</dd>
+ <dt>Summary:</dt>
+ <dd>{{ data_view.summary }}</dd>
+ <dt>Documentation:</dt>
+ <dd>{{ data_view.documentation }}</dd>
+</dl>
+<table class="data">
+ <caption>Aruments</caption>
+ <tr>
+ <th>name</th>
+ <th>type</th>
+ <th>default</th>
+ <th>help</th>
+ </tr>
+ {% for argument in data_view.arguments %}
+ <tr>
+ <td>{{ argument.name }}</td>
+ <td>{{ argument.type }}</td>
+ <td>{{ argument.default|default_if_none:"<i>No default available</i>" }}</td>
+ <td>{{ argument.help }}</td>
+ </tr>
+ {% endfor %}
+</table>
+{% endblock %}
=== added file 'dashboard_app/templates/dashboard_app/data_view_list.html'
@@ -0,0 +1,34 @@
+{% extends "dashboard_app/base.html" %}
+{% load i18n %}
+
+{% block title %}
+{{ block.super }} | {% trans "Data Views" %}
+{% endblock %}
+
+
+{% block breadcrumbs %}
+<li><a href="{% url dashboard_app.views.data_view_list %}">{% trans "Data Views" %}</a></li>
+{% endblock %}
+
+
+{% block sidebar %}
+<h3>Hint:</h3>
+<p>To call a data view use the <code>lava-dashboard-tool</code> command. See
+<code>lava-dashboard-tool query-data-view --help</code> to get started.</p>
+{% endblock %}
+
+
+{% block content %}
+<table class="data">
+ <tr>
+ <th>{% trans "Name" %}</th>
+ <th>{% trans "Summary" %}</th>
+ </tr>
+ {% for data_view in data_view_list %}
+ <tr>
+ <td><a href="{% url dashboard_app.views.data_view_detail data_view.name %}">{{ data_view.name }}</a></td>
+ <td>{{ data_view.summary }}</td>
+ </tr>
+{% endfor %}
+</table>
+{% endblock %}
=== modified file 'dashboard_app/urls.py'
@@ -33,6 +33,8 @@
url(r'^streams(?P<pathname>/[a-zA-Z0-9/_-]+?)\+bundles$', 'bundle_list'),
url(r'^attachments/(?P<pk>[0-9]+)/$', 'attachment_detail'),
url(r'^xml-rpc/', 'dashboard_xml_rpc_handler'),
+ url(r'^data-views/$', 'data_view_list'),
+ url(r'^data-views/(?P<name>[a-zA-Z0-9-_]+)/$', 'data_view_detail'),
url(r'^reports/$', 'report_list'),
url(r'^reports/(?P<name>[a-zA-Z0-9-_]+)/$', 'report_detail'),
)
=== modified file 'dashboard_app/views.py'
@@ -29,8 +29,9 @@
from django.shortcuts import render_to_response
from django.template import RequestContext
+from dashboard_app.dataview import DataView, DataViewRepository
from dashboard_app.dispatcher import DjangoXMLRPCDispatcher
-from dashboard_app.models import (Attachment, BundleStream, TestRun, TestResult, DataReport)
+from dashboard_app.models import Attachment, BundleStream, TestRun, TestResult, DataReport
from dashboard_app.xmlrpc import DashboardAPI
@@ -255,3 +256,23 @@
"dashboard_app/report_detail.html", {
"report": report,
}, RequestContext(request))
+
+
+def data_view_list(request):
+ repo = DataViewRepository.get_instance()
+ return render_to_response(
+ "dashboard_app/data_view_list.html", {
+ "data_view_list": repo.data_views
+ }, RequestContext(request))
+
+
+def data_view_detail(request, name):
+ repo = DataViewRepository.get_instance()
+ try:
+ data_view = repo[name]
+ except KeyError:
+ raise Http404('No data view matches the given query.')
+ return render_to_response(
+ "dashboard_app/data_view_detail.html", {
+ "data_view": data_view
+ }, RequestContext(request))