From a0d5c865f8e7161f73d5e4420e662e81f1640acd Mon Sep 17 00:00:00 2001 From: James Moger Date: Tue, 15 Apr 2014 22:54:30 -0400 Subject: [PATCH] Do not show patchset details on closed tickets --- .../com/gitblit/wicket/pages/TicketPage.html | 8 ++++---- .../com/gitblit/wicket/pages/TicketPage.java | 20 ++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/pages/TicketPage.html b/src/main/java/com/gitblit/wicket/pages/TicketPage.html index a2f105d3..aa52d8fa 100644 --- a/src/main/java/com/gitblit/wicket/pages/TicketPage.html +++ b/src/main/java/com/gitblit/wicket/pages/TicketPage.html @@ -316,9 +316,10 @@ pt push -
+
-
+
+
@@ -351,9 +352,8 @@ pt push -
-
+
diff --git a/src/main/java/com/gitblit/wicket/pages/TicketPage.java b/src/main/java/com/gitblit/wicket/pages/TicketPage.java index c8626c29..659acad0 100644 --- a/src/main/java/com/gitblit/wicket/pages/TicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/TicketPage.java @@ -774,12 +774,19 @@ public class TicketPage extends TicketBasePage { Fragment patchsetFrag = new Fragment("patchset", "patchsetFragment", this); patchsetFrag.add(new Label("commitsInPatchset", MessageFormat.format(getString("gb.commitsInPatchsetN"), currentPatchset.number))); - // current revision - MarkupContainer panel = createPatchsetPanel("panel", repository, user); - patchsetFrag.add(panel); - addUserAttributions(patchsetFrag, currentRevision, avatarWidth); - addUserAttributions(panel, currentRevision, 0); - addDateAttributions(panel, currentRevision); + patchsetFrag.add(createMergePanel(user, repository)); + + if (ticket.isOpen()) { + // current revision + MarkupContainer panel = createPatchsetPanel("panel", repository, user); + patchsetFrag.add(panel); + addUserAttributions(patchsetFrag, currentRevision, avatarWidth); + addUserAttributions(panel, currentRevision, 0); + addDateAttributions(panel, currentRevision); + } else { + // current revision + patchsetFrag.add(new Label("panel").setVisible(false)); + } // commits List commits = JGitUtils.getRevLog(getRepository(), currentPatchset.base, currentPatchset.tip); @@ -1213,7 +1220,6 @@ public class TicketPage extends TicketBasePage { addPtCheckoutInstructions(user, repository, panel); addGitCheckoutInstructions(user, repository, panel); - panel.add(createMergePanel(user, repository)); return panel; } -- 2.39.5