Merge lp:~deeptik/lava-dashboard/bundlestream_pagination into lp:lava-dashboard

Proposed by Deepti B. Kalakeri
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 119
Merged at revision: 119
Proposed branch: lp:~deeptik/lava-dashboard/bundlestream_pagination
Merge into: lp:lava-dashboard
Diff against target: 158 lines (+74/-66)
1 file modified
dashboard_server/templates/dashboard_app/bundle_stream_detail.html (+74/-66)
To merge this branch: bzr merge lp:~deeptik/lava-dashboard/bundlestream_pagination
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+44456@code.launchpad.net

Description of the change

Adding pagination feature to bundle stream detail view and correcting some indentation.

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dashboard_server/templates/dashboard_app/bundle_stream_detail.html'
2--- dashboard_server/templates/dashboard_app/bundle_stream_detail.html 2010-12-20 11:19:39 +0000
3+++ dashboard_server/templates/dashboard_app/bundle_stream_detail.html 2010-12-22 12:54:53 +0000
4@@ -1,6 +1,7 @@
5 {% extends "base.html" %}
6 {% load i18n %}
7 {% load humanize %}
8+{% load pagination_tags %}
9
10
11 {% block title %}
12@@ -39,73 +40,80 @@
13
14 {% block content %}
15
16-{% if bundle_stream.bundles.count %}
17-<table class="data">
18- <tr>
19- <th rowspan="3">{% trans "Uploaded By" %}</th>
20- <th rowspan="3">{% trans "Uploaded On" %}</th>
21- <th rowspan="3">{% trans "Import Status" %}</th>
22- <th style="width: 80%" colspan="7">{% trans "Analysis" %}</th>
23- </tr>
24- <tr>
25- <th rowspan="2">{% trans "Test" %}</th>
26- <th rowspan="2">{% trans "Run" %}</th>
27- <th rowspan="2">{% trans "Analyzed On" %}</th>
28- <th colspan="4">{% trans "Test Results" %}</th>
29- </tr>
30- <tr>
31- <th>{% trans "Pass" %}</th>
32- <th>{% trans "Fail" %}</th>
33- <th>{% trans "Skip" %}</th>
34- <th>{% trans "Unknown" %}</th>
35- </tr>
36- {% for bundle in bundle_stream.bundles.all %}
37- {% if bundle.is_deserialized %}
38- <tr>
39- <td rowspan="{{ bundle.test_runs.count }}">{{ bundle.uploaded_by|default:"<i>anonymous</i>" }}</td>
40- <td rowspan="{{ bundle.test_runs.count }}">{{ bundle.uploaded_on|naturalday }} {{ bundle.uploaded_on|time }}</td>
41- <td rowspan="{{ bundle.test_runs.count }}">{% trans "OK" %}</td>
42- {% for test_run in bundle.test_runs.all %}
43- {% if not forloop.first %}<tr>{% endif %}
44- <td>{{ test_run.test }}</td>
45- <td><a href="{{ test_run.get_absolute_url }}">{{ test_run }}</a></td>
46- <td>{{ test_run.analyzer_assigned_date|naturalday }}</td>
47- {% with test_run.get_summary_results as summary %}
48- <td>{{ summary.pass|default:0 }}</td>
49- <td>{{ summary.fail|default:0 }}</td>
50- <td>{{ summary.skip|default:0 }}</td>
51- <td>{{ summary.unknown|default:0 }}</td>
52- {% endwith %}
53- {% if not forloop.last %}</tr>{% endif %}
54- {% endfor %}
55- </tr>
56- {% else %}
57- <tr>
58- <td>{{ bundle.uploaded_by|default:"<i>anonymous</i>" }}</td>
59- <td>{{ bundle.uploaded_on|naturalday }} {{ bundle.uploaded_on|time }}</td>
60- <td>
61- {% if bundle.deserialization_error.count %}
62- {% trans "Failed" %}
63- {% else %}
64- {% trans "Pending" %}
65- {% endif %}
66- </td>
67- <td colspan="7">
68- {% if bundle.deserialization_error.count %}
69- {{ bundle.deserialization_error.get.error_message }}
70- {% endif %}
71- </td>
72- </tr>
73- {% endif %}
74- {% endfor %}
75-</table>
76-
77+{% autopaginate bundle_stream.bundles.all 5 as bundles %}
78+{% if invalid_page %}
79+ <h3>{% trans "There is no bundles on this page yet." %}</h3>
80+ <p>{% trans "Try the" %} <a href="{{ bundle_stream.get_absolute_url }}">{% trans "first page" %}</a> {% trans "instead." %}</p>
81 {% else %}
82-
83-<p>{% blocktrans %}
84- There are no bundles in this stream yet.
85-{% endblocktrans %}</p>
86-
87+ {% if bundles.count %}
88+ <table class="data">
89+ <tr>
90+ <th rowspan="3">{% trans "Uploaded By" %}</th>
91+ <th rowspan="3">{% trans "Uploaded On" %}</th>
92+ <th rowspan="3">{% trans "Import Status" %}</th>
93+ <th style="width: 80%" colspan="7">{% trans "Analysis" %}</th>
94+ </tr>
95+ <tr>
96+ <th rowspan="2">{% trans "Test" %}</th>
97+ <th rowspan="2">{% trans "Run" %}</th>
98+ <th rowspan="2">{% trans "Analyzed On" %}</th>
99+ <th colspan="4">{% trans "Test Results" %}</th>
100+ </tr>
101+ <tr>
102+ <th>{% trans "Pass" %}</th>
103+ <th>{% trans "Fail" %}</th>
104+ <th>{% trans "Skip" %}</th>
105+ <th>{% trans "Unknown" %}</th>
106+ </tr>
107+ {% for bundle in bundles %}
108+ {% if bundle.is_deserialized %}
109+ <tr>
110+ <td rowspan="{{ bundle.test_runs.count }}">{{ bundle.uploaded_by|default:"<i>anonymous</i>" }}</td>
111+ <td rowspan="{{ bundle.test_runs.count }}">{{ bundle.uploaded_on|naturalday }} {{ bundle.uploaded_on|time }}</td>
112+ <td rowspan="{{ bundle.test_runs.count }}">{% trans "OK" %}</td>
113+ {% for test_run in bundle.test_runs.all %}
114+ {% if not forloop.first %}<tr>{% endif %}
115+ <td>{{ test_run.test }}</td>
116+ <td><a href="{{ test_run.get_absolute_url }}">{{ test_run }}</a></td>
117+ <td>{{ test_run.analyzer_assigned_date|naturalday }}</td>
118+ {% with test_run.get_summary_results as summary %}
119+ <td>{{ summary.pass|default:0 }}</td>
120+ <td>{{ summary.fail|default:0 }}</td>
121+ <td>{{ summary.skip|default:0 }}</td>
122+ <td>{{ summary.unknown|default:0 }}</td>
123+ {% endwith %}
124+ {% if not forloop.last %}</tr>{% endif %}
125+ {% endfor %}
126+ </tr>
127+ {% else %}
128+ <tr>
129+ <td>{{ bundle.uploaded_by|default:"<i>anonymous</i>" }}</td>
130+ <td>{{ bundle.uploaded_on|naturalday }} {{ bundle.uploaded_on|time }}</td>
131+ <td>
132+ {% if bundle.deserialization_error.count %}
133+ {% trans "Failed" %}
134+ {% else %}
135+ {% trans "Pending" %}
136+ {% endif %}
137+ </td>
138+ <td colspan="7">
139+ {% if bundle.deserialization_error.count %}
140+ {{ bundle.deserialization_error.get.error_message }}
141+ {% endif %}
142+ </td>
143+ </tr>
144+ {% endif %}
145+ {% endfor %}
146+ </table>
147+
148+ {% else %}
149+
150+ <p>{% blocktrans %}
151+ There are no bundles in this stream yet.
152+ {% endblocktrans %}</p>
153+
154+ {% endif %}
155+{% paginate %}
156 {% endif %}
157
158 {% endblock %}

Subscribers

People subscribed via source and target branches