James Moger
2013-11-26 4fcac9d2cbdafb51e3ee9ca3b3da64fd86103174
src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.java
@@ -50,6 +50,7 @@
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
import com.gitblit.utils.ArrayUtils;
import com.gitblit.utils.ModelUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.GitBlitWebSession;
import com.gitblit.wicket.WicketUtils;
@@ -127,7 +128,7 @@
            roots.add(0, "");
            groups.put("", rootRepositories);
         }
         List<RepositoryModel> groupedModels = new ArrayList<RepositoryModel>();
         for (String root : roots) {
            List<RepositoryModel> subModels = groups.get(root);
@@ -148,7 +149,7 @@
      final String baseUrl = WicketUtils.getGitblitURL(getRequest());
      final boolean showSwatch = GitBlit.getBoolean(Keys.web.repositoryListSwatches, true);
      DataView<RepositoryModel> dataView = new DataView<RepositoryModel>("row", dp) {
         private static final long serialVersionUID = 1L;
         int counter;
@@ -160,6 +161,7 @@
            counter = 0;
         }
         @Override
         public void populateItem(final Item<RepositoryModel> item) {
            final RepositoryModel entry = item.getModelObject();
            if (entry instanceof GroupRepositoryModel) {
@@ -167,11 +169,11 @@
               currGroupName = entry.name;
               Fragment row = new Fragment("rowContent", "groupRepositoryRow", this);
               item.add(row);
               String name = groupRow.name;
               if (name.charAt(0) == '~') {
               if (name.startsWith(ModelUtils.getUserRepoPrefix())) {
                  // user page
                  String username = name.substring(1);
                  String username = ModelUtils.getUserNameFromRepoPath(name);
                  UserModel user = GitBlit.self().getUserModel(username);
                  row.add(new LinkPanel("groupName", null, (user == null ? username : user.getDisplayName()) + " (" + groupRow.count + ")", UserPage.class, WicketUtils.newUsernameParameter(username)));
                  row.add(new Label("groupDescription", getString("gb.personalRepositories")));
@@ -193,7 +195,7 @@
            if (!StringUtils.isEmpty(currGroupName) && (repoName.indexOf('/') > -1)) {
               repoName = repoName.substring(currGroupName.length() + 1);
            }
            // repository swatch
            Component swatch;
            if (entry.isBare){
@@ -240,26 +242,19 @@
            } else {
               row.add(WicketUtils.newClearPixel("sparkleshareIcon").setVisible(false));
            }
            if (entry.isMirror) {
               row.add(WicketUtils.newImage("mirrorIcon", "mirror_16x16.png",
                     getString("gb.isMirror")));
            } else {
               row.add(WicketUtils.newClearPixel("mirrorIcon").setVisible(false));
            }
            if (entry.isFork()) {
               row.add(WicketUtils.newImage("forkIcon", "commit_divide_16x16.png",
                     getString("gb.isFork")));
            } else {
               row.add(WicketUtils.newClearPixel("forkIcon").setVisible(false));
            }
            if (entry.useTickets) {
               row.add(WicketUtils.newImage("ticketsIcon", "bug_16x16.png",
                     getString("gb.tickets")));
            } else {
               row.add(WicketUtils.newBlankImage("ticketsIcon"));
            }
            if (entry.useDocs) {
               row.add(WicketUtils
                     .newImage("docsIcon", "book_16x16.png", getString("gb.docs")));
            } else {
               row.add(WicketUtils.newBlankImage("docsIcon"));
            }
            if (entry.isFrozen) {
@@ -322,6 +317,9 @@
            Label lastChangeLabel = new Label("repositoryLastChange", lastChange);
            row.add(lastChangeLabel);
            WicketUtils.setCssClass(lastChangeLabel, getTimeUtils().timeAgoCss(entry.lastChange));
            if (!StringUtils.isEmpty(entry.lastChangeAuthor)) {
               WicketUtils.setHtmlTooltip(lastChangeLabel, getString("gb.author") + ": " + entry.lastChangeAuthor);
            }
            boolean showOwner = user != null && entry.isOwner(user.username);
            boolean myPersonalRepository = showOwner && entry.isUsersPersonalRepository(user.username);