gb.ticgit = ticgit\r
gb.pageFirst = first\r
gb.pagePrevious prev\r
-gb.pageNext = next
\ No newline at end of file
+gb.pageNext = next\r
+gb.parent = parent
\ No newline at end of file
\r
<!-- commit nav links --> \r
<div class="page_nav2">\r
- parent: <span wicket:id="parentLink">[parent link]</span> | <span wicket:id="patchLink">[patch link]</span>\r
+ <wicket:message key="gb.parent"></wicket:message>: <span wicket:id="parentLink">[parent link]</span> | <span wicket:id="patchLink">[patch link]</span> | <span wicket:id="commitdiffLink">[commitdiff link]</span>\r
</div> \r
\r
<!-- shortlog header -->\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
+import org.apache.wicket.model.StringResourceModel;\r
import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.revwalk.RevCommit;\r
\r
public CommitPage(PageParameters params) {\r
super(params);\r
\r
- final String commitId = params.getString("h", "");\r
-\r
Repository r = getRepository();\r
- RevCommit c = JGitUtils.getCommit(r, commitId);\r
+ RevCommit c = JGitUtils.getCommit(r, objectId);\r
\r
List<String> parents = new ArrayList<String>();\r
if (c.getParentCount() > 0) {\r
// commit page links\r
if (parents.size() == 0) {\r
add(new Label("parentLink", "none"));\r
+ add(new Label("commitdiffLink", getString("gb.commitdiff")));\r
} else {\r
add(new LinkPanel("parentLink", null, parents.get(0).substring(0, 8), CommitPage.class, newCommitParameter(parents.get(0))));\r
+ add(new LinkPanel("commitdiffLink", null, new StringResourceModel("gb.commitdiff", this, null), DiffPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
}\r
add(new Label("patchLink", getString("gb.patch")));\r
\r
</tr>\r
</tbody>\r
</table>\r
+ \r
+ <wicket:fragment wicket:id="adminLinks">\r
+ <!-- page nav links --> \r
+ <div class="page_nav">\r
+ <a wicket:id="newRepository"><wicket:message key="gb.newRepository"></wicket:message></a> | <a wicket:id="newUser"><wicket:message key="gb.newUser"></wicket:message></a>\r
+ </div> \r
+ </wicket:fragment>\r
</wicket:extend>\r
</body>\r
</html>
\ No newline at end of file
import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;\r
import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;\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.panel.Fragment;\r
import org.apache.wicket.markup.repeater.Item;\r
import org.apache.wicket.markup.repeater.data.DataView;\r
import org.apache.wicket.model.IModel;\r
import com.gitblit.wicket.LinkPanel;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.models.RepositoryModel;\r
-import com.gitblit.wicket.panels.AdminLinksPanel;\r
\r
\r
public class RepositoriesPage extends BasePage {\r
super();\r
setupPage("", "");\r
\r
- add(new AdminLinksPanel("adminPanel").setVisible(StoredSettings.getBoolean("allowAdministration", false)));\r
+ Fragment adminLinks = new Fragment("adminPanel", "adminLinks", this);\r
+ adminLinks.add(new BookmarkablePageLink<Void>("newRepository", RepositoriesPage.class));\r
+ adminLinks.add(new BookmarkablePageLink<Void>("newUser", RepositoriesPage.class));\r
+ add(adminLinks.setVisible(StoredSettings.getBoolean("allowAdministration", false)));\r
\r
add(new Label("repositoriesMessage", StoredSettings.getString("repositoriesMessage", "")).setEscapeModelStrings(false));\r
\r
<td><span wicket:id="pathName"></span></td> \r
<td class="size"><span wicket:id="pathSize">[path size]</span></td>\r
<td class="mode"><span wicket:id="pathPermissions">[path permissions]</span></td>\r
- <td class="rightAlign"><span wicket:id="treeLinks">[path links]</span></td>\r
+ <td class="rightAlign"><span wicket:id="pathLinks">[path links]</span></td>\r
</tr>\r
</table>\r
\r
+ <!-- tree links -->\r
+ <wicket:fragment wicket:id="treeLinks">\r
+ <div class="link">\r
+ <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> | <a wicket:id="history"><wicket:message key="gb.history"></wicket:message></a>\r
+ </div>\r
+ </wicket:fragment>\r
+ \r
+ <!-- blob links -->\r
+ <wicket:fragment wicket:id="blobLinks">\r
+ <div class="link">\r
+ <a wicket:id="view"><wicket:message key="gb.view"></wicket:message></a> | <a wicket:id="raw"><wicket:message key="gb.raw"></wicket:message></a> | <a wicket:id="history"><wicket:message key="gb.history"></wicket:message></a>\r
+ </div> \r
+ </wicket:fragment>\r
+ \r
</wicket:extend> \r
</body>\r
</html>
\ No newline at end of file
\r
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.panel.Fragment;\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
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.models.PathModel;\r
import com.gitblit.wicket.panels.PathBreadcrumbsPanel;\r
-import com.gitblit.wicket.panels.TreeBlobLinksPanel;\r
-import com.gitblit.wicket.panels.TreeLinksPanel;\r
\r
\r
public class TreePage extends RepositoryPage {\r
// parent .. path\r
item.add(new Label("pathSize", ""));\r
item.add(new LinkPanel("pathName", null, entry.name, TreePage.class, newPathParameter(entry.path)));\r
- item.add(new Label("treeLinks", ""));\r
+ item.add(new Label("pathLinks", ""));\r
} else {\r
if (entry.isTree()) {\r
// folder/tree link\r
item.add(new Label("pathSize", ""));\r
item.add(new LinkPanel("pathName", null, entry.name, TreePage.class, newPathParameter(entry.path)));\r
- item.add(new TreeLinksPanel("treeLinks", repositoryName, entry));\r
+ \r
+ // links\r
+ Fragment links = new Fragment("pathLinks", "treeLinks", this);\r
+ links.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path)));\r
+ links.add(new BookmarkablePageLink<Void>("history", TreePage.class).setEnabled(false));\r
+ item.add(links);\r
} else {\r
// blob link\r
item.add(new Label("pathSize", byteFormat.format(entry.size)));\r
item.add(new LinkPanel("pathName", "list", entry.name, BlobPage.class, newPathParameter(entry.path)));\r
- item.add(new TreeBlobLinksPanel("treeLinks", repositoryName, entry));\r
+ \r
+ // links\r
+ Fragment links = new Fragment("pathLinks", "blobLinks", this);\r
+ links.add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path)));\r
+ links.add(new BookmarkablePageLink<Void>("raw", BlobPage.class).setEnabled(false));\r
+ links.add(new BookmarkablePageLink<Void>("history", BlobPage.class).setEnabled(false));\r
+ item.add(links);\r
}\r
}\r
- String clazz = counter % 2 == 0 ? "dark" : "light";\r
- WicketUtils.setCssClass(item, clazz);\r
+ WicketUtils.setAlternatingBackground(item, counter);\r
counter++;\r
}\r
};\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" \r
- xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" \r
- xml:lang="en" \r
- lang="en"> \r
-\r
-<wicket:panel>\r
- <!-- page nav links --> \r
- <div class="page_nav">\r
- <a wicket:id="newRepository"><wicket:message key="gb.newRepository"></wicket:message></a> | <a wicket:id="newUser"><wicket:message key="gb.newUser"></wicket:message></a>\r
- </div> \r
-</wicket:panel>\r
-</html>
\ No newline at end of file
+++ /dev/null
-package com.gitblit.wicket.panels;\r
-\r
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-import org.apache.wicket.markup.html.panel.Panel;\r
-\r
-import com.gitblit.wicket.pages.RepositoriesPage;\r
-\r
-public class AdminLinksPanel extends Panel {\r
-\r
- private static final long serialVersionUID = 1L;\r
-\r
- public AdminLinksPanel(String id) {\r
- super(id);\r
-\r
- add(new BookmarkablePageLink<Void>("newRepository", RepositoriesPage.class));\r
- add(new BookmarkablePageLink<Void>("newUser", RepositoriesPage.class));\r
- }\r
-}
\ No newline at end of file
\r
private final String ROOT = "--ROOT--";\r
\r
- public PathBreadcrumbsPanel(String id, final String repositoryName, String pathName, final String commitId) {\r
+ public PathBreadcrumbsPanel(String id, final String repositoryName, String pathName, final String objectId) {\r
super(id);\r
List<BreadCrumb> crumbs = new ArrayList<BreadCrumb>();\r
crumbs.add(new BreadCrumb("[" + repositoryName + "]", ROOT, false));\r
public void populateItem(final Item<BreadCrumb> item) {\r
final BreadCrumb entry = item.getModelObject();\r
String path = entry.getPath();\r
- String parameters = "p=" + repositoryName + ",h=" + commitId;\r
- if (path != null) {\r
- parameters += ",f=" + path;\r
+ if (entry.isLeaf) {\r
+ item.add(new Label("pathLink", entry.name));\r
+ item.add(new Label("pathSeparator", "").setVisible(false));\r
+ } else {\r
+ item.add(new LinkPanel("pathLink", null, entry.name, TreePage.class, WicketUtils.newPathParameter(repositoryName, objectId, path)));\r
+ item.add(new Label("pathSeparator", "/"));\r
}\r
-\r
- item.add(new LinkPanel("pathLink", null, entry.name, TreePage.class, WicketUtils.newPathParameter(repositoryName, commitId, path)));\r
- item.add(new Label("pathSeparator", entry.isLeaf ? "" : "/"));\r
}\r
};\r
add(pathsView);\r
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" \r
- xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" \r
- xml:lang="en" \r
- lang="en"> \r
-\r
-<wicket:panel>\r
- <div class="link">\r
- <a wicket:id="view"><wicket:message key="gb.view"></wicket:message></a> | <a wicket:id="raw"><wicket:message key="gb.raw"></wicket:message></a> | <a wicket:id="history"><wicket:message key="gb.history"></wicket:message></a>\r
- </div> \r
-</wicket:panel>\r
-</html>
\ No newline at end of file
+++ /dev/null
-package com.gitblit.wicket.panels;\r
-\r
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-import org.apache.wicket.markup.html.panel.Panel;\r
-\r
-import com.gitblit.wicket.WicketUtils;\r
-import com.gitblit.wicket.models.PathModel;\r
-import com.gitblit.wicket.pages.BlobPage;\r
-\r
-\r
-public class TreeBlobLinksPanel extends Panel {\r
-\r
- private static final long serialVersionUID = 1L;\r
-\r
- public TreeBlobLinksPanel(String id, String repositoryName, PathModel path) {\r
- super(id);\r
- add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils.newPathParameter(repositoryName, path.commitId, path.path)));\r
- add(new BookmarkablePageLink<Void>("raw", BlobPage.class).setEnabled(false));\r
- add(new BookmarkablePageLink<Void>("history", BlobPage.class).setEnabled(false));\r
- }\r
-}
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" \r
- xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" \r
- xml:lang="en" \r
- lang="en"> \r
-\r
-<wicket:panel>\r
- <div class="link">\r
- <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> | <a wicket:id="history"><wicket:message key="gb.history"></wicket:message></a>\r
- </div> \r
-</wicket:panel>\r
-</html>
\ No newline at end of file
+++ /dev/null
-package com.gitblit.wicket.panels;\r
-\r
-import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
-import org.apache.wicket.markup.html.panel.Panel;\r
-\r
-import com.gitblit.wicket.WicketUtils;\r
-import com.gitblit.wicket.models.PathModel;\r
-import com.gitblit.wicket.pages.TreePage;\r
-\r
-\r
-public class TreeLinksPanel extends Panel {\r
-\r
- private static final long serialVersionUID = 1L;\r
-\r
- public TreeLinksPanel(String id, String repositoryName, PathModel path) {\r
- super(id);\r
- add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newPathParameter(repositoryName, path.commitId, path.path)));\r
- add(new BookmarkablePageLink<Void>("history", TreePage.class).setEnabled(false));\r
- }\r
-}
\ No newline at end of file