diff options
-rw-r--r-- | releases.moxie | 3 | ||||
-rw-r--r-- | src/main/distrib/data/gitblit.properties | 5 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/RepositoriesPage.java | 13 |
3 files changed, 20 insertions, 1 deletions
diff --git a/releases.moxie b/releases.moxie index c7299a7e..fc139b77 100644 --- a/releases.moxie +++ b/releases.moxie @@ -29,6 +29,7 @@ r24: { - Overhaul the EmptyRepositoryPage (ticket-73) - Overhauled the edit repository page (ticket-76) - Process bugtraq links in the ticket description and comments (ticket-78) + - Exclude personal repositories from the repositories list, by default (issue-419, ticket-95) additions: - Add My Tickets page (issue-215, ticket-15) - Added CRUD functionality for Ticket Milestones (ticket-17) @@ -55,8 +56,10 @@ r24: { - Marcus Hunger - Matthias Cullmann - Emmeran Seehuber + - Sascha Vogt settings: - { name: 'web.allowDeletingNonEmptyRepositories', defaultValue: 'true' } + - { name: 'web.includePersonalRepositories', defaultValue: 'false' } - { name: 'mail.starttls', defaultValue: 'false' } - { name: 'execution.defaultThreadPoolSize', defaultValue: '1' } - { name: 'git.gitignoreFolder', defaultValue: '${baseFolder}/gitignore' } 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());
|