*/
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;
// 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
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
+import org.apache.wicket.markup.html.link.ExternalLink;\r
import org.apache.wicket.markup.repeater.Item;\r
import org.apache.wicket.markup.repeater.data.DataView;\r
import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
if (entry.isSubmodule()) {\r
// submodule \r
item.add(new BookmarkablePageLink<Void>("diff", BlobDiffPage.class, WicketUtils\r
- .newPathParameter(submodulePath, entry.objectId, entry.path))\r
- .setEnabled(false));\r
+ .newPathParameter(repositoryName, entry.commitId, entry.path))\r
+ .setEnabled(!entry.changeType.equals(ChangeType.ADD)));\r
item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils\r
.newObjectParameter(submodulePath, entry.objectId)).setEnabled(hasSubmodule));\r
- item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class, WicketUtils\r
- .newPathParameter(submodulePath, entry.objectId, entry.path))\r
- .setEnabled(false));\r
+ item.add(new ExternalLink("blame", "").setEnabled(false));\r
item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils\r
- .newPathParameter(submodulePath, entry.objectId, entry.path))\r
- .setEnabled(hasSubmodule));\r
+ .newPathParameter(repositoryName, entry.commitId, entry.path))\r
+ .setEnabled(!entry.changeType.equals(ChangeType.ADD)));\r
} else {\r
// tree or blob\r
item.add(new BookmarkablePageLink<Void>("diff", BlobDiffPage.class, WicketUtils\r
WicketUtils.newPathParameter(submodulePath, submoduleId,\r
"")).setEnabled(hasSubmodule));\r
links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,\r
- WicketUtils.newPathParameter(submodulePath, submoduleId,\r
- "")).setEnabled(hasSubmodule));\r
+ WicketUtils.newPathParameter(repositoryName, entry.commitId,\r
+ entry.path)));\r
links.add(new CompressedDownloadsPanel("compressedLinks", baseUrl,\r
submodulePath, submoduleId, "").setEnabled(hasSubmodule));\r
item.add(links); \r