]> source.dussan.org Git - gitblit.git/commitdiff
Setting to stop a repository from contributing to the activity page
authorJames Moger <james.moger@gitblit.com>
Thu, 6 Dec 2012 22:15:05 +0000 (17:15 -0500)
committerJames Moger <james.moger@gitblit.com>
Thu, 6 Dec 2012 22:15:05 +0000 (17:15 -0500)
src/com/gitblit/client/EditRepositoryDialog.java
src/com/gitblit/utils/ActivityUtils.java
src/com/gitblit/wicket/GitBlitWebApp.properties
src/com/gitblit/wicket/pages/EditRepositoryPage.java

index aa6ad58d12e1c9a4d7d08a6171f4a898a8c24399..6f9ed525cfb80c01c08faad664121e15abc6718c 100644 (file)
@@ -227,10 +227,9 @@ public class EditRepositoryDialog extends JDialog {
                isFrozen = new JCheckBox(Translation.get("gb.isFrozenDescription"),\r
                                anRepository.isFrozen);\r
 \r
-               maxActivityCommits = new JComboBox(new Integer [] { 0, 25, 50, 75, 100, 150, 250, 500 });\r
+               maxActivityCommits = new JComboBox(new Integer [] { -1, 0, 25, 50, 75, 100, 150, 250, 500 });\r
                maxActivityCommits.setSelectedItem(anRepository.maxActivityCommits);\r
 \r
-\r
                mailingListsField = new JTextField(\r
                                ArrayUtils.isEmpty(anRepository.mailingLists) ? ""\r
                                                : StringUtils.flattenStrings(anRepository.mailingLists,\r
index 80aaebbbbd56ad44be66dc7de45df965223f174d..ef3a55e7d71bb04bb3c3dbf45b2a8feba6413779 100644 (file)
@@ -81,6 +81,10 @@ public class ActivityUtils {
 \r
                Map<String, Activity> activity = new HashMap<String, Activity>();\r
                for (RepositoryModel model : models) {\r
+                       if (model.maxActivityCommits == -1) {\r
+                               // skip this repository\r
+                               continue;\r
+                       }\r
                        if (model.hasCommits && model.lastChange.after(thresholdDate)) {\r
                                if (model.isCollectingGarbage) {\r
                                        continue;\r
index 5b42a2c0b6f2f5b566bc4fe28d1913b39e4d87e5..16f7641185bdca6268268528d8c07f42b757bfb0 100644 (file)
@@ -439,4 +439,5 @@ gb.serveCertificate = serve https with this certificate
 gb.sslCertificateGeneratedRestart = Successfully generated new server SSL certificate for {0}.\nYou must restart Gitblit to use the new certificate.\n\nIf you are launching with the '--alias' parameter you will have to set that to ''--alias {0}''.\r
 gb.validity = validity\r
 gb.siteName = site name\r
-gb.siteNameDescription = short, descriptive name of your server 
\ No newline at end of file
+gb.siteNameDescription = short, descriptive name of your server \r
+gb.excludeFromActivity = exclude from activity page
\ No newline at end of file
index 7f66f688e4da2310673d53d02e0d80ab827363c2..a071b69e70a8391111d59d7867057b9f7be3f35f 100644 (file)
@@ -414,7 +414,7 @@ public class EditRepositoryPage extends RootSubPage {
                form.add(new CheckBox("showReadme"));\r
                form.add(new CheckBox("skipSizeCalculation"));\r
                form.add(new CheckBox("skipSummaryMetrics"));\r
-               List<Integer> maxActivityCommits  = Arrays.asList(0, 25, 50, 75, 100, 150, 200, 250, 500 );\r
+               List<Integer> maxActivityCommits  = Arrays.asList(-1, 0, 25, 50, 75, 100, 150, 200, 250, 500 );\r
                form.add(new DropDownChoice<Integer>("maxActivityCommits", maxActivityCommits, new MaxActivityCommitsRenderer()));\r
 \r
                mailingLists = new Model<String>(ArrayUtils.isEmpty(repositoryModel.mailingLists) ? ""\r
@@ -666,7 +666,9 @@ public class EditRepositoryPage extends RootSubPage {
 \r
                @Override\r
                public String getDisplayValue(Integer value) {\r
-                       if (value == 0) {\r
+                       if (value == -1) {\r
+                               return getString("gb.excludeFromActivity");\r
+                       } else if (value == 0) {\r
                                return getString("gb.noMaximum");\r
                        } else {\r
                                return value + " " + getString("gb.commits");\r