diff --git a/patchwork/templates/patchwork/submission.html b/patchwork/templates/patchwork/submission.html index 85e7be4b..90ee22b2 100644 --- a/patchwork/templates/patchwork/submission.html +++ b/patchwork/templates/patchwork/submission.html @@ -20,6 +20,22 @@
Message ID | diff --git a/patchwork/views/patch.py b/patchwork/views/patch.py index 54cf992c..4d0ec4eb 100644 --- a/patchwork/views/patch.py +++ b/patchwork/views/patch.py @@ -148,6 +148,20 @@ def patch_detail(request, project_id, msgid): context['related_same_project'] = related_same_project context['related_different_project'] = related_different_project + 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)
---|