Skip to content

Commit

Permalink
fixup! views: add series-detail view
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-accarini committed Feb 24, 2025
1 parent 6eb5ae4 commit 9cc8934
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
6 changes: 3 additions & 3 deletions patchwork/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,10 +962,10 @@ def add_patch(self, patch, number):
return patch

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

def get_mbox_url(self):
return reverse('series-mbox', kwargs={'series_id': self.id})
Expand Down
11 changes: 11 additions & 0 deletions patchwork/templates/patchwork/partials/download-buttons.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="btn-group pull-right">
{% if submission %}
<button type="button" class="btn btn-default btn-copy"
data-clipboard-text="{{ submission.id }}" title="Copy to Clipboard">
{{ submission.id }}
Expand All @@ -24,4 +25,14 @@
series
</a>
{% endif %}
{% elif series %}
<button type="button" class="btn btn-default btn-copy"
data-clipboard-text="{{ series.id }}" title="Copy to Clipboard">
{{ series.id }}
</button>
<a href="{% url 'series-mbox' series_id=series.id %}"
class="btn btn-default" role="button" title="Download series mbox">
series
</a>
{% endif %}
</div>
17 changes: 15 additions & 2 deletions patchwork/templates/patchwork/series-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@
{% block body %}

<div>
{% include "patchwork/partials/download-buttons.html" %}
<h1>{{ series.name }}</h1>
</div>

<table class="patch-meta">
<tr>
<th>Cover Letter</th>
<td>{{ series.cover_letter.content|default:"No cover letter available" }}</td>
<th>Series ID</th>
<td>
{{ series.id }}
<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>
</td>
</tr>
<tr>
<th>Date</th>
Expand All @@ -38,4 +42,13 @@ <h2>Patches</h2>
<br>
{% include "patchwork/partials/patch-list.html" %}

<div id="cover-letter">
<h2>Cover Letter</h2>
{% if series.cover_letter.content %}
<pre class="content">{{ series.cover_letter.content }}</pre>
{% else %}
No cover letter available
{% endif %}
</div>

{% endblock %}

0 comments on commit 9cc8934

Please sign in to comment.