Skip to content

Commit 9cc8934

Browse files
fixup! views: add series-detail view
1 parent 6eb5ae4 commit 9cc8934

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

patchwork/models.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -962,10 +962,10 @@ def add_patch(self, patch, number):
962962
return patch
963963

964964
def get_absolute_url(self):
965-
# TODO(stephenfin): We really need a proper series view
966965
return reverse(
967-
'patch-list', kwargs={'project_id': self.project.linkname}
968-
) + ('?series=%d' % self.id)
966+
'series-detail',
967+
kwargs={'project_id': self.project.linkname, 'series_id': self.id},
968+
)
969969

970970
def get_mbox_url(self):
971971
return reverse('series-mbox', kwargs={'series_id': self.id})

patchwork/templates/patchwork/partials/download-buttons.html

+11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<div class="btn-group pull-right">
2+
{% if submission %}
23
<button type="button" class="btn btn-default btn-copy"
34
data-clipboard-text="{{ submission.id }}" title="Copy to Clipboard">
45
{{ submission.id }}
@@ -24,4 +25,14 @@
2425
series
2526
</a>
2627
{% endif %}
28+
{% elif series %}
29+
<button type="button" class="btn btn-default btn-copy"
30+
data-clipboard-text="{{ series.id }}" title="Copy to Clipboard">
31+
{{ series.id }}
32+
</button>
33+
<a href="{% url 'series-mbox' series_id=series.id %}"
34+
class="btn btn-default" role="button" title="Download series mbox">
35+
series
36+
</a>
37+
{% endif %}
2738
</div>

patchwork/templates/patchwork/series-detail.html

+15-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
{% block body %}
1313

1414
<div>
15+
{% include "patchwork/partials/download-buttons.html" %}
1516
<h1>{{ series.name }}</h1>
1617
</div>
1718

1819
<table class="patch-meta">
1920
<tr>
20-
<th>Cover Letter</th>
21-
<td>{{ series.cover_letter.content|default:"No cover letter available" }}</td>
21+
<th>Series ID</th>
22+
<td>
23+
{{ series.id }}
24+
<span class="btn-link btn-copy glyphicon glyphicon-copy" data-clipboard-text="{{ request.build_absolute_uri }}{{ series.get_absolute_url }}" title="Copy to Clipboard"></span>
25+
</td>
2226
</tr>
2327
<tr>
2428
<th>Date</th>
@@ -38,4 +42,13 @@ <h2>Patches</h2>
3842
<br>
3943
{% include "patchwork/partials/patch-list.html" %}
4044

45+
<div id="cover-letter">
46+
<h2>Cover Letter</h2>
47+
{% if series.cover_letter.content %}
48+
<pre class="content">{{ series.cover_letter.content }}</pre>
49+
{% else %}
50+
No cover letter available
51+
{% endif %}
52+
</div>
53+
4154
{% endblock %}

0 commit comments

Comments
 (0)