diff options
Diffstat (limited to 'src/com/gitblit/wicket')
-rw-r--r-- | src/com/gitblit/wicket/pages/ProjectPage.java | 4 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/ProjectsPage.java | 7 | ||||
-rw-r--r-- | src/com/gitblit/wicket/panels/RepositoriesPanel.java | 18 |
3 files changed, 10 insertions, 19 deletions
diff --git a/src/com/gitblit/wicket/pages/ProjectPage.java b/src/com/gitblit/wicket/pages/ProjectPage.java index bc546dfc..e10ca900 100644 --- a/src/com/gitblit/wicket/pages/ProjectPage.java +++ b/src/com/gitblit/wicket/pages/ProjectPage.java @@ -300,8 +300,8 @@ public class ProjectPage extends RootPage { @Override
protected List<ProjectModel> getProjectModels() {
if (projectModels.isEmpty()) {
- final UserModel user = GitBlitWebSession.get().getUser();
- List<ProjectModel> projects = GitBlit.self().getProjectModels(user, false);
+ List<RepositoryModel> repositories = getRepositoryModels();
+ List<ProjectModel> projects = GitBlit.self().getProjectModels(repositories, false);
projectModels.addAll(projects);
}
return projectModels;
diff --git a/src/com/gitblit/wicket/pages/ProjectsPage.java b/src/com/gitblit/wicket/pages/ProjectsPage.java index 4e3e6309..7f0b002e 100644 --- a/src/com/gitblit/wicket/pages/ProjectsPage.java +++ b/src/com/gitblit/wicket/pages/ProjectsPage.java @@ -36,7 +36,6 @@ import org.eclipse.jgit.lib.Constants; import com.gitblit.GitBlit;
import com.gitblit.Keys;
import com.gitblit.models.ProjectModel;
-import com.gitblit.models.UserModel;
import com.gitblit.utils.MarkdownUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.GitBlitWebSession;
@@ -48,8 +47,6 @@ import com.gitblit.wicket.panels.LinkPanel; public class ProjectsPage extends RootPage {
- List<ProjectModel> projectModels = new ArrayList<ProjectModel>();
-
public ProjectsPage() {
super();
setup(null);
@@ -67,9 +64,7 @@ public class ProjectsPage extends RootPage { @Override
protected List<ProjectModel> getProjectModels() {
- final UserModel user = GitBlitWebSession.get().getUser();
- List<ProjectModel> projects = GitBlit.self().getProjectModels(user, false);
- return projects;
+ return GitBlit.self().getProjectModels(getRepositoryModels(), false);
}
private void setup(PageParameters params) {
diff --git a/src/com/gitblit/wicket/panels/RepositoriesPanel.java b/src/com/gitblit/wicket/panels/RepositoriesPanel.java index d3b8ddbe..976c517f 100644 --- a/src/com/gitblit/wicket/panels/RepositoriesPanel.java +++ b/src/com/gitblit/wicket/panels/RepositoriesPanel.java @@ -123,22 +123,18 @@ public class RepositoriesPanel extends BasePanel { if (rootRepositories.size() > 0) {
// inject the root repositories at the top of the page
- String rootPath = GitBlit.getString(Keys.web.repositoryRootGroupName, " ");
- roots.add(0, rootPath);
- groups.put(rootPath, rootRepositories);
+ roots.add(0, "");
+ groups.put("", rootRepositories);
}
- Map<String, ProjectModel> projects = new HashMap<String, ProjectModel>();
- for (ProjectModel project : GitBlit.self().getProjectModels(user, true)) {
- projects.put(project.name, project);
- }
List<RepositoryModel> groupedModels = new ArrayList<RepositoryModel>();
for (String root : roots) {
List<RepositoryModel> subModels = groups.get(root);
- GroupRepositoryModel group = new GroupRepositoryModel(root, subModels.size());
- if (projects.containsKey(root)) {
- group.title = projects.get(root).title;
- group.description = projects.get(root).description;
+ ProjectModel project = GitBlit.self().getProjectModel(root);
+ GroupRepositoryModel group = new GroupRepositoryModel(project.name, subModels.size());
+ if (project != null) {
+ group.title = project.title;
+ group.description = project.description;
}
groupedModels.add(group);
Collections.sort(subModels);
|