}\r
}\r
\r
- GoogleCharts charts = createCharts(pushes, authorExclusions);\r
- add(new HeaderContributor(charts));\r
+ addCharts(pushes, authorExclusions, daysBack);\r
+ } else {\r
+ add(new Label("feedheader").setVisible(false));\r
}\r
\r
// active repository list\r
* and the active authors pie chart\r
* \r
* @param recentPushes\r
- * @return\r
+ * @param authorExclusions\r
+ * @param daysBack\r
*/\r
- private GoogleCharts createCharts(List<PushLogEntry> recentPushes, Set<String> authorExclusions) {\r
+ private void addCharts(List<PushLogEntry> recentPushes, Set<String> authorExclusions, int daysBack) {\r
// activity metrics\r
Map<String, Metric> repositoryMetrics = new HashMap<String, Metric>();\r
Map<String, Metric> authorMetrics = new HashMap<String, Metric>();\r
\r
// aggregate repository and author metrics\r
+ int totalCommits = 0;\r
for (PushLogEntry push : recentPushes) {\r
\r
// aggregate repository metrics\r
repositoryMetrics.get(repository).count += 1;\r
\r
for (RepositoryCommit commit : push.getCommits()) {\r
+ totalCommits++;\r
String author = StringUtils.removeNewlines(commit.getAuthorIdent().getName());\r
String authorName = author.toLowerCase();\r
String authorEmail = StringUtils.removeNewlines(commit.getAuthorIdent().getEmailAddress()).toLowerCase();\r
}\r
}\r
}\r
+ \r
+ add(new Label("feedheader", MessageFormat.format(getString("gb.recentActivityStats"),\r
+ daysBack, totalCommits, authorMetrics.size())));\r
\r
// build google charts\r
GoogleCharts charts = new GoogleCharts();\r
chart.setShowLegend(false);\r
charts.addChart(chart);\r
\r
- return charts;\r
+ add(new HeaderContributor(charts));\r
}\r
\r
class RepoListItem implements Serializable {\r