Skip to content

Commit 424e304

Browse files
committed
Include the full changes table in the feed
(by putting it into a template of its own)
1 parent c657ee6 commit 424e304

4 files changed

Lines changed: 63 additions & 50 deletions

File tree

codespeed/feeds.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from codespeed.models import Report
33
from django.conf import settings
44
from django.db.models import Q
5+
from django.shortcuts import render_to_response
6+
57

68
class ResultFeed(Feed):
79
title = settings.WEBSITE_NAME
@@ -13,13 +15,23 @@ def items(self):
1315
.order_by('-revision__date')[:10]
1416

1517
def item_title(self, item):
16-
return unicode(item.revision)
18+
return "%s: %s" % (item.revision.get_short_commitid(), item.item_description())
19+
20+
description_template = "codespeed/changes_table.html"
21+
22+
def get_context_data(self, **kwargs):
23+
report = kwargs['item']
24+
trendconfig = settings.TREND
25+
26+
tablelist = report.get_changes_table(trendconfig)
1727

18-
def item_description(self, item):
19-
if item.summary:
20-
return item.summary
21-
else:
22-
return "No significant changes"
28+
return {
29+
'tablelist': tablelist,
30+
'trendconfig': trendconfig,
31+
'rev': report.revision,
32+
'exe': report.executable,
33+
'env': report.environment,
34+
}
2335

2436
class LatestEntries(ResultFeed):
2537
description = "Last benchmark runs"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<div class="leftcolumn">
2+
{% include 'codespeed/changes_table.html' %}
3+
</div>
4+
5+
<div class="rightcolumn">
6+
<table class="revision">
7+
<col/>
8+
<col/>
9+
<thead>
10+
<tr>
11+
<th colspan="2">Revision</th>
12+
</tr>
13+
</thead>
14+
<tbody>
15+
<tr class="commit-id">
16+
<th class="infofirst">Commit</th>
17+
<td>{% if rev.get_browsing_url %}<a href="{{ rev.get_browsing_url }}">{{ rev.commitid }}</a>{% else %}{{ rev.commitid }}{% endif %}</td>
18+
</tr>
19+
<tr class="date"><th class="infofirst">Date</td><td>{{ rev.date }}</td></tr>
20+
{% ifnotequal rev.branch.project.repo_type "N" %}
21+
<tr class="repo-path"><th class="infofirst">Repo</th><td>{{ rev.branch.project.repo_path }}</td></tr>
22+
{% endifnotequal %}
23+
</tbody>
24+
</table>
25+
26+
{% ifnotequal exe.project.repo_type 'N' %}
27+
<table class="revision">
28+
<col/>
29+
<col/>
30+
<thead class="commits">
31+
<tr>
32+
<th colspan="2">Commit logs</th>
33+
</tr>
34+
</thead>
35+
<tbody class="commits" data-commitid="{{ rev.id }}">
36+
<tr><td colspan="2" style="text-align:center;">Loading... <img src="{{ STATIC_URL}}images/ajax-loader.gif" align="bottom"></td></tr>
37+
</tbody>
38+
<script type="text/javascript">
39+
var el = $("tbody.commits");
40+
el.load("logs/", "revisionid=" + el.data("commitid"));
41+
</script>
42+
</table>
43+
{% endifnotequal %}
44+
</div>

codespeed/templates/codespeed/changes_table.html

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{% load percentages %}
22

3-
<div class="leftcolumn">
43
{% for units in tablelist %}
54
<table class="tablesorter" data-lessisbetter="{{ units.lessisbetter }}">
65
<thead>
@@ -64,45 +63,3 @@
6463
<tr><td class="infofirst">Kernel</td><td>{{ env.kernel }}</td></tr>
6564
</tbody>
6665
</table>
67-
</div>
68-
69-
<div class="rightcolumn">
70-
<table class="revision">
71-
<col/>
72-
<col/>
73-
<thead>
74-
<tr>
75-
<th colspan="2">Revision</th>
76-
</tr>
77-
</thead>
78-
<tbody>
79-
<tr class="commit-id">
80-
<th class="infofirst">Commit</th>
81-
<td>{% if rev.get_browsing_url %}<a href="{{ rev.get_browsing_url }}">{{ rev.commitid }}</a>{% else %}{{ rev.commitid }}{% endif %}</td>
82-
</tr>
83-
<tr class="date"><th class="infofirst">Date</td><td>{{ rev.date }}</td></tr>
84-
{% ifnotequal rev.branch.project.repo_type "N" %}
85-
<tr class="repo-path"><th class="infofirst">Repo</th><td>{{ rev.branch.project.repo_path }}</td></tr>
86-
{% endifnotequal %}
87-
</tbody>
88-
</table>
89-
90-
{% ifnotequal exe.project.repo_type 'N' %}
91-
<table class="revision">
92-
<col/>
93-
<col/>
94-
<thead class="commits">
95-
<tr>
96-
<th colspan="2">Commit logs</th>
97-
</tr>
98-
</thead>
99-
<tbody class="commits" data-commitid="{{ rev.id }}">
100-
<tr><td colspan="2" style="text-align:center;">Loading... <img src="{{ STATIC_URL}}images/ajax-loader.gif" align="bottom"></td></tr>
101-
</tbody>
102-
<script type="text/javascript">
103-
var el = $("tbody.commits");
104-
el.load("logs/", "revisionid=" + el.data("commitid"));
105-
</script>
106-
</table>
107-
{% endifnotequal %}
108-
</div>

codespeed/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def getchangestable(request):
611611
'<p class="errormessage">No results for this '
612612
'parameters</p>')
613613

614-
return render_to_response('codespeed/changes_table.html', {
614+
return render_to_response('codespeed/changes_data.html', {
615615
'tablelist': tablelist,
616616
'trendconfig': trendconfig,
617617
'rev': selectedrev,

0 commit comments

Comments
 (0)