]> source.dussan.org Git - gitblit.git/commitdiff
Implemented Manager support for team roles and verify committer
authorJames Moger <james.moger@gitblit.com>
Fri, 12 Oct 2012 22:11:41 +0000 (18:11 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 12 Oct 2012 22:11:41 +0000 (18:11 -0400)
src/com/gitblit/client/EditRepositoryDialog.java
src/com/gitblit/client/EditTeamDialog.java

index 840281bd77fecba45f10d03188dcbcadf19c7bc2..e15b1546d43135ce33568104f58260628baf9007 100644 (file)
@@ -108,6 +108,8 @@ public class EditRepositoryDialog extends JDialog {
        \r
        private JCheckBox allowForks;\r
 \r
+       private JCheckBox verifyCommitter;\r
+\r
        private JComboBox federationStrategy;\r
 \r
        private JComboBox ownerField;\r
@@ -231,7 +233,8 @@ public class EditRepositoryDialog extends JDialog {
                authorizationPanel.add(allowAuthenticated);\r
                authorizationPanel.add(allowNamed);\r
                \r
-               allowForks = new JCheckBox(Translation.get("gb.allowForks"), anRepository.allowForks);\r
+               allowForks = new JCheckBox(Translation.get("gb.allowForksDescription"), anRepository.allowForks);\r
+               verifyCommitter = new JCheckBox(Translation.get("gb.verifyCommitterDescription"), anRepository.verifyCommitter);\r
 \r
                // federation strategies - remove ORIGIN choice if this repository has\r
                // no origin.\r
@@ -274,6 +277,8 @@ public class EditRepositoryDialog extends JDialog {
                .add(newFieldPanel(Translation.get("gb.isFrozen"), isFrozen));\r
                clonePushPanel\r
                .add(newFieldPanel(Translation.get("gb.allowForks"), allowForks));\r
+               clonePushPanel\r
+               .add(newFieldPanel(Translation.get("gb.verifyCommitter"), verifyCommitter));\r
 \r
                usersPalette = new JPalette<String>();\r
                JPanel northAccessPanel = new JPanel(new BorderLayout(5, 5));\r
@@ -484,6 +489,7 @@ public class EditRepositoryDialog extends JDialog {
                \r
                repository.isFrozen = isFrozen.isSelected();\r
                repository.allowForks = allowForks.isSelected();\r
+               repository.verifyCommitter = verifyCommitter.isSelected();\r
 \r
                String ml = mailingListsField.getText();\r
                if (!StringUtils.isEmpty(ml)) {\r
index 2f9796ce238e5b413337716778933bbf1efc19c6..57d6bcfbbaf5cea7f8f830268c86792eb938ca17 100644 (file)
@@ -33,6 +33,7 @@ import java.util.Set;
 \r
 import javax.swing.ImageIcon;\r
 import javax.swing.JButton;\r
+import javax.swing.JCheckBox;\r
 import javax.swing.JComponent;\r
 import javax.swing.JDialog;\r
 import javax.swing.JLabel;\r
@@ -64,6 +65,12 @@ public class EditTeamDialog extends JDialog {
        private boolean canceled = true;\r
 \r
        private JTextField teamnameField;\r
+       \r
+       private JCheckBox canAdminCheckbox;\r
+       \r
+       private JCheckBox canForkCheckbox;\r
+       \r
+       private JCheckBox canCreateCheckbox;\r
 \r
        private JTextField mailingListsField;\r
 \r
@@ -115,11 +122,19 @@ public class EditTeamDialog extends JDialog {
        private void initialize(int protocolVersion, TeamModel aTeam) {\r
                teamnameField = new JTextField(aTeam.name == null ? "" : aTeam.name, 25);\r
 \r
+               canAdminCheckbox = new JCheckBox(Translation.get("gb.canAdminDescription"), aTeam.canAdmin);            \r
+               canForkCheckbox = new JCheckBox(Translation.get("gb.canForkDescription"), aTeam.canFork);\r
+               canCreateCheckbox = new JCheckBox(Translation.get("gb.canCreateDescription"), aTeam.canCreate);\r
+\r
                mailingListsField = new JTextField(aTeam.mailingLists == null ? ""\r
                                : StringUtils.flattenStrings(aTeam.mailingLists, " "), 50);\r
 \r
                JPanel fieldsPanel = new JPanel(new GridLayout(0, 1));\r
                fieldsPanel.add(newFieldPanel(Translation.get("gb.teamName"), teamnameField));\r
+               fieldsPanel.add(newFieldPanel(Translation.get("gb.canAdmin"), canAdminCheckbox));\r
+               fieldsPanel.add(newFieldPanel(Translation.get("gb.canFork"), canForkCheckbox));\r
+               fieldsPanel.add(newFieldPanel(Translation.get("gb.canCreate"), canCreateCheckbox));\r
+\r
                fieldsPanel.add(newFieldPanel(Translation.get("gb.mailingLists"), mailingListsField));\r
 \r
                final Insets _insets = new Insets(5, 5, 5, 5);\r
@@ -246,6 +261,10 @@ public class EditTeamDialog extends JDialog {
                }\r
                team.name = tname;\r
 \r
+               team.canAdmin = canAdminCheckbox.isSelected();\r
+               team.canFork = canForkCheckbox.isSelected();\r
+               team.canCreate = canCreateCheckbox.isSelected();\r
+\r
                String ml = mailingListsField.getText();\r
                if (!StringUtils.isEmpty(ml)) {\r
                        Set<String> list = new HashSet<String>();\r