summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/gitblit/wicket/pages')
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.html5
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.java66
-rw-r--r--src/com/gitblit/wicket/pages/RepositoriesPage.html70
-rw-r--r--src/com/gitblit/wicket/pages/RepositoriesPage.java133
4 files changed, 219 insertions, 55 deletions
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.html b/src/com/gitblit/wicket/pages/EditRepositoryPage.html
index db5ab229..763d46fb 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.html
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.html
@@ -17,13 +17,14 @@
<tbody>
<tr><th><wicket:message key="gb.name"></wicket:message></th><td class="edit"><input type="text" wicket:id="name" id="name" size="40" tabindex="1" /></td></tr>
<tr><th><wicket:message key="gb.description"></wicket:message></th><td class="edit"><input type="text" wicket:id="description" size="40" tabindex="2" /></td></tr>
- <tr><th><wicket:message key="gb.owner"></wicket:message></th><td class="edit"><input type="text" wicket:id="owner" size="40" tabindex="3" /></td></tr>
+ <tr><th><wicket:message key="gb.owner"></wicket:message></th><td class="edit"><select wicket:id="owner" tabindex="3" /></td></tr>
<tr><th><wicket:message key="gb.enableTickets"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="useTickets" tabindex="4" /> &nbsp;<i><wicket:message key="gb.useTicketsDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.enableDocs"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="useDocs" tabindex="5" /> &nbsp;<i><wicket:message key="gb.useDocsDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.showRemoteBranches"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="showRemoteBranches" tabindex="6" /> &nbsp;<i><wicket:message key="gb.showRemoteBranchesDescription"></wicket:message></i></td></tr>
<tr><th><wicket:message key="gb.accessRestriction"></wicket:message></th><td class="edit"><select wicket:id="accessRestriction" tabindex="7" /></td></tr>
+ <tr><th><wicket:message key="gb.isFrozen"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="isFrozen" tabindex="8" /> &nbsp;<i><wicket:message key="gb.isFrozenDescription"></wicket:message></i></td></tr>
<tr><th style="vertical-align: top;"><wicket:message key="gb.permittedUsers"></wicket:message></th><td style="padding:2px;"><span wicket:id="users"></span></td></tr>
- <tr><th></th><td class="editButton"><input type="submit" value="Save" wicket:message="value:gb.save" tabindex="8" /></td></tr>
+ <tr><th></th><td class="editButton"><input type="submit" value="Save" wicket:message="value:gb.save" tabindex="9" /></td></tr>
</tbody>
</table>
</form>
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
index 88202901..56d1d558 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
@@ -3,6 +3,7 @@ package com.gitblit.wicket.pages;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
@@ -23,13 +24,14 @@ import org.apache.wicket.model.util.ListModel;
import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.GitBlit;
import com.gitblit.GitBlitException;
+import com.gitblit.Keys;
import com.gitblit.utils.StringUtils;
-import com.gitblit.wicket.AdminPage;
import com.gitblit.wicket.BasePage;
+import com.gitblit.wicket.GitBlitWebSession;
import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.models.RepositoryModel;
+import com.gitblit.wicket.models.UserModel;
-@AdminPage
public class EditRepositoryPage extends BasePage {
private final boolean isCreate;
@@ -51,6 +53,9 @@ public class EditRepositoryPage extends BasePage {
}
protected void setupPage(final RepositoryModel repositoryModel) {
+ // ensure this user can create or edit this repository
+ checkPermissions(repositoryModel);
+
List<String> repositoryUsers = new ArrayList<String>();
if (isCreate) {
super.setupPage("", getString("gb.newRepository"));
@@ -58,6 +63,7 @@ public class EditRepositoryPage extends BasePage {
super.setupPage("", getString("gb.edit"));
if (repositoryModel.accessRestriction.exceeds(AccessRestrictionType.NONE)) {
repositoryUsers.addAll(GitBlit.self().getRepositoryUsers(repositoryModel));
+ Collections.sort(repositoryUsers);
}
}
@@ -99,10 +105,10 @@ public class EditRepositoryPage extends BasePage {
error("Please select access restriction!");
return;
}
-
+
// save the repository
GitBlit.self().editRepositoryModel(repositoryModel, isCreate);
-
+
// save the repository access list
if (repositoryModel.accessRestriction.exceeds(AccessRestrictionType.NONE)) {
Iterator<String> users = usersPalette.getSelectedChoices();
@@ -110,6 +116,10 @@ public class EditRepositoryPage extends BasePage {
while (users.hasNext()) {
repositoryUsers.add(users.next());
}
+ // ensure the owner is added to the user list
+ if (!repositoryUsers.contains(repositoryModel.owner)) {
+ repositoryUsers.add(repositoryModel.owner);
+ }
GitBlit.self().setRepositoryUsers(repositoryModel, repositoryUsers);
}
} catch (GitBlitException e) {
@@ -124,8 +134,9 @@ public class EditRepositoryPage extends BasePage {
// field names reflective match RepositoryModel fields
form.add(new TextField<String>("name").setEnabled(isCreate));
form.add(new TextField<String>("description"));
- form.add(new TextField<String>("owner"));
+ form.add(new DropDownChoice<String>("owner", GitBlit.self().getAllUsernames()).setEnabled(GitBlitWebSession.get().canAdmin()));
form.add(new DropDownChoice<AccessRestrictionType>("accessRestriction", Arrays.asList(AccessRestrictionType.values()), new AccessRestrictionRenderer()));
+ form.add(new CheckBox("isFrozen"));
form.add(new CheckBox("useTickets"));
form.add(new CheckBox("useDocs"));
form.add(new CheckBox("showRemoteBranches"));
@@ -133,6 +144,51 @@ public class EditRepositoryPage extends BasePage {
add(form);
}
+
+ /**
+ * Unfortunately must repeat part of AuthorizaitonStrategy here because that
+ * mechanism does not take PageParameters into consideration, only page
+ * instantiation.
+ *
+ * Repository Owners should be able to edit their repository.
+ */
+ private void checkPermissions(RepositoryModel model) {
+ boolean authenticateAdmin = GitBlit.self().settings().getBoolean(Keys.web.authenticateAdminPages, true);
+ boolean allowAdmin = GitBlit.self().settings().getBoolean(Keys.web.allowAdministration, true);
+
+ GitBlitWebSession session = GitBlitWebSession.get();
+ UserModel user = session.getUser();
+
+ if (allowAdmin) {
+ if (authenticateAdmin) {
+ if (user == null) {
+ // No Login Available
+ error("Administration requires a login", true);
+ }
+ if (isCreate) {
+ // Create Repository
+ if (!user.canAdmin()) {
+ // Only Administrators May Create
+ error("Only an administrator may create a repository", true);
+ }
+ } else {
+ // Edit Repository
+ if (user.canAdmin()) {
+ // Admins can edit everything
+ return;
+ } else {
+ if (!model.owner.equalsIgnoreCase(user.getUsername())) {
+ // User is not an Admin nor Owner
+ error("Only an administrator or the owner may edit a repository", true);
+ }
+ }
+ }
+ }
+ } else {
+ // No Administration Permitted
+ error("Administration is disabled", true);
+ }
+ }
private class AccessRestrictionRenderer implements IChoiceRenderer<AccessRestrictionType> {
diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.html b/src/com/gitblit/wicket/pages/RepositoriesPage.html
index 9c27f793..d00c498a 100644
--- a/src/com/gitblit/wicket/pages/RepositoriesPage.html
+++ b/src/com/gitblit/wicket/pages/RepositoriesPage.html
@@ -10,30 +10,21 @@
</wicket:head>
<body>
-<wicket:extend>
- <div style="text-align:center;padding-top:5px;" wicket:id="feedback">[Feedback Panel]</div>
+<wicket:extend>
+ <!-- Filler div -->
+ <div style="padding-top:18px;"></div>
+
+ <div style="text-align:center;padding-bottom:5px;" wicket:id="feedback">[Feedback Panel]</div>
- <div class="markdown" style="padding-top:5px;" wicket:id="repositoriesMessage">[repositories message]</div>
+ <div class="markdown" style="margin-top:-0.5em;padding-bottom:5px;" wicket:id="repositoriesMessage">[repositories message]</div>
- <div style="padding-top:5px;" wicket:id="adminPanel">[admin links]</div>
+ <div wicket:id="adminPanel">[admin links]</div>
<table class="repositories">
- <tr>
- <th wicket:id="orderByRepository"><wicket:message key="gb.repository">Repository</wicket:message></th>
- <th wicket:id="orderByDescription"><wicket:message key="gb.description">Description</wicket:message></th>
- <th wicket:id="orderByOwner"><wicket:message key="gb.owner">Owner</wicket:message></th>
- <th></th>
- <th wicket:id="orderByDate"><wicket:message key="gb.lastChange">Last Change</wicket:message></th>
- <th></th>
- </tr>
- <tbody>
- <tr wicket:id="repository">
- <td><div class="list" wicket:id="repositoryName">[repository name]</div></td>
- <td><div class="list" wicket:id="repositoryDescription">[repository description]</div></td>
- <td class="author"><span wicket:id="repositoryOwner">[repository owner]</span></td>
- <td class="icon"><img wicket:id="ticketsIcon" /><img wicket:id="docsIcon" /><img wicket:id="accessRestrictionIcon" /></td>
- <td><span wicket:id="repositoryLastChange">[last change]</span></td>
- <td class="rightAlign"><span wicket:id="repositoryLinks"></span></td>
+ <span wicket:id="headerContent"></span>
+ <tbody>
+ <tr wicket:id="row">
+ <span wicket:id="rowContent"></span>
</tr>
</tbody>
</table>
@@ -48,6 +39,45 @@
<wicket:fragment wicket:id="repositoryAdminLinks">
<span class="link"><a wicket:id="editRepository"><wicket:message key="gb.edit">[edit]</wicket:message></a> | <a wicket:id="renameRepository"><wicket:message key="gb.rename">[rename]</wicket:message></a> | <a wicket:id="deleteRepository"><wicket:message key="gb.delete">[delete]</wicket:message></a></span>
</wicket:fragment>
+
+ <wicket:fragment wicket:id="repositoryOwnerLinks">
+ <span class="link"><a wicket:id="editRepository"><wicket:message key="gb.edit">[edit]</wicket:message></a></span>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="flatHeader">
+ <tr>
+ <th wicket:id="orderByRepository"><wicket:message key="gb.repository">Repository</wicket:message></th>
+ <th wicket:id="orderByDescription"><wicket:message key="gb.description">Description</wicket:message></th>
+ <th wicket:id="orderByOwner"><wicket:message key="gb.owner">Owner</wicket:message></th>
+ <th></th>
+ <th wicket:id="orderByDate"><wicket:message key="gb.lastChange">Last Change</wicket:message></th>
+ <th></th>
+ </tr>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="groupHeader">
+ <tr>
+ <th><wicket:message key="gb.repository">Repository</wicket:message></th>
+ <th><wicket:message key="gb.description">Description</wicket:message></th>
+ <th><wicket:message key="gb.owner">Owner</wicket:message></th>
+ <th></th>
+ <th><wicket:message key="gb.lastChange">Last Change</wicket:message></th>
+ <th></th>
+ </tr>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="groupRow">
+ <td colspan="6"><span wicket:id="groupName">[group name]</span></td>
+ </wicket:fragment>
+
+ <wicket:fragment wicket:id="repositoryRow">
+ <td><div class="list" wicket:id="repositoryName">[repository name]</div></td>
+ <td><div class="list" wicket:id="repositoryDescription">[repository description]</div></td>
+ <td class="author"><span wicket:id="repositoryOwner">[repository owner]</span></td>
+ <td style="text-align: right;padding-right:10px;"><img class="inlineIcon" wicket:id="ticketsIcon" /><img class="inlineIcon" wicket:id="docsIcon" /><img class="inlineIcon" wicket:id="frozenIcon" /><img class="inlineIcon" wicket:id="accessRestrictionIcon" /></td>
+ <td><span wicket:id="repositoryLastChange">[last change]</span></td>
+ <td class="rightAlign"><span wicket:id="repositoryLinks"></span></td>
+ </wicket:fragment>
</wicket:extend>
</body>
diff --git a/src/com/gitblit/wicket/pages/RepositoriesPage.java b/src/com/gitblit/wicket/pages/RepositoriesPage.java
index 53e3c2f8..14a54266 100644
--- a/src/com/gitblit/wicket/pages/RepositoriesPage.java
+++ b/src/com/gitblit/wicket/pages/RepositoriesPage.java
@@ -4,8 +4,11 @@ import java.io.File;
import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -20,6 +23,8 @@ import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.data.DataView;
+import org.apache.wicket.markup.repeater.data.IDataProvider;
+import org.apache.wicket.markup.repeater.data.ListDataProvider;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.resource.ContextRelativeResource;
@@ -42,13 +47,22 @@ public class RepositoriesPage extends BasePage {
public RepositoriesPage() {
super();
setupPage("", "");
-
+
final boolean showAdmin;
if (GitBlit.self().settings().getBoolean(Keys.web.authenticateAdminPages, true)) {
boolean allowAdmin = GitBlit.self().settings().getBoolean(Keys.web.allowAdministration, false);
showAdmin = allowAdmin && GitBlitWebSession.get().canAdmin();
+ // authentication requires state and session
+ setStatelessHint(false);
} else {
showAdmin = GitBlit.self().settings().getBoolean(Keys.web.allowAdministration, false);
+ if (GitBlit.self().settings().getBoolean(Keys.web.authenticateViewPages, false)) {
+ // authentication requires state and session
+ setStatelessHint(false);
+ } else {
+ // no authentication required, no state and no session required
+ setStatelessHint(true);
+ }
}
Fragment adminLinks = new Fragment("adminPanel", "adminLinks", this);
@@ -66,7 +80,7 @@ public class RepositoriesPage extends BasePage {
// Load the markdown welcome message
String messageSource = GitBlit.self().settings().getString(Keys.web.repositoriesMessage, "gitblit");
- String message = "";
+ String message = "<br/>";
if (messageSource.equalsIgnoreCase("gitblit")) {
// Read default welcome message
try {
@@ -99,70 +113,114 @@ public class RepositoriesPage extends BasePage {
add(repositoriesMessage);
final Map<AccessRestrictionType, String> accessRestrictionTranslations = getAccessRestrictions();
- UserModel user = GitBlitWebSession.get().getUser();
- List<RepositoryModel> rows = GitBlit.self().getRepositoryModels(user);
- DataProvider dp = new DataProvider(rows);
- DataView<RepositoryModel> dataView = new DataView<RepositoryModel>("repository", dp) {
+ final UserModel user = GitBlitWebSession.get().getUser();
+ List<RepositoryModel> models = GitBlit.self().getRepositoryModels(user);
+ IDataProvider<RepositoryModel> dp;
+
+ if (GitBlit.self().settings().getString(Keys.web.repositoryListType, "flat").equalsIgnoreCase("grouped")) {
+ Map<String, List<RepositoryModel>> groups = new HashMap<String, List<RepositoryModel>>();
+ for (RepositoryModel model : models) {
+ String rootPath = StringUtils.getRootPath(model.name);
+ if (StringUtils.isEmpty(rootPath)) {
+ rootPath = GitBlit.self().settings().getString(Keys.web.repositoryRootGroupName, " ");
+ }
+ if (!groups.containsKey(rootPath)) {
+ groups.put(rootPath, new ArrayList<RepositoryModel>());
+ }
+ groups.get(rootPath).add(model);
+ }
+ List<String> roots = new ArrayList<String>(groups.keySet());
+ Collections.sort(roots);
+ List<RepositoryModel> groupedModels = new ArrayList<RepositoryModel>();
+ for (String root : roots) {
+ groupedModels.add(new GroupRepositoryModel(root));
+ groupedModels.addAll(groups.get(root));
+ }
+ dp = new ListDataProvider<RepositoryModel>(groupedModels);
+ } else {
+ dp = new DataProvider(models);
+ }
+
+ DataView<RepositoryModel> dataView = new DataView<RepositoryModel>("row", dp) {
private static final long serialVersionUID = 1L;
int counter = 0;
public void populateItem(final Item<RepositoryModel> item) {
final RepositoryModel entry = item.getModelObject();
+ if (entry instanceof GroupRepositoryModel) {
+ Fragment row = new Fragment("rowContent", "groupRow", this);
+ item.add(row);
+ row.add(new Label("groupName", entry.name));
+ WicketUtils.setCssClass(item, "group");
+ return;
+ }
+ Fragment row = new Fragment("rowContent", "repositoryRow", this);
+ item.add(row);
if (entry.hasCommits) {
// Existing repository
PageParameters pp = WicketUtils.newRepositoryParameter(entry.name);
- item.add(new LinkPanel("repositoryName", "list", entry.name, SummaryPage.class, pp));
- item.add(new LinkPanel("repositoryDescription", "list", entry.description, SummaryPage.class, pp));
+ row.add(new LinkPanel("repositoryName", "list", entry.name, SummaryPage.class, pp));
+ row.add(new LinkPanel("repositoryDescription", "list", entry.description, SummaryPage.class, pp));
} else {
// New repository
- item.add(new Label("repositoryName", entry.name + "<span class='empty'>(empty)</span>").setEscapeModelStrings(false));
- item.add(new Label("repositoryDescription", entry.description));
+ row.add(new Label("repositoryName", entry.name + "<span class='empty'>(empty)</span>").setEscapeModelStrings(false));
+ row.add(new Label("repositoryDescription", entry.description));
}
if (entry.useTickets) {
- item.add(WicketUtils.newImage("ticketsIcon", "bug_16x16.png", getString("gb.tickets")));
+ row.add(WicketUtils.newImage("ticketsIcon", "bug_16x16.png", getString("gb.tickets")));
} else {
- item.add(WicketUtils.newBlankImage("ticketsIcon"));
+ row.add(WicketUtils.newBlankImage("ticketsIcon"));
}
if (entry.useDocs) {
- item.add(WicketUtils.newImage("docsIcon", "book_16x16.png", getString("gb.docs")));
+ row.add(WicketUtils.newImage("docsIcon", "book_16x16.png", getString("gb.docs")));
+ } else {
+ row.add(WicketUtils.newBlankImage("docsIcon"));
+ }
+
+ if (entry.isFrozen) {
+ row.add(WicketUtils.newImage("frozenIcon", "cold_16x16.png", getString("gb.isFrozen")));
} else {
- item.add(WicketUtils.newBlankImage("docsIcon"));
+ row.add(WicketUtils.newClearPixel("frozenIcon").setVisible(false));
}
-
switch (entry.accessRestriction) {
case NONE:
- item.add(WicketUtils.newBlankImage("accessRestrictionIcon"));
+ row.add(WicketUtils.newBlankImage("accessRestrictionIcon"));
break;
case PUSH:
- item.add(WicketUtils.newImage("accessRestrictionIcon", "lock_go_16x16.png", accessRestrictionTranslations.get(entry.accessRestriction)));
+ row.add(WicketUtils.newImage("accessRestrictionIcon", "lock_go_16x16.png", accessRestrictionTranslations.get(entry.accessRestriction)));
break;
case CLONE:
- item.add(WicketUtils.newImage("accessRestrictionIcon", "lock_pull_16x16.png", accessRestrictionTranslations.get(entry.accessRestriction)));
+ row.add(WicketUtils.newImage("accessRestrictionIcon", "lock_pull_16x16.png", accessRestrictionTranslations.get(entry.accessRestriction)));
break;
case VIEW:
- item.add(WicketUtils.newImage("accessRestrictionIcon", "shield_16x16.png", accessRestrictionTranslations.get(entry.accessRestriction)));
+ row.add(WicketUtils.newImage("accessRestrictionIcon", "shield_16x16.png", accessRestrictionTranslations.get(entry.accessRestriction)));
break;
default:
- item.add(WicketUtils.newBlankImage("accessRestrictionIcon"));
+ row.add(WicketUtils.newBlankImage("accessRestrictionIcon"));
}
- item.add(new Label("repositoryOwner", entry.owner));
+ row.add(new Label("repositoryOwner", entry.owner));
String lastChange = TimeUtils.timeAgo(entry.lastChange);
Label lastChangeLabel = new Label("repositoryLastChange", lastChange);
- item.add(lastChangeLabel);
+ row.add(lastChangeLabel);
WicketUtils.setCssClass(lastChangeLabel, TimeUtils.timeAgoCss(entry.lastChange));
+ boolean showOwner = user != null && user.getUsername().equalsIgnoreCase(entry.owner);
if (showAdmin) {
Fragment repositoryLinks = new Fragment("repositoryLinks", "repositoryAdminLinks", this);
repositoryLinks.add(new BookmarkablePageLink<Void>("editRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)));
repositoryLinks.add(new BookmarkablePageLink<Void>("renameRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setEnabled(false));
repositoryLinks.add(new BookmarkablePageLink<Void>("deleteRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)).setEnabled(false));
- item.add(repositoryLinks);
+ row.add(repositoryLinks);
+ } else if (showOwner) {
+ Fragment repositoryLinks = new Fragment("repositoryLinks", "repositoryOwnerLinks", this);
+ repositoryLinks.add(new BookmarkablePageLink<Void>("editRepository", EditRepositoryPage.class, WicketUtils.newRepositoryParameter(entry.name)));
+ row.add(repositoryLinks);
} else {
- item.add(new Label("repositoryLinks"));
+ row.add(new Label("repositoryLinks"));
}
WicketUtils.setAlternatingBackground(item, counter);
counter++;
@@ -170,10 +228,20 @@ public class RepositoriesPage extends BasePage {
};
add(dataView);
- add(newSort("orderByRepository", SortBy.repository, dp, dataView));
- add(newSort("orderByDescription", SortBy.description, dp, dataView));
- add(newSort("orderByOwner", SortBy.owner, dp, dataView));
- add(newSort("orderByDate", SortBy.date, dp, dataView));
+ if (dp instanceof SortableDataProvider<?>) {
+ // add sortable header
+ SortableDataProvider<?> sdp = (SortableDataProvider<?>) dp;
+ Fragment fragment = new Fragment("headerContent", "flatHeader", this);
+ fragment.add(newSort("orderByRepository", SortBy.repository, sdp, dataView));
+ fragment.add(newSort("orderByDescription", SortBy.description, sdp, dataView));
+ fragment.add(newSort("orderByOwner", SortBy.owner, sdp, dataView));
+ fragment.add(newSort("orderByDate", SortBy.date, sdp, dataView));
+ add(fragment);
+ } else {
+ // not sortable
+ Fragment fragment = new Fragment("headerContent", "groupHeader", this);
+ add(fragment);
+ }
}
protected enum SortBy {
@@ -258,4 +326,13 @@ public class RepositoriesPage extends BasePage {
return list.subList(first, first + count).iterator();
}
}
+
+ private class GroupRepositoryModel extends RepositoryModel {
+
+ private static final long serialVersionUID = 1L;
+
+ GroupRepositoryModel(String name) {
+ super(name, "", "", new Date(0));
+ }
+ }
}