// setup the standard gitweb-ish urls
mount("/repositories", RepositoriesPage.class);
- mount("/overview", OverviewPage.class, "r", "h");
+ mount("/overview", OverviewPage.class, "r");
mount("/summary", SummaryPage.class, "r");
- mount("/reflog", ReflogPage.class, "r", "h");
+ mount("/reflog", ReflogPage.class, "r");
mount("/commits", LogPage.class, "r", "h");
mount("/log", LogPage.class, "r", "h");
mount("/tags", TagsPage.class, "r");
return getString("gb.blame");\r
}\r
\r
+ @Override\r
+ protected boolean isCommitPage() {\r
+ return true;\r
+ }\r
+\r
@Override\r
protected Class<? extends BasePage> getRepoNavPageClass() {\r
return TreePage.class;\r
return getString("gb.diff");\r
}\r
\r
+ @Override\r
+ protected boolean isCommitPage() {\r
+ return true;\r
+ }\r
+\r
@Override\r
protected Class<? extends BasePage> getRepoNavPageClass() {\r
return TreePage.class;\r
return getString("gb.view");\r
}\r
\r
+ @Override\r
+ protected boolean isCommitPage() {\r
+ return true;\r
+ }\r
+\r
@Override\r
protected Class<? extends BasePage> getRepoNavPageClass() {\r
return TreePage.class;\r
return getString("gb.commitdiff");
}
+ @Override
+ protected boolean isCommitPage() {
+ return true;
+ }
+
@Override
protected Class<? extends BasePage> getRepoNavPageClass() {
return LogPage.class;
return getString("gb.commit");\r
}\r
\r
+ @Override\r
+ protected boolean isCommitPage() {\r
+ return true;\r
+ }\r
+\r
@Override\r
protected Class<? extends BasePage> getRepoNavPageClass() {\r
return LogPage.class;\r
return getString("gb.docs");\r
}\r
\r
+ @Override\r
+ protected boolean isCommitPage() {\r
+ return true;\r
+ }\r
+\r
@Override\r
protected Class<? extends BasePage> getRepoNavPageClass() {\r
return DocsPage.class;\r
protected String getPageName() {\r
return getString("gb.docs");\r
}\r
+\r
+ @Override\r
+ protected boolean isCommitPage() {\r
+ return true;\r
+ }\r
+\r
}\r
return getString("gb.history");\r
}\r
\r
+ @Override\r
+ protected boolean isCommitPage() {\r
+ return true;\r
+ }\r
+\r
@Override\r
protected Class<? extends BasePage> getRepoNavPageClass() {\r
return TreePage.class;\r
protected String getPageName() {\r
return getString("gb.log");\r
}\r
+\r
+ @Override\r
+ protected boolean isCommitPage() {\r
+ return true;\r
+ }\r
+\r
}\r
MessageFormat.format(getString("gb.branchStats"), metricsTotal.count,\r
metricsTotal.tag, getTimeUtils().duration(metricsTotal.duration))));\r
}\r
- \r
+\r
Charts charts = new Flotr2Charts();\r
- \r
+\r
add(WicketUtils.newBlankImage("commitsChart"));\r
add(WicketUtils.newBlankImage("dayOfWeekChart"));\r
add(WicketUtils.newBlankImage("authorsChart"));\r
- \r
+\r
createLineChart(charts, "commitsChart", metrics);\r
createBarChart(charts, "dayOfWeekChart", getDayOfWeekMetrics(r, objectId));\r
createPieChart(charts, "authorsChart", getAuthorMetrics(r, objectId));\r
- \r
+\r
add(new HeaderContributor(charts));\r
\r
}\r
\r
private void createLineChart(Charts charts, String id, List<Metric> metrics) {\r
if ((metrics != null) && (metrics.size() > 0)) {\r
- \r
+\r
Chart chart = charts.createLineChart(id, "", "day",\r
getString("gb.commits"));\r
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");\r
chart.addHighlight(date, (int)metric.count);\r
}\r
}\r
- charts.addChart(chart); \r
+ charts.addChart(chart);\r
}\r
}\r
- \r
+\r
private void createPieChart(Charts charts, String id, List<Metric> metrics) {\r
if ((metrics != null) && (metrics.size() > 0)) {\r
- \r
+\r
Chart chart = charts.createPieChart(id, "", "day",\r
getString("gb.commits"));\r
for (Metric metric : metrics) {\r
chart.addValue(metric.name, (int)metric.count);\r
}\r
- charts.addChart(chart); \r
+ charts.addChart(chart);\r
}\r
}\r
- \r
+\r
private void createBarChart(Charts charts, String id, List<Metric> metrics) {\r
if ((metrics != null) && (metrics.size() > 0)) {\r
Chart chart = charts.createBarChart(id, "", "day",\r
for (Metric metric : metrics) {\r
chart.addValue(metric.name, (int)metric.count);\r
}\r
- charts.addChart(chart); \r
+ charts.addChart(chart);\r
}\r
}\r
\r
return getString("gb.metrics");\r
}\r
\r
+ @Override\r
+ protected boolean isCommitPage() {\r
+ return true;\r
+ }\r
+\r
@Override\r
protected Class<? extends BasePage> getRepoNavPageClass() {\r
return SummaryPage.class;\r
return getString("gb.docs");
}
+ @Override
+ protected boolean isCommitPage() {
+ return true;
+ }
+
@Override
protected Class<? extends BasePage> getRepoNavPageClass() {
return DocsPage.class;
objectParams = params;\r
\r
// preserve the objectid iff the objectid directly (or indirectly) refers to a ref\r
- if (!StringUtils.isEmpty(objectId)) {\r
+ if (isCommitPage() && !StringUtils.isEmpty(objectId)) {\r
RevCommit commit = JGitUtils.getCommit(r, objectId);\r
- String bestId = getBestCommitId(commit);\r
- if (!commit.getName().equals(bestId)) {\r
- objectParams = WicketUtils.newObjectParameter(getRepositoryName(), bestId);\r
+ if (commit != null) {\r
+ String bestId = getBestCommitId(commit);\r
+ if (!commit.getName().equals(bestId)) {\r
+ objectParams = WicketUtils.newObjectParameter(getRepositoryName(), bestId);\r
+ }\r
}\r
}\r
}\r
\r
protected abstract String getPageName();\r
\r
+ protected boolean isCommitPage() {\r
+ return false;\r
+ }\r
+\r
protected Component createPersonPanel(String wicketId, PersonIdent identity,\r
Constants.SearchType searchType) {\r
String name = identity == null ? "" : identity.getName();\r
return getString("gb.tag");\r
}\r
\r
+ @Override\r
+ protected boolean isCommitPage() {\r
+ return true;\r
+ }\r
+\r
@Override\r
protected Class<? extends BasePage> getRepoNavPageClass() {\r
return LogPage.class;\r
protected String getPageName() {\r
return getString("gb.tree");\r
}\r
+\r
+ @Override\r
+ protected boolean isCommitPage() {\r
+ return true;\r
+ }\r
+\r
}\r