From f76fee63ed9cb3a30d3c0c092d860b1cb93a481b Mon Sep 17 00:00:00 2001
From: Gerard Smyth <gerard.smyth@gmail.com>
Date: Thu, 08 May 2014 13:09:30 -0400
Subject: [PATCH] Updated the SyndicationServlet to provide an additional option to return details of the tags in the repository instead of the commits. This uses a new 'ot' request parameter to indicate the object type of the content to return, which can be ither TAG or COMMIT. If this is not provided, then COMMIT is assumed to maintain backwards compatability. If tags are returned, then the paging parameters, 'l' and 'pg' are still supported, but searching options are currently ignored.

---
 src/main/java/com/gitblit/wicket/pages/SummaryPage.java |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/main/java/com/gitblit/wicket/pages/SummaryPage.java b/src/main/java/com/gitblit/wicket/pages/SummaryPage.java
index eb6eb07..090c095 100644
--- a/src/main/java/com/gitblit/wicket/pages/SummaryPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/SummaryPage.java
@@ -16,12 +16,11 @@
 package com.gitblit.wicket.pages;
 
 import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 import org.apache.wicket.Component;
 import org.apache.wicket.PageParameters;
@@ -156,21 +155,24 @@
 			// global, no readme on summary page
 			add(new Label("readme").setVisible(false));
 		}
-		
-		Charts charts = createCharts(metrics);
-		add(new HeaderContributor(charts));
-		
+
+		if (metrics == null || metrics.isEmpty()) {
+			add(new Label("commitsChart").setVisible(false));
+		} else {
+			Charts charts = createCharts(metrics);
+			add(new HeaderContributor(charts));
+		}
 	}
 
 	@Override
 	protected String getPageName() {
 		return getString("gb.summary");
 	}
-	
+
 	private Charts createCharts(List<Metric> metrics) {
-		
+
 		Charts charts = new Flotr2Charts();
-		
+
 		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
 		String displayFormat = "MMM dd";
 		if(metrics.size() > 0 && metrics.get(0).name.length() == 7){
@@ -178,11 +180,11 @@
 			displayFormat = "yyyy MMM";
 		}
 		df.setTimeZone(getTimeZone());
-					
+
 		// build google charts
 		Chart chart = charts.createLineChart("commitsChart", getString("gb.activity"), "day", getString("gb.commits"));
 		chart.setDateFormat(displayFormat);
-	
+
 		for (Metric metric : metrics) {
 			Date date;
 			try {

--
Gitblit v1.9.1