diff options
author | James Moger <james.moger@gitblit.com> | 2013-01-13 16:49:37 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-01-13 16:49:37 -0500 |
commit | 9cc56a1f60eff2ce1db40b7078eab92e78602e1c (patch) | |
tree | 2cbaa35f854ab1b447c2fe599383c353115ddb36 | |
parent | abd3cc2d610981493b5e9333108d271ae37f7726 (diff) | |
download | gitblit-9cc56a1f60eff2ce1db40b7078eab92e78602e1c.tar.gz gitblit-9cc56a1f60eff2ce1db40b7078eab92e78602e1c.zip |
Fix submodule links on commit, comitdiff, and tree page (issue-178)
-rw-r--r-- | src/com/gitblit/wicket/pages/CommitDiffPage.java | 13 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/CommitPage.java | 13 | ||||
-rw-r--r-- | src/com/gitblit/wicket/pages/TreePage.java | 4 |
3 files changed, 13 insertions, 17 deletions
diff --git a/src/com/gitblit/wicket/pages/CommitDiffPage.java b/src/com/gitblit/wicket/pages/CommitDiffPage.java index 585ce8e3..3ad70742 100644 --- a/src/com/gitblit/wicket/pages/CommitDiffPage.java +++ b/src/com/gitblit/wicket/pages/CommitDiffPage.java @@ -15,14 +15,14 @@ */ package com.gitblit.wicket.pages; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; -import java.text.MessageFormat; - import org.apache.wicket.PageParameters; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.link.BookmarkablePageLink; +import org.apache.wicket.markup.html.link.ExternalLink; import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.markup.repeater.data.DataView; import org.apache.wicket.markup.repeater.data.ListDataProvider; @@ -150,15 +150,12 @@ public class CommitDiffPage extends RepositoryPage { // quick links if (entry.isSubmodule()) { // submodule - item.add(new BookmarkablePageLink<Void>("patch", PatchPage.class, WicketUtils - .newPathParameter(submodulePath, entry.objectId, entry.path)).setEnabled(false)); + item.add(new ExternalLink("patch", "").setEnabled(false)); item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils .newObjectParameter(submodulePath, entry.objectId)).setEnabled(hasSubmodule)); - item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class, WicketUtils - .newPathParameter(submodulePath, entry.objectId, entry.path)).setEnabled(false)); + item.add(new ExternalLink("blame", "").setEnabled(false)); item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils - .newPathParameter(submodulePath, entry.objectId, entry.path)) - .setEnabled(hasSubmodule)); + .newPathParameter(repositoryName, entry.commitId, entry.path))); } else { // tree or blob item.add(new BookmarkablePageLink<Void>("patch", PatchPage.class, WicketUtils diff --git a/src/com/gitblit/wicket/pages/CommitPage.java b/src/com/gitblit/wicket/pages/CommitPage.java index 17621ad0..c5a24c8d 100644 --- a/src/com/gitblit/wicket/pages/CommitPage.java +++ b/src/com/gitblit/wicket/pages/CommitPage.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.link.ExternalLink;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.data.DataView;
import org.apache.wicket.markup.repeater.data.ListDataProvider;
@@ -184,16 +185,14 @@ public class CommitPage extends RepositoryPage { if (entry.isSubmodule()) {
// submodule
item.add(new BookmarkablePageLink<Void>("diff", BlobDiffPage.class, WicketUtils
- .newPathParameter(submodulePath, entry.objectId, entry.path))
- .setEnabled(false));
+ .newPathParameter(repositoryName, entry.commitId, entry.path))
+ .setEnabled(!entry.changeType.equals(ChangeType.ADD)));
item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils
.newObjectParameter(submodulePath, entry.objectId)).setEnabled(hasSubmodule));
- item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class, WicketUtils
- .newPathParameter(submodulePath, entry.objectId, entry.path))
- .setEnabled(false));
+ item.add(new ExternalLink("blame", "").setEnabled(false));
item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils
- .newPathParameter(submodulePath, entry.objectId, entry.path))
- .setEnabled(hasSubmodule));
+ .newPathParameter(repositoryName, entry.commitId, entry.path))
+ .setEnabled(!entry.changeType.equals(ChangeType.ADD)));
} else {
// tree or blob
item.add(new BookmarkablePageLink<Void>("diff", BlobDiffPage.class, WicketUtils
diff --git a/src/com/gitblit/wicket/pages/TreePage.java b/src/com/gitblit/wicket/pages/TreePage.java index b8ce7b48..bc27f0c2 100644 --- a/src/com/gitblit/wicket/pages/TreePage.java +++ b/src/com/gitblit/wicket/pages/TreePage.java @@ -137,8 +137,8 @@ public class TreePage extends RepositoryPage { WicketUtils.newPathParameter(submodulePath, submoduleId,
"")).setEnabled(hasSubmodule));
links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
- WicketUtils.newPathParameter(submodulePath, submoduleId,
- "")).setEnabled(hasSubmodule));
+ WicketUtils.newPathParameter(repositoryName, entry.commitId,
+ entry.path)));
links.add(new CompressedDownloadsPanel("compressedLinks", baseUrl,
submodulePath, submoduleId, "").setEnabled(hasSubmodule));
item.add(links);
|