From a03ecee4acc03411c90170dd704d9f87c82616ed Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 3 Oct 2012 17:24:56 -0400 Subject: [PATCH] Implemented support for toggling Repository.allowForks in Manager --- src/com/gitblit/client/EditRepositoryDialog.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/com/gitblit/client/EditRepositoryDialog.java b/src/com/gitblit/client/EditRepositoryDialog.java index 8ce076ec..840281bd 100644 --- a/src/com/gitblit/client/EditRepositoryDialog.java +++ b/src/com/gitblit/client/EditRepositoryDialog.java @@ -105,6 +105,8 @@ public class EditRepositoryDialog extends JDialog { private JRadioButton allowAuthenticated; private JRadioButton allowNamed; + + private JCheckBox allowForks; private JComboBox federationStrategy; @@ -228,6 +230,8 @@ public class EditRepositoryDialog extends JDialog { JPanel authorizationPanel = new JPanel(new GridLayout(0, 1)); authorizationPanel.add(allowAuthenticated); authorizationPanel.add(allowNamed); + + allowForks = new JCheckBox(Translation.get("gb.allowForks"), anRepository.allowForks); // federation strategies - remove ORIGIN choice if this repository has // no origin. @@ -262,17 +266,22 @@ public class EditRepositoryDialog extends JDialog { skipSizeCalculation)); fieldsPanel.add(newFieldPanel(Translation.get("gb.skipSummaryMetrics"), skipSummaryMetrics)); - fieldsPanel - .add(newFieldPanel(Translation.get("gb.isFrozen"), isFrozen)); fieldsPanel.add(newFieldPanel(Translation.get("gb.mailingLists"), mailingListsField)); + JPanel clonePushPanel = new JPanel(new GridLayout(0, 1)); + clonePushPanel + .add(newFieldPanel(Translation.get("gb.isFrozen"), isFrozen)); + clonePushPanel + .add(newFieldPanel(Translation.get("gb.allowForks"), allowForks)); + usersPalette = new JPalette(); JPanel northAccessPanel = new JPanel(new BorderLayout(5, 5)); northAccessPanel.add(newFieldPanel(Translation.get("gb.accessRestriction"), accessRestriction), BorderLayout.NORTH); northAccessPanel.add(newFieldPanel(Translation.get("gb.authorizationControl"), authorizationPanel), BorderLayout.CENTER); + northAccessPanel.add(clonePushPanel, BorderLayout.SOUTH); JPanel accessPanel = new JPanel(new BorderLayout(5, 5)); accessPanel.add(northAccessPanel, BorderLayout.NORTH); @@ -472,7 +481,9 @@ public class EditRepositoryDialog extends JDialog { repository.showReadme = showReadme.isSelected(); repository.skipSizeCalculation = skipSizeCalculation.isSelected(); repository.skipSummaryMetrics = skipSummaryMetrics.isSelected(); + repository.isFrozen = isFrozen.isSelected(); + repository.allowForks = allowForks.isSelected(); String ml = mailingListsField.getText(); if (!StringUtils.isEmpty(ml)) { -- 2.39.5