Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
views: add series navigation buttons for patch-detail view
Signed-off-by: Victor Accarini <victor.accarini@profusion.mobi>
  • Loading branch information
andrepapoti authored and victor-accarini committed Jun 11, 2025
commit ef6a553f1b8eca3ee20146a4a938e2a76a1993aa
14 changes: 14 additions & 0 deletions patchwork/templates/patchwork/submission.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@
<h1>{{ submission.name }}</h1>
</div>

<div class="btn-group pull-right">
<a class="btn btn-default {% if not next_submission %} disabled {% endif %}"
{% if next_submission %} href="{% url 'patch-detail' project_id=project.linkname msgid=next_submission.encoded_msgid %}" {% endif %}>
next
</a>
</div>

<div class="btn-group pull-right">
<a class="btn btn-default {% if not previous_submission %} disabled {% endif %}"
{% if previous_submission %} href="{% url 'patch-detail' project_id=project.linkname msgid=previous_submission.encoded_msgid %}" {% endif %}>
previous
</a>
</div>

<table id="patch-meta" class="patch-meta" data-submission-type={{submission|verbose_name_plural|lower}} data-submission-id={{submission.id}}>
<tr>
<th>Message ID</th>
Expand Down
14 changes: 14 additions & 0 deletions patchwork/views/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,20 @@ def patch_detail(request, project_id, msgid):
if errors:
context['errors'] = errors

try:
context['previous_submission'] = Patch.objects.get(
series=patch.series, number=patch.number - 1
)
except Patch.DoesNotExist:
context['previous_submission'] = None

try:
context['next_submission'] = Patch.objects.get(
series=patch.series, number=patch.number + 1
)
except Patch.DoesNotExist:
context['next_submission'] = None

return render(request, 'patchwork/submission.html', context)


Expand Down