summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-06-05 12:19:07 -0400
committerJames Moger <james.moger@gitblit.com>2014-06-05 12:19:07 -0400
commitbfce9f59fca542d7b96b88d67494336b0c50b045 (patch)
treee2156976dbe89e6cabdbf367fb61f3c7ce2a4321 /src/main
parent1984375641fe0880f64e378e8116ca433b28dac2 (diff)
downloadgitblit-bfce9f59fca542d7b96b88d67494336b0c50b045.tar.gz
gitblit-bfce9f59fca542d7b96b88d67494336b0c50b045.zip
Add setting to control inclusion of personal repositories in the main list
Diffstat (limited to 'src/main')
-rw-r--r--src/main/distrib/data/gitblit.properties5
-rw-r--r--src/main/java/com/gitblit/wicket/pages/RepositoriesPage.java13
2 files changed, 17 insertions, 1 deletions
diff --git a/src/main/distrib/data/gitblit.properties b/src/main/distrib/data/gitblit.properties
index d5623cd5..65fe41e5 100644
--- a/src/main/distrib/data/gitblit.properties
+++ b/src/main/distrib/data/gitblit.properties
@@ -782,6 +782,11 @@ web.allowCookieAuthentication = true
# SINCE 1.6.0
web.allowDeletingNonEmptyRepositories = true
+# Setting to include personal repositories in the main repositories list.
+#
+# SINCE 1.6.0
+web.includePersonalRepositories = false
+
# Config file for storing project metadata
#
# SINCE 1.2.0
diff --git a/src/main/java/com/gitblit/wicket/pages/RepositoriesPage.java b/src/main/java/com/gitblit/wicket/pages/RepositoriesPage.java
index a0b15a83..660b4ed1 100644
--- a/src/main/java/com/gitblit/wicket/pages/RepositoriesPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/RepositoriesPage.java
@@ -21,6 +21,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import org.apache.wicket.Component;
@@ -30,8 +31,8 @@ import org.eclipse.jgit.lib.Constants;
import com.gitblit.Keys;
import com.gitblit.models.Menu.ParameterMenuItem;
-import com.gitblit.models.NavLink.DropDownPageMenuNavLink;
import com.gitblit.models.NavLink;
+import com.gitblit.models.NavLink.DropDownPageMenuNavLink;
import com.gitblit.models.RepositoryModel;
import com.gitblit.utils.MarkdownUtils;
import com.gitblit.utils.StringUtils;
@@ -79,7 +80,17 @@ public class RepositoriesPage extends RootPage {
.setEscapeModelStrings(false).setVisible(message.length() > 0);
add(repositoriesMessage);
+ // conditionally include personal repositories in this page
List<RepositoryModel> repositories = getRepositories(params);
+ if (!app().settings().getBoolean(Keys.web.includePersonalRepositories, true)) {
+ Iterator<RepositoryModel> itr = repositories.iterator();
+ while (itr.hasNext()) {
+ RepositoryModel rm = itr.next();
+ if (rm.isPersonalRepository()) {
+ itr.remove();
+ }
+ }
+ }
RepositoriesPanel repositoriesPanel = new RepositoriesPanel("repositoriesPanel", showAdmin,
true, repositories, true, getAccessRestrictions());