| | |
| | | Map<String, List<RepositoryModel>> groups = new HashMap<String, List<RepositoryModel>>();
|
| | | for (RepositoryModel model : models) {
|
| | | String rootPath = StringUtils.getRootPath(model.name);
|
| | | if (StringUtils.isEmpty(rootPath)) { |
| | | if (StringUtils.isEmpty(rootPath)) {
|
| | | // root repository
|
| | | rootRepositories.add(model); |
| | | rootRepositories.add(model);
|
| | | } else {
|
| | | // non-root, grouped repository
|
| | | if (!groups.containsKey(rootPath)) {
|
| | |
| | | }
|
| | | List<String> roots = new ArrayList<String>(groups.keySet());
|
| | | Collections.sort(roots);
|
| | | |
| | |
|
| | | if (rootRepositories.size() > 0) {
|
| | | // inject the root repositories at the top of the page
|
| | | String rootPath = GitBlit.getString(Keys.web.repositoryRootGroupName, " ");
|
| | |
| | | row.add(new LinkPanel("repositoryDescription", "list", entry.description,
|
| | | SummaryPage.class, pp));
|
| | | if (showSize) {
|
| | | row.add(new Label("repositorySize", byteFormat.format(GitBlit.self().calculateSize(entry))));
|
| | | row.add(new Label("repositorySize", byteFormat.format(GitBlit.self()
|
| | | .calculateSize(entry))));
|
| | | } else {
|
| | | row.add(new Label("repositorySize").setVisible(false));
|
| | | }
|
| | |
| | | // New repository
|
| | | row.add(new Label("repositoryName", entry.name));
|
| | | row.add(new Label("repositoryDescription", entry.description));
|
| | | row.add(new Label("repositorySize", "<span class='empty'>(empty)</span>").setEscapeModelStrings(false));
|
| | | row.add(new Label("repositorySize", "<span class='empty'>(empty)</span>")
|
| | | .setEscapeModelStrings(false));
|
| | | }
|
| | |
|
| | | if (entry.useTickets) {
|
| | |
| | |
|
| | | row.add(new Label("repositoryOwner", entry.owner));
|
| | |
|
| | | String lastChange = TimeUtils.timeAgo(entry.lastChange);
|
| | | String lastChange;
|
| | | if (entry.lastChange.getTime() == 0) {
|
| | | lastChange = "--";
|
| | | } else {
|
| | | lastChange = TimeUtils.timeAgo(entry.lastChange);
|
| | | }
|
| | | Label lastChangeLabel = new Label("repositoryLastChange", lastChange);
|
| | | row.add(lastChangeLabel);
|
| | | WicketUtils.setCssClass(lastChangeLabel, TimeUtils.timeAgoCss(entry.lastChange));
|