From 058ed1b58e54bf813754e72ca8c37296cf5f704d Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Tue, 04 Mar 2014 09:56:23 -0500 Subject: [PATCH] Update contributors list --- src/main/java/com/gitblit/wicket/panels/BranchesPanel.java | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java index dba4089..28751fa 100644 --- a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java @@ -37,11 +37,10 @@ import org.eclipse.jgit.lib.Repository; import com.gitblit.Constants; -import com.gitblit.GitBlit; -import com.gitblit.SyndicationServlet; import com.gitblit.models.RefModel; import com.gitblit.models.RepositoryModel; import com.gitblit.models.UserModel; +import com.gitblit.servlet.SyndicationServlet; import com.gitblit.utils.CommitCache; import com.gitblit.utils.JGitUtils; import com.gitblit.utils.RefLogUtils; @@ -101,15 +100,16 @@ // branches page add(new Label("branches", new StringResourceModel("gb.branches", this, null))); } - + // only allow delete if we have multiple branches final boolean showDelete = showAdmin && branches.size() > 1; - + ListDataProvider<RefModel> branchesDp = new ListDataProvider<RefModel>(branches); DataView<RefModel> branchesView = new DataView<RefModel>("branch", branchesDp) { private static final long serialVersionUID = 1L; int counter; + @Override public void populateItem(final Item<RefModel> item) { final RefModel entry = item.getModelObject(); @@ -136,7 +136,7 @@ WicketUtils.setHtmlTooltip(shortlog, shortMessage); } item.add(shortlog); - + if (maxCount <= 0) { Fragment fragment = new Fragment("branchLinks", showDelete? "branchPageAdminLinks" : "branchPageLinks", this); fragment.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils @@ -189,9 +189,9 @@ @Override public void onClick() { - Repository r = GitBlit.self().getRepository(repositoryModel.name); + Repository r = app().repositories().getRepository(repositoryModel.name); if (r == null) { - if (GitBlit.self().isCollectingGarbage(repositoryModel.name)) { + if (app().repositories().isCollectingGarbage(repositoryModel.name)) { error(MessageFormat.format(getString("gb.busyCollectingGarbage"), repositoryModel.name)); } else { error(MessageFormat.format("Failed to find repository {0}", repositoryModel.name)); @@ -219,15 +219,15 @@ RefLogUtils.deleteRef(user, r, ref); } } - + if (success) { - info(MessageFormat.format("Branch \"{0}\" deleted", branch)); + info(MessageFormat.format("Branch \"{0}\" deleted", branch)); } else { error(MessageFormat.format("Failed to delete branch \"{0}\"", branch)); } } r.close(); - + // redirect to the owning page PageParameters params = WicketUtils.newRepositoryParameter(repositoryModel.name); String relativeUrl = urlFor(getPage().getClass(), params).toString(); @@ -235,7 +235,7 @@ getRequestCycle().setRequestTarget(new RedirectRequestTarget(absoluteUrl)); } }; - + deleteLink.add(new JavascriptEventConfirmation("onclick", MessageFormat.format( "Delete branch \"{0}\"?", entry.displayName ))); return deleteLink; -- Gitblit v1.9.1