From 3daba4304dba818d54eb9b74d8d35df5aab8fee5 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Fri, 22 Nov 2013 10:36:05 -0500 Subject: [PATCH] Add pull request linking in changelog to generated documentation --- src/main/java/com/gitblit/wicket/pages/DashboardPage.java | 63 ++++++++++++++++--------------- 1 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/pages/DashboardPage.java b/src/main/java/com/gitblit/wicket/pages/DashboardPage.java index e25bcf2..5c72b8b 100644 --- a/src/main/java/com/gitblit/wicket/pages/DashboardPage.java +++ b/src/main/java/com/gitblit/wicket/pages/DashboardPage.java @@ -15,7 +15,6 @@ */ package com.gitblit.wicket.pages; -import java.io.Serializable; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Calendar; @@ -76,7 +75,7 @@ c.add(Calendar.DATE, -1*daysBack); Date minimumDate = c.getTime(); TimeZone timezone = getTimeZone(); - + // create daily commit digest feed List<DailyLogEntry> digests = new ArrayList<DailyLogEntry>(); for (RepositoryModel model : repositories) { @@ -90,7 +89,7 @@ repository.close(); } } - + Fragment activityFragment = new Fragment("activity", "activityFragment", this); add(activityFragment); activityFragment.add(new Label("feedTitle", feedTitle)); @@ -119,7 +118,7 @@ DigestsPanel digestsPanel = new DigestsPanel("digests", digests); activityFragment.add(digestsPanel); } - + // add the nifty charts if (!ArrayUtils.isEmpty(digests)) { // aggregate author exclusions @@ -141,15 +140,13 @@ activityFragment.add(new Label("feedheader").setVisible(false)); } } - + @Override protected void addDropDownMenus(List<PageRegistration> pages) { PageParameters params = getPageParameters(); DropDownMenuRegistration menu = new DropDownMenuRegistration("gb.filters", GitBlitWebApp.HOME_PAGE_CLASS); - // preserve time filter option on repository choices - menu.menuItems.addAll(getRepositoryFilterItems(params)); // preserve repository filter option on time choices menu.menuItems.addAll(getTimeFilterItems(params)); @@ -166,7 +163,7 @@ /** * Creates the daily activity line chart, the active repositories pie chart, * and the active authors pie chart - * + * * @param recentChanges * @param authorExclusions * @param daysBack @@ -186,7 +183,7 @@ repositoryMetrics.put(repository, new Metric(repository)); } repositoryMetrics.get(repository).count += 1; - + for (RepositoryCommit commit : change.getCommits()) { totalCommits++; String author = StringUtils.removeNewlines(commit.getAuthorIdent().getName()); @@ -200,7 +197,7 @@ } } } - + String headerPattern; if (daysBack == 1) { // today @@ -220,28 +217,32 @@ frag.add(new Label("feedheader", MessageFormat.format(headerPattern, daysBack, totalCommits, authorMetrics.size()))); - // build google charts - GoogleCharts charts = new GoogleCharts(); + if (GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) { + // build google charts + GoogleCharts charts = new GoogleCharts(); - // active repositories pie chart - GoogleChart chart = new GooglePieChart("chartRepositories", getString("gb.activeRepositories"), - getString("gb.repository"), getString("gb.commits")); - for (Metric metric : repositoryMetrics.values()) { - chart.addValue(metric.name, metric.count); + // active repositories pie chart + GoogleChart chart = new GooglePieChart("chartRepositories", getString("gb.activeRepositories"), + getString("gb.repository"), getString("gb.commits")); + for (Metric metric : repositoryMetrics.values()) { + chart.addValue(metric.name, metric.count); + } + chart.setShowLegend(false); + charts.addChart(chart); + + // active authors pie chart + chart = new GooglePieChart("chartAuthors", getString("gb.activeAuthors"), + getString("gb.author"), getString("gb.commits")); + for (Metric metric : authorMetrics.values()) { + chart.addValue(metric.name, metric.count); + } + chart.setShowLegend(false); + charts.addChart(chart); + + add(new HeaderContributor(charts)); + frag.add(new Fragment("charts", "chartsFragment", this)); + } else { + frag.add(new Label("charts").setVisible(false)); } - chart.setShowLegend(false); - charts.addChart(chart); - - // active authors pie chart - chart = new GooglePieChart("chartAuthors", getString("gb.activeAuthors"), - getString("gb.author"), getString("gb.commits")); - for (Metric metric : authorMetrics.values()) { - chart.addValue(metric.name, metric.count); - } - chart.setShowLegend(false); - charts.addChart(chart); - - add(new HeaderContributor(charts)); - frag.add(new Fragment("charts", "chartsFragment", this)); } } -- Gitblit v1.9.1