import org.apache.wicket.PageParameters;\r
import org.apache.wicket.behavior.HeaderContributor;\r
import org.apache.wicket.markup.html.basic.Label;\r
+import org.apache.wicket.markup.html.panel.Fragment;\r
\r
import com.gitblit.GitBlit;\r
import com.gitblit.Keys;\r
import com.gitblit.utils.ActivityUtils;\r
import com.gitblit.utils.StringUtils;\r
import com.gitblit.wicket.CacheControl;\r
-import com.gitblit.wicket.PageRegistration;\r
import com.gitblit.wicket.CacheControl.LastModified;\r
+import com.gitblit.wicket.PageRegistration;\r
import com.gitblit.wicket.PageRegistration.DropDownMenuItem;\r
import com.gitblit.wicket.PageRegistration.DropDownMenuRegistration;\r
import com.gitblit.wicket.WicketUtils;\r
daysBack, totalCommits, totalAuthors)));\r
\r
// create the activity charts\r
- GoogleCharts charts = createCharts(recentActivity);\r
- add(new HeaderContributor(charts));\r
+ if (GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {\r
+ GoogleCharts charts = createCharts(recentActivity);\r
+ add(new HeaderContributor(charts));\r
+ add(new Fragment("chartsPanel", "chartsFragment", this));\r
+ } else {\r
+ add(new Label("chartsPanel").setVisible(false));\r
+ }\r
\r
// add activity panel\r
add(new ActivityPanel("activityPanel", recentActivity));\r
frag.add(new Label("feedheader", MessageFormat.format(headerPattern,\r
daysBack, totalCommits, authorMetrics.size())));\r
\r
- // build google charts\r
- GoogleCharts charts = new GoogleCharts();\r
-\r
- // active repositories pie chart\r
- GoogleChart chart = new GooglePieChart("chartRepositories", getString("gb.activeRepositories"),\r
- getString("gb.repository"), getString("gb.commits"));\r
- for (Metric metric : repositoryMetrics.values()) {\r
- chart.addValue(metric.name, metric.count);\r
- }\r
- chart.setShowLegend(false);\r
- charts.addChart(chart);\r
-\r
- // active authors pie chart\r
- chart = new GooglePieChart("chartAuthors", getString("gb.activeAuthors"),\r
- getString("gb.author"), getString("gb.commits"));\r
- for (Metric metric : authorMetrics.values()) {\r
- chart.addValue(metric.name, metric.count);\r
- }\r
- chart.setShowLegend(false);\r
- charts.addChart(chart);\r
+ if (GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {\r
+ // build google charts\r
+ GoogleCharts charts = new GoogleCharts();\r
+\r
+ // active repositories pie chart\r
+ GoogleChart chart = new GooglePieChart("chartRepositories", getString("gb.activeRepositories"),\r
+ getString("gb.repository"), getString("gb.commits"));\r
+ for (Metric metric : repositoryMetrics.values()) {\r
+ chart.addValue(metric.name, metric.count);\r
+ }\r
+ chart.setShowLegend(false);\r
+ charts.addChart(chart);\r
+\r
+ // active authors pie chart\r
+ chart = new GooglePieChart("chartAuthors", getString("gb.activeAuthors"),\r
+ getString("gb.author"), getString("gb.commits"));\r
+ for (Metric metric : authorMetrics.values()) {\r
+ chart.addValue(metric.name, metric.count);\r
+ }\r
+ chart.setShowLegend(false);\r
+ charts.addChart(chart);\r
\r
- add(new HeaderContributor(charts)); \r
- frag.add(new Fragment("charts", "chartsFragment", this));\r
+ add(new HeaderContributor(charts)); \r
+ frag.add(new Fragment("charts", "chartsFragment", this));\r
+ } else {\r
+ frag.add(new Label("charts").setVisible(false));\r
+ }\r
}\r
}\r