import java.util.Map;\r
import java.util.Set;\r
\r
-import org.eclipse.jgit.api.Git;\r
import org.eclipse.jgit.diff.DiffEntry;\r
import org.eclipse.jgit.diff.DiffFormatter;\r
import org.eclipse.jgit.diff.RawTextComparator;\r
public static String getCommitDiff(Repository r, RevCommit commit, boolean outputHtml) {\r
return getCommitDiff(r, commit, null, outputHtml);\r
}\r
- \r
+\r
public static String getCommitDiff(Repository r, RevCommit commit, String path, boolean outputHtml) {\r
try {\r
final RevWalk rw = new RevWalk(r);\r
}\r
\r
public static List<RevCommit> getRevLog(Repository r, int maxCount) {\r
+ return getRevLog(r, Constants.HEAD, 0, maxCount);\r
+ }\r
+\r
+ public static List<RevCommit> getRevLog(Repository r, String objectId, int offset, int maxCount) {\r
List<RevCommit> list = new ArrayList<RevCommit>();\r
try {\r
- Git git = new Git(r);\r
- Iterable<RevCommit> revlog = git.log().call();\r
- for (RevCommit rev : revlog) {\r
- list.add(rev);\r
- if (maxCount > 0 && list.size() == maxCount) {\r
- break;\r
+ if (objectId == null || objectId.trim().length() == 0) {\r
+ objectId = Constants.HEAD;\r
+ }\r
+ RevWalk walk = new RevWalk(r);\r
+ ObjectId object = r.resolve(objectId);\r
+ walk.markStart(walk.parseCommit(object));\r
+ Iterable<RevCommit> revlog = walk;\r
+ if (offset > 0) {\r
+ int count = 0;\r
+ for (RevCommit rev : revlog) {\r
+ count++;\r
+ if (count > offset) {\r
+ list.add(rev);\r
+ if (maxCount > 0 && list.size() == maxCount) {\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ } else {\r
+ for (RevCommit rev : revlog) {\r
+ list.add(rev);\r
+ if (maxCount > 0 && list.size() == maxCount) {\r
+ break;\r
+ }\r
}\r
}\r
+ walk.dispose();\r
} catch (Throwable t) {\r
LOGGER.error("Failed to determine last change", t);\r
}\r
final Map<String, Metric> map = new HashMap<String, Metric>();\r
try {\r
DateFormat df = new SimpleDateFormat("yyyy-MM");\r
- Git git = new Git(r);\r
- Iterable<RevCommit> revlog = git.log().call();\r
+ RevWalk walk = new RevWalk(r);\r
+ ObjectId object = r.resolve(Constants.HEAD);\r
+ walk.markStart(walk.parseCommit(object));\r
+ Iterable<RevCommit> revlog = walk;\r
for (RevCommit rev : revlog) {\r
Date d = getCommitDate(rev);\r
String p = df.format(d);\r
getRequestCycleSettings().setGatherExtendedBrowserInfo(true);\r
\r
// setup the standard gitweb-ish urls\r
- mount(new MixedParamUrlCodingStrategy("/summary", SummaryPage.class, new String[] { "p" }));\r
- mount(new MixedParamUrlCodingStrategy("/shortlog", LogPage.class, new String[] { "p", "h" }));\r
- mount(new MixedParamUrlCodingStrategy("/tags", TagsPage.class, new String[] { "p" }));\r
- mount(new MixedParamUrlCodingStrategy("/branches", BranchesPage.class, new String[] { "p" }));\r
- mount(new MixedParamUrlCodingStrategy("/commit", CommitPage.class, new String[] { "p", "h" }));\r
- mount(new MixedParamUrlCodingStrategy("/tag", TagPage.class, new String[] { "p", "h" }));\r
- mount(new MixedParamUrlCodingStrategy("/tree", TreePage.class, new String[] { "p", "h", "f" }));\r
- mount(new MixedParamUrlCodingStrategy("/blob", BlobPage.class, new String[] { "p", "h", "f" }));\r
- mount(new MixedParamUrlCodingStrategy("/diff", DiffPage.class, new String[] { "p", "h", "f" }));\r
+ mount(new MixedParamUrlCodingStrategy("/summary", SummaryPage.class, new String[] { "r" }));\r
+ mount(new MixedParamUrlCodingStrategy("/log", LogPage.class, new String[] { "r", "h" }));\r
+ mount(new MixedParamUrlCodingStrategy("/tags", TagsPage.class, new String[] { "r" }));\r
+ mount(new MixedParamUrlCodingStrategy("/branches", BranchesPage.class, new String[] { "r" }));\r
+ mount(new MixedParamUrlCodingStrategy("/commit", CommitPage.class, new String[] { "r", "h" }));\r
+ mount(new MixedParamUrlCodingStrategy("/tag", TagPage.class, new String[] { "r", "h" }));\r
+ mount(new MixedParamUrlCodingStrategy("/tree", TreePage.class, new String[] { "r", "h", "f" }));\r
+ mount(new MixedParamUrlCodingStrategy("/blob", BlobPage.class, new String[] { "r", "h", "f" }));\r
+ mount(new MixedParamUrlCodingStrategy("/diff", DiffPage.class, new String[] { "r", "h", "f" }));\r
\r
// setup extended urls\r
mount(new MixedParamUrlCodingStrategy("/ticgit", TicGitPage.class, new String[] { "p" }));\r
gb.newRepository = new repository\r
gb.newUser = new user\r
gb.commitdiff = commitdiff\r
-gb.ticgit = ticgit
\ No newline at end of file
+gb.ticgit = ticgit\r
+gb.pageFirst = first\r
+gb.pagePrevious prev\r
+gb.pageNext = next
\ No newline at end of file
public abstract class RepositoryPage extends BasePage {\r
\r
protected final String repositoryName;\r
- protected final String commitId;\r
+ protected final String objectId;\r
protected String description;\r
\r
private transient Repository r = null;\r
\r
public RepositoryPage(PageParameters params) {\r
super(params);\r
- if (!params.containsKey("p")) {\r
+ if (!params.containsKey("r")) {\r
error("Repository not specified!");\r
redirectToInterceptPage(new RepositoriesPage());\r
}\r
- repositoryName = params.getString("p", "");\r
- commitId = params.getString("h", "HEAD");\r
+ repositoryName = params.getString("r", "");\r
+ objectId = params.getString("h", "HEAD");\r
\r
Repository r = getRepository();\r
\r
}\r
\r
protected PageParameters newCommitParameter() {\r
- return WicketUtils.newCommitParameter(repositoryName, commitId);\r
+ return WicketUtils.newObjectParameter(repositoryName, objectId);\r
}\r
\r
protected PageParameters newCommitParameter(String commitId) {\r
- return WicketUtils.newCommitParameter(repositoryName, commitId);\r
+ return WicketUtils.newObjectParameter(repositoryName, commitId);\r
}\r
\r
protected PageParameters newPathParameter(String path) {\r
- return WicketUtils.newPathParameter(repositoryName, commitId, path);\r
+ return WicketUtils.newPathParameter(repositoryName, objectId, path);\r
}\r
}\r
}\r
\r
public static PageParameters newRepositoryParameter(String repositoryName) {\r
- return new PageParameters("p=" + repositoryName);\r
+ return new PageParameters("r=" + repositoryName);\r
}\r
\r
- public static PageParameters newCommitParameter(String repositoryName, String commitId) {\r
- if (commitId == null || commitId.trim().length() == 0) {\r
+ public static PageParameters newObjectParameter(String repositoryName, String objectId) {\r
+ if (objectId == null || objectId.trim().length() == 0) {\r
return newRepositoryParameter(repositoryName);\r
}\r
- return new PageParameters("p=" + repositoryName + ",h=" + commitId);\r
+ return new PageParameters("r=" + repositoryName + ",h=" + objectId);\r
}\r
\r
- public static PageParameters newPathParameter(String repositoryName, String commitId, String path) {\r
+ public static PageParameters newPathParameter(String repositoryName, String objectId, String path) {\r
if (path == null || path.trim().length() == 0) {\r
- return newCommitParameter(repositoryName, commitId);\r
+ return newObjectParameter(repositoryName, objectId);\r
}\r
- return new PageParameters("p=" + repositoryName + ",h=" + commitId + ",f=" + path);\r
+ return new PageParameters("r=" + repositoryName + ",h=" + objectId + ",f=" + path);\r
+ }\r
+ \r
+ public static PageParameters newLogPageParameter(String repositoryName, String objectId, int pageNumber) {\r
+ if (pageNumber <= 1) {\r
+ return newObjectParameter(repositoryName, objectId);\r
+ }\r
+ return new PageParameters("r=" + repositoryName + ",h=" + objectId + ",page=" + pageNumber);\r
}\r
\r
public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone) {\r
final String blobPath = params.getString("f", null);\r
\r
Repository r = getRepository();\r
- RevCommit commit = JGitUtils.getCommit(r, commitId);\r
+ RevCommit commit = JGitUtils.getCommit(r, objectId);\r
\r
// blob page links\r
add(new Label("historyLink", getString("gb.history")));\r
\r
add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
\r
- add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, blobPath, commitId));\r
+ add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, blobPath, objectId));\r
String extension = null;\r
if (blobPath.lastIndexOf('.') > -1) {\r
extension = blobPath.substring(blobPath.lastIndexOf('.') + 1);\r
final String blobPath = params.getString("f", null);\r
\r
Repository r = getRepository();\r
- RevCommit commit = JGitUtils.getCommit(r, commitId);\r
+ RevCommit commit = JGitUtils.getCommit(r, objectId);\r
String diff;\r
if (blobPath != null && blobPath.length() > 0) {\r
// blob diff\r
\r
add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
\r
- add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, blobPath, commitId));\r
+ add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, blobPath, objectId));\r
\r
add(new Label("diffText", diff).setEscapeModelStrings(false));\r
}\r
<!-- page nav links --> \r
<div wicket:id="pageLinks">[page links]</div>\r
\r
+ <!-- pager links -->\r
+ <div style="padding-top:5px;padding-bottom:5px;">\r
+ <a wicket:id="firstPageTop"><wicket:message key="gb.pageFirst"></wicket:message></a> | <a wicket:id="prevPageTop"><wicket:message key="gb.pagePrevious"></wicket:message></a> | <a wicket:id="nextPageTop"><wicket:message key="gb.pageNext"></wicket:message></a> \r
+ </div>\r
+ \r
<!-- log -->\r
<div style="margin-top:5px;" wicket:id="logPanel">[log panel]</div>\r
+\r
+ <!-- pager links -->\r
+ <div style="padding-bottom:5px;">\r
+ <a wicket:id="firstPageBottom"><wicket:message key="gb.pageFirst"></wicket:message></a> | <a wicket:id="prevPageBottom"><wicket:message key="gb.pagePrevious"></wicket:message></a> | <a wicket:id="nextPageBottom"><wicket:message key="gb.pageNext"></wicket:message></a> \r
+ </div>\r
\r
</wicket:extend>\r
</body>\r
package com.gitblit.wicket.pages;\r
\r
import org.apache.wicket.PageParameters;\r
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
\r
import com.gitblit.wicket.RepositoryPage;\r
+import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.panels.LogPanel;\r
\r
-\r
public class LogPage extends RepositoryPage {\r
\r
public LogPage(PageParameters params) {\r
super(params);\r
\r
- add(new LogPanel("logPanel", repositoryName, getRepository(), 100, true));\r
+ int pageNumber = params.getInt("page", 1); // index from 1\r
+ int prevPage = Math.max(0, pageNumber - 1);\r
+ int nextPage = pageNumber + 1;\r
+\r
+ add(new BookmarkablePageLink<Void>("firstPageTop", LogPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
+ add(new BookmarkablePageLink<Void>("prevPageTop", LogPage.class, WicketUtils.newLogPageParameter(repositoryName, objectId, prevPage)).setEnabled(pageNumber > 1));\r
+ add(new BookmarkablePageLink<Void>("nextPageTop", LogPage.class, WicketUtils.newLogPageParameter(repositoryName, objectId, nextPage)));\r
+\r
+ add(new LogPanel("logPanel", repositoryName, objectId, getRepository(), -1, pageNumber - 1));\r
+\r
+ add(new BookmarkablePageLink<Void>("firstPageBottom", LogPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
+ add(new BookmarkablePageLink<Void>("prevPageBottom", LogPage.class, WicketUtils.newLogPageParameter(repositoryName, objectId, prevPage)).setEnabled(pageNumber > 1));\r
+ add(new BookmarkablePageLink<Void>("nextPageBottom", LogPage.class, WicketUtils.newLogPageParameter(repositoryName, objectId, nextPage)));\r
}\r
- \r
+\r
@Override\r
protected String getPageName() {\r
return getString("gb.log");\r
\r
public void populateItem(final Item<RepositoryModel> item) {\r
final RepositoryModel entry = item.getModelObject();\r
- PageParameters pp = new PageParameters("p=" + entry.name);\r
+ PageParameters pp = WicketUtils.newRepositoryParameter(entry.name);\r
item.add(new LinkPanel("repositoryName", "list", entry.name, SummaryPage.class, pp));\r
item.add(new LinkPanel("repositoryDescription", "list", entry.description, SummaryPage.class, pp));\r
item.add(new Label("repositoryOwner", entry.owner));\r
item.add(lastChangeLabel);\r
WicketUtils.setCssClass(lastChangeLabel, Utils.timeAgoCss(entry.lastChange));\r
\r
- String clazz = counter % 2 == 0 ? "dark" : "light";\r
- WicketUtils.setCssClass(item, clazz);\r
+ WicketUtils.setAlternatingBackground(item, counter);\r
counter++;\r
}\r
};\r
}\r
\r
Repository r = getRepository(); \r
+ List<Metric> metrics = JGitUtils.getDateMetrics(r);\r
+ \r
+ long numberOfCommits = 0;\r
+ for (Metric m : metrics) {\r
+ numberOfCommits += m.count;\r
+ }\r
\r
String owner = JGitUtils.getRepositoryOwner(r);\r
GitBlitWebSession session = GitBlitWebSession.get();\r
add(new Label("repositoryLastChange", lastchange));\r
add(new Label("repositoryCloneUrl", cloneurl));\r
\r
- add(new LogPanel("commitsPanel", repositoryName, r, numberCommits, false));\r
+ add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0));\r
add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs));\r
add(new BranchesPanel("branchesPanel", repositoryName, r, numberRefs));\r
\r
// Display an activity line graph\r
- insertActivityGraph(r);\r
+ insertActivityGraph(metrics);\r
}\r
\r
@Override\r
return getString("gb.summary");\r
}\r
\r
- private void insertActivityGraph(Repository r) {\r
- if (StoredSettings.getBoolean("generateActivityGraph", true)) {\r
- List<Metric> dates = JGitUtils.getDateMetrics(r);\r
- IChartData data = getChartData(dates);\r
+ private void insertActivityGraph(List<Metric> metrics) {\r
+ if (StoredSettings.getBoolean("generateActivityGraph", true)) { \r
+ IChartData data = getChartData(metrics);\r
\r
ChartProvider provider = new ChartProvider(new Dimension(400, 80), ChartType.LINE, data);\r
ChartAxis dateAxis = new ChartAxis(ChartAxisType.BOTTOM);\r
- dateAxis.setLabels(new String[] { dates.get(0).name, dates.get(dates.size() / 2).name, dates.get(dates.size() - 1).name });\r
+ dateAxis.setLabels(new String[] { metrics.get(0).name, metrics.get(metrics.size() / 2).name, metrics.get(metrics.size() - 1).name });\r
provider.addAxis(dateAxis);\r
\r
ChartAxis commitAxis = new ChartAxis(ChartAxisType.LEFT);\r
- commitAxis.setLabels(new String[] { "", String.valueOf((int) maxValue(dates)) });\r
+ commitAxis.setLabels(new String[] { "", String.valueOf((int) maxValue(metrics)) });\r
provider.addAxis(commitAxis);\r
\r
add(new Chart("commitsChart", provider));\r
}\r
}\r
\r
- protected IChartData getChartData(List<Metric> results) {\r
- final double[] counts = new double[results.size()];\r
+ protected IChartData getChartData(List<Metric> metrics) {\r
+ final double[] counts = new double[metrics.size()];\r
int i = 0;\r
double max = 0;\r
- for (Metric m : results) {\r
+ for (Metric m : metrics) {\r
counts[i++] = m.count;\r
max = Math.max(max, m.count);\r
}\r
super(params);\r
\r
Repository r = getRepository();\r
- RevCommit c = JGitUtils.getCommit(r, commitId);\r
+ RevCommit c = JGitUtils.getCommit(r, objectId);\r
\r
add(new LinkPanel("commit", "title", c.getName(), CommitPage.class, newCommitParameter()));\r
\r
final String basePath = params.getString("f", null);\r
\r
Repository r = getRepository();\r
- RevCommit commit = JGitUtils.getCommit(r, commitId);\r
+ RevCommit commit = JGitUtils.getCommit(r, objectId);\r
List<PathModel> paths = JGitUtils.getFilesInPath(r, basePath, commit);\r
\r
// tree page links\r
add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
\r
// breadcrumbs\r
- add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, basePath, commitId)); \r
+ add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, basePath, objectId)); \r
if (basePath != null && basePath.trim().length() > 0) {\r
- paths.add(0, PathModel.getParentPath(basePath, commitId));\r
+ paths.add(0, PathModel.getParentPath(basePath, objectId));\r
}\r
\r
final ByteFormat byteFormat = new ByteFormat();\r
\r
item.add(WicketUtils.createDateLabel("branchDate", entry.getDate(), GitBlitWebSession.get().getTimezone()));\r
\r
- item.add(new LinkPanel("branchName", "list name", WicketUtils.trimString(entry.getDisplayName(), 28), LogPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
+ item.add(new LinkPanel("branchName", "list name", WicketUtils.trimString(entry.getDisplayName(), 28), LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
\r
// only show branch type on the branches page\r
boolean remote = entry.getName().startsWith(Constants.R_REMOTES);\r
item.add(new Label("branchType", remote ? getString("gb.remote"):getString("gb.local")).setVisible(maxCount <= 0));\r
\r
- item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
- item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
+ item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
+ item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
\r
WicketUtils.setAlternatingBackground(item, counter);\r
counter++;\r
import java.util.List;\r
import java.util.Map;\r
\r
+import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator;\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.navigation.paging.PagingNavigator;\r
import org.apache.wicket.markup.html.panel.Panel;\r
import org.apache.wicket.markup.repeater.Item;\r
import org.apache.wicket.markup.repeater.data.DataView;\r
\r
private static final long serialVersionUID = 1L;\r
\r
- public LogPanel(String wicketId, final String repositoryName, Repository r, int maxCount, boolean showPager) {\r
+ public LogPanel(String wicketId, final String repositoryName, String objectId, Repository r, int limit, int pageOffset) {\r
super(wicketId);\r
-\r
+ boolean pageResults = limit <= 0; \r
+ setOutputMarkupId(pageResults);\r
+ \r
final Map<ObjectId, List<String>> allRefs = JGitUtils.getAllRefs(r);\r
- List<RevCommit> commits = JGitUtils.getRevLog(r, maxCount);\r
+ List<RevCommit> commits;\r
+ if (pageResults) {\r
+ // Paging result set\r
+ commits = JGitUtils.getRevLog(r, objectId, pageOffset*GitBlitWebApp.PAGING_ITEM_COUNT, GitBlitWebApp.PAGING_ITEM_COUNT);\r
+ } else {\r
+ // Fixed size result set\r
+ commits = JGitUtils.getRevLog(r, objectId, 0, limit);\r
+ }\r
\r
// header\r
- if (showPager) {\r
+ if (pageResults) {\r
// shortlog page\r
// show repository summary page link\r
- add(new LinkPanel("header", "title", repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName))); \r
+ add(new LinkPanel("header", "title", repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
} else {\r
// summary page\r
// show shortlog page link\r
\r
String shortMessage = entry.getShortMessage();\r
String trimmedMessage = WicketUtils.trimShortLog(shortMessage);\r
- LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName()));\r
+ LinkPanel shortlog = new LinkPanel("commitShortMessage", "list subject", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName()));\r
if (!shortMessage.equals(trimmedMessage)) {\r
WicketUtils.setHtmlTitle(shortlog, shortMessage);\r
}\r
\r
item.add(new RefsPanel("commitRefs", entry, allRefs));\r
\r
- item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
- item.add(new BookmarkablePageLink<Void>("diff", DiffPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
- item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
+ item.add(new BookmarkablePageLink<Void>("view", CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
+ item.add(new BookmarkablePageLink<Void>("diff", DiffPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
+ item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
\r
WicketUtils.setAlternatingBackground(item, counter);\r
counter++;\r
}\r
};\r
- add(logView);\r
+ add(logView); \r
\r
// determine to show pager, more, or neither\r
- if (maxCount <= 0) {\r
+ if (limit <= 0) {\r
// no display limit\r
add(new Label("moreLogs", "").setVisible(false));\r
add(new Label("pageLogs", "").setVisible(false));\r
- } else {\r
- if (commits.size() == maxCount) {\r
-\r
- }\r
- if (showPager) {\r
+ } else { \r
+ if (pageResults) {\r
// paging\r
add(new Label("moreLogs", "").setVisible(false));\r
- if (commits.size() == maxCount) {\r
+ if (commits.size() == limit) {\r
// show pager\r
logView.setItemsPerPage(GitBlitWebApp.PAGING_ITEM_COUNT);\r
- add(new PagingNavigator("pageLogs", logView));\r
+ add(new AjaxPagingNavigator("pageLogs", logView));\r
} else {\r
// nothing to page\r
add(new Label("pageLogs", "").setVisible(false));\r
} else {\r
// more\r
add(new Label("pageLogs", "").setVisible(false));\r
- if (commits.size() == maxCount) {\r
+ if (commits.size() == limit) {\r
// show more\r
add(new LinkPanel("moreLogs", "link", new StringResourceModel("gb.moreLogs", this, null), LogPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
} else {\r
\r
item.add(WicketUtils.createDateLabel("tagDate", entry.getDate(), GitBlitWebSession.get().getTimezone()));\r
\r
- item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getCommitId().getName())));\r
+ item.add(new LinkPanel("tagName", "list name", entry.getDisplayName(), CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getCommitId().getName())));\r
String message;\r
if (maxCount > 0) {\r
message = WicketUtils.trimString(entry.getShortLog(), 40);\r
message = entry.getShortLog();\r
}\r
if (entry.isAnnotatedTag()) {\r
- item.add(new LinkPanel("tagDescription", "list subject", message, TagPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getObjectId().getName())));\r
+ item.add(new LinkPanel("tagDescription", "list subject", message, TagPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getObjectId().getName())));\r
} else {\r
- item.add(new LinkPanel("tagDescription", "list subject", message, CommitPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getObjectId().getName())));\r
+ item.add(new LinkPanel("tagDescription", "list subject", message, CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getObjectId().getName())));\r
}\r
- item.add(new BookmarkablePageLink<Void>("view", TagPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getObjectId().getName())).setEnabled(entry.isAnnotatedTag()));\r
- item.add(new BookmarkablePageLink<Void>("commit", CommitPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getCommitId().getName())));\r
- item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newCommitParameter(repositoryName, entry.getName())));\r
+ item.add(new BookmarkablePageLink<Void>("view", TagPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getObjectId().getName())).setEnabled(entry.isAnnotatedTag()));\r
+ item.add(new BookmarkablePageLink<Void>("commit", CommitPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getCommitId().getName())));\r
+ item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
\r
WicketUtils.setAlternatingBackground(item, counter);\r
counter++;\r