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