diff options
Diffstat (limited to 'src/main')
4 files changed, 43 insertions, 29 deletions
diff --git a/src/main/distrib/data/gitblit.properties b/src/main/distrib/data/gitblit.properties index 2318447c..ab7b9992 100644 --- a/src/main/distrib/data/gitblit.properties +++ b/src/main/distrib/data/gitblit.properties @@ -897,8 +897,8 @@ web.showEmailAddresses = true # SINCE 0.5.0
web.showSearchTypeSelection = false
-# Generates a line graph of repository activity over time on the Summary page.
-# This uses the Google Charts API.
+# Controls display of activity graphs on the dashboard, activity, and summary
+# pages. Charting makes use of the external Google Charts API.
#
# SINCE 0.5.0
web.generateActivityGraph = true
diff --git a/src/main/java/com/gitblit/wicket/pages/ActivityPage.html b/src/main/java/com/gitblit/wicket/pages/ActivityPage.html index 87e599f6..4c76b396 100644 --- a/src/main/java/com/gitblit/wicket/pages/ActivityPage.html +++ b/src/main/java/com/gitblit/wicket/pages/ActivityPage.html @@ -9,6 +9,11 @@ <div class="dashboardTitle">
<wicket:message key="gb.recentActivity"></wicket:message> <small><span class="hidden-phone"><span wicket:id="subheader">[days back]</span></span></small>
</div>
+ <div wicket:id="chartsPanel"></div>
+ <div wicket:id="activityPanel" style="padding-top:5px;" >[activity panel]</div>
+ </div>
+
+<wicket:fragment wicket:id="chartsFragment">
<div class="hidden-phone" style="text-align: center;">
<table>
<tr>
@@ -18,8 +23,7 @@ </tr>
</table>
</div>
- <div wicket:id="activityPanel" style="padding-top:5px;" >[activity panel]</div>
- </div>
+</wicket:fragment>
</wicket:extend>
</body>
</html>
\ No newline at end of file diff --git a/src/main/java/com/gitblit/wicket/pages/ActivityPage.java b/src/main/java/com/gitblit/wicket/pages/ActivityPage.java index 413403b4..a436813e 100644 --- a/src/main/java/com/gitblit/wicket/pages/ActivityPage.java +++ b/src/main/java/com/gitblit/wicket/pages/ActivityPage.java @@ -27,6 +27,7 @@ import java.util.Set; import org.apache.wicket.PageParameters;
import org.apache.wicket.behavior.HeaderContributor;
import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.panel.Fragment;
import com.gitblit.GitBlit;
import com.gitblit.Keys;
@@ -36,8 +37,8 @@ import com.gitblit.models.RepositoryModel; import com.gitblit.utils.ActivityUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.wicket.CacheControl;
-import com.gitblit.wicket.PageRegistration;
import com.gitblit.wicket.CacheControl.LastModified;
+import com.gitblit.wicket.PageRegistration;
import com.gitblit.wicket.PageRegistration.DropDownMenuItem;
import com.gitblit.wicket.PageRegistration.DropDownMenuRegistration;
import com.gitblit.wicket.WicketUtils;
@@ -111,8 +112,13 @@ public class ActivityPage extends RootPage { daysBack, totalCommits, totalAuthors)));
// create the activity charts
- GoogleCharts charts = createCharts(recentActivity);
- add(new HeaderContributor(charts));
+ if (GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {
+ GoogleCharts charts = createCharts(recentActivity);
+ add(new HeaderContributor(charts));
+ add(new Fragment("chartsPanel", "chartsFragment", this));
+ } else {
+ add(new Label("chartsPanel").setVisible(false));
+ }
// add activity panel
add(new ActivityPanel("activityPanel", recentActivity));
diff --git a/src/main/java/com/gitblit/wicket/pages/DashboardPage.java b/src/main/java/com/gitblit/wicket/pages/DashboardPage.java index 0af46c71..18add502 100644 --- a/src/main/java/com/gitblit/wicket/pages/DashboardPage.java +++ b/src/main/java/com/gitblit/wicket/pages/DashboardPage.java @@ -217,28 +217,32 @@ public abstract class DashboardPage extends RootPage { frag.add(new Label("feedheader", MessageFormat.format(headerPattern,
daysBack, totalCommits, authorMetrics.size())));
- // 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);
- }
- 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);
+ 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);
+ }
+ 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));
+ add(new HeaderContributor(charts));
+ frag.add(new Fragment("charts", "chartsFragment", this));
+ } else {
+ frag.add(new Label("charts").setVisible(false));
+ }
}
}
|