From 0fe3f5cde171a32f9f05359ec05ab25c30664dc8 Mon Sep 17 00:00:00 2001 From: Miguel Saura Date: Thu, 4 Jan 2024 14:10:06 +0100 Subject: [PATCH] Add next button to navigate within a patch series --- patchwork/templates/patchwork/submission.html | 9 +++++++++ patchwork/views/patch.py | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/patchwork/templates/patchwork/submission.html b/patchwork/templates/patchwork/submission.html index 6ebd84152..bb961ac59 100644 --- a/patchwork/templates/patchwork/submission.html +++ b/patchwork/templates/patchwork/submission.html @@ -20,6 +20,15 @@

{{ submission.name }}

+{% if next_submission %} +
+ + next + +
+{% endif %} + diff --git a/patchwork/views/patch.py b/patchwork/views/patch.py index e2c595fba..95679923f 100644 --- a/patchwork/views/patch.py +++ b/patchwork/views/patch.py @@ -136,6 +136,13 @@ def patch_detail(request, project_id, msgid): related_same_project = [] related_different_project = [] + context['next_submission'] = None + patch_series = patch.series.patches.all() + num_patches = patch.series.patches.count() + for idx in range(num_patches - 1): + if patch.id == patch_series[idx].id: + context['next_submission'] = patch_series[idx + 1] + context['comments'] = comments context['checks'] = Patch.filter_unique_checks( patch.check_set.all().select_related('user'),
Message ID