summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-03-21 11:29:11 -0400
committerJames Moger <james.moger@gitblit.com>2014-04-10 18:58:09 -0400
commit7569e8f542ffcc049797f0cf5b79562d5852fb30 (patch)
treede2c79ee2abf091af5f4b9d597f6de1bb6a376d7 /src/main/java/com/gitblit/wicket
parentc910bee1c4a6c7b4f0a0595ce59759fc0c67c32b (diff)
downloadgitblit-7569e8f542ffcc049797f0cf5b79562d5852fb30.tar.gz
gitblit-7569e8f542ffcc049797f0cf5b79562d5852fb30.zip
Improve Sparkleshare integration, but leave disabled for now
Diffstat (limited to 'src/main/java/com/gitblit/wicket')
-rw-r--r--src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java b/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java
index 0f31b31e..938226a6 100644
--- a/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java
@@ -210,7 +210,7 @@ public class RepositoryUrlPanel extends BasePanel {
return urlPanel;
}
- protected Fragment createApplicationMenus(String wicketId, UserModel user, final RepositoryModel repository, final List<RepositoryUrl> repositoryUrls) {
+ protected Fragment createApplicationMenus(String wicketId, final UserModel user, final RepositoryModel repository, final List<RepositoryUrl> repositoryUrls) {
final List<GitClientApplication> displayedApps = new ArrayList<GitClientApplication>();
final String userAgent = ((WebClientInfo) GitBlitWebSession.get().getClientInfo()).getUserAgent();
@@ -309,13 +309,13 @@ public class RepositoryUrlPanel extends BasePanel {
if (!StringUtils.isEmpty(clientApp.cloneUrl)) {
// custom registered url
- String url = substitute(clientApp.cloneUrl, repoUrl.url, baseURL);
+ String url = substitute(clientApp.cloneUrl, repoUrl.url, baseURL, user.username, repository.name);
fragment.add(new LinkPanel("content", "applicationMenuItem", getString("gb.clone") + " " + repoUrl.url, url));
repoLinkItem.add(fragment);
fragment.add(new Label("copyFunction").setVisible(false));
} else if (!StringUtils.isEmpty(clientApp.command)) {
// command-line
- String command = substitute(clientApp.command, repoUrl.url, baseURL);
+ String command = substitute(clientApp.command, repoUrl.url, baseURL, user.username, repository.name);
Label content = new Label("content", command);
WicketUtils.setCssClass(content, "commandMenuItem");
fragment.add(content);
@@ -334,8 +334,8 @@ public class RepositoryUrlPanel extends BasePanel {
return applicationMenus;
}
- protected String substitute(String pattern, String repoUrl, String baseUrl) {
- return pattern.replace("${repoUrl}", repoUrl).replace("${baseUrl}", baseUrl);
+ protected String substitute(String pattern, String repoUrl, String baseUrl, String username, String repository) {
+ return pattern.replace("${repoUrl}", repoUrl).replace("${baseUrl}", baseUrl).replace("${username}", username).replace("${repository}", repository);
}
protected Label createPermissionBadge(String wicketId, RepositoryUrl repoUrl) {