diff --git a/patchwork/templates/patchwork/submission.html b/patchwork/templates/patchwork/submission.html index cd74491c..88ad58aa 100644 --- a/patchwork/templates/patchwork/submission.html +++ b/patchwork/templates/patchwork/submission.html @@ -20,6 +20,20 @@
Message ID | diff --git a/patchwork/views/patch.py b/patchwork/views/patch.py index 198b26ca..e1f86ef2 100644 --- a/patchwork/views/patch.py +++ b/patchwork/views/patch.py @@ -133,6 +133,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)
---|