summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket/pages
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-09-26 17:48:53 -0400
committerJames Moger <james.moger@gitblit.com>2011-09-26 17:48:53 -0400
commit2179fb76bbbd2021c350a7c28d6901389ed50b2b (patch)
tree0dbe1d29e0620a78162be8c7fc3ba3491f7d7dd8 /src/com/gitblit/wicket/pages
parent7e099b44ccd6fca3f195b5867f86cce31e558fee (diff)
downloadgitblit-2179fb76bbbd2021c350a7c28d6901389ed50b2b.tar.gz
gitblit-2179fb76bbbd2021c350a7c28d6901389ed50b2b.zip
Fixed broken urls for WAR builds.
Diffstat (limited to 'src/com/gitblit/wicket/pages')
-rw-r--r--src/com/gitblit/wicket/pages/CommitPage.java6
-rw-r--r--src/com/gitblit/wicket/pages/SendProposalPage.java2
-rw-r--r--src/com/gitblit/wicket/pages/SummaryPage.java2
-rw-r--r--src/com/gitblit/wicket/pages/TreePage.java9
4 files changed, 10 insertions, 9 deletions
diff --git a/src/com/gitblit/wicket/pages/CommitPage.java b/src/com/gitblit/wicket/pages/CommitPage.java
index b49b1d63..7bf78077 100644
--- a/src/com/gitblit/wicket/pages/CommitPage.java
+++ b/src/com/gitblit/wicket/pages/CommitPage.java
@@ -92,9 +92,9 @@ public class CommitPage extends RepositoryPage {
add(new LinkPanel("commitTree", "list", c.getTree().getName(), TreePage.class,
newCommitParameter()));
add(new BookmarkablePageLink<Void>("treeLink", TreePage.class, newCommitParameter()));
- add(new ExternalLink("zipLink", DownloadZipServlet.asLink(getRequest()
- .getRelativePathPrefixToContextRoot(), repositoryName, objectId, null))
- .setVisible(GitBlit.getBoolean(Keys.web.allowZipDownloads, true)));
+ final String baseUrl = WicketUtils.getGitblitURL(getRequest());
+ add(new ExternalLink("zipLink", DownloadZipServlet.asLink(baseUrl, repositoryName,
+ objectId, null)).setVisible(GitBlit.getBoolean(Keys.web.allowZipDownloads, true)));
// Parent Commits
ListDataProvider<String> parentsDp = new ListDataProvider<String>(parents);
diff --git a/src/com/gitblit/wicket/pages/SendProposalPage.java b/src/com/gitblit/wicket/pages/SendProposalPage.java
index adef0c54..ea91f1b2 100644
--- a/src/com/gitblit/wicket/pages/SendProposalPage.java
+++ b/src/com/gitblit/wicket/pages/SendProposalPage.java
@@ -52,7 +52,7 @@ public class SendProposalPage extends BasePage {
final String token = WicketUtils.getToken(params);
- myUrl = WicketUtils.getHostURL(getRequest());
+ myUrl = WicketUtils.getGitblitURL(getRequest());
destinationUrl = "https://";
// temporary proposal
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java
index 07d57144..9fd90c5f 100644
--- a/src/com/gitblit/wicket/pages/SummaryPage.java
+++ b/src/com/gitblit/wicket/pages/SummaryPage.java
@@ -114,7 +114,7 @@ public class SummaryPage extends RepositoryPage {
add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
}
StringBuilder sb = new StringBuilder();
- sb.append(WicketUtils.getHostURL(getRequestCycle().getRequest()));
+ sb.append(WicketUtils.getGitblitURL(getRequestCycle().getRequest()));
sb.append(Constants.GIT_PATH);
sb.append(repositoryName);
repositoryUrls.add(sb.toString());
diff --git a/src/com/gitblit/wicket/pages/TreePage.java b/src/com/gitblit/wicket/pages/TreePage.java
index 8695621e..7fc91eee 100644
--- a/src/com/gitblit/wicket/pages/TreePage.java
+++ b/src/com/gitblit/wicket/pages/TreePage.java
@@ -78,6 +78,8 @@ public class TreePage extends RepositoryPage {
final ByteFormat byteFormat = new ByteFormat();
+ final String baseUrl = WicketUtils.getGitblitURL(getRequest());
+
// changed paths list
ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);
DataView<PathModel> pathsView = new DataView<PathModel>("changedPath", pathsDp) {
@@ -112,10 +114,9 @@ public class TreePage extends RepositoryPage {
links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
WicketUtils.newPathParameter(repositoryName, entry.commitId,
entry.path)));
- links.add(new ExternalLink("zip", DownloadZipServlet.asLink(getRequest()
- .getRelativePathPrefixToContextRoot(), repositoryName, objectId,
- entry.path)).setVisible(GitBlit.getBoolean(
- Keys.web.allowZipDownloads, true)));
+ links.add(new ExternalLink("zip", DownloadZipServlet.asLink(baseUrl,
+ repositoryName, objectId, entry.path)).setVisible(GitBlit
+ .getBoolean(Keys.web.allowZipDownloads, true)));
item.add(links);
} else {
// blob link