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/panels/BasePanel.java |   30 ++++++++++++++++++++----------
 1 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/gitblit/wicket/panels/BasePanel.java b/src/main/java/com/gitblit/wicket/panels/BasePanel.java
index 9c7cc85..e8f8f6f 100644
--- a/src/main/java/com/gitblit/wicket/panels/BasePanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/BasePanel.java
@@ -24,40 +24,48 @@
 import org.apache.wicket.model.Model;
 
 import com.gitblit.Constants;
-import com.gitblit.GitBlit;
 import com.gitblit.Keys;
 import com.gitblit.utils.TimeUtils;
+import com.gitblit.wicket.GitBlitWebApp;
 import com.gitblit.wicket.GitBlitWebSession;
 import com.gitblit.wicket.WicketUtils;
 
 public abstract class BasePanel extends Panel {
 
 	private static final long serialVersionUID = 1L;
-	
+
 	private transient TimeUtils timeUtils;
 
 	public BasePanel(String wicketId) {
 		super(wicketId);
 	}
 
-	protected TimeZone getTimeZone() {
-		return GitBlit.getBoolean(Keys.web.useClientTimezone, false) ? GitBlitWebSession.get()
-				.getTimezone() : GitBlit.getTimezone();
+	protected GitBlitWebApp app() {
+		return GitBlitWebApp.get();
 	}
-	
+
+	protected String getContextUrl() {
+		return getRequest().getRelativePathPrefixToContextRoot();
+	}
+
+	protected TimeZone getTimeZone() {
+		return app().settings().getBoolean(Keys.web.useClientTimezone, false) ? GitBlitWebSession.get()
+				.getTimezone() : app().getTimezone();
+	}
+
 	protected TimeUtils getTimeUtils() {
 		if (timeUtils == null) {
-			ResourceBundle bundle;		
+			ResourceBundle bundle;
 			try {
 				bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", GitBlitWebSession.get().getLocale());
 			} catch (Throwable t) {
 				bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp");
 			}
-			timeUtils = new TimeUtils(bundle);
+			timeUtils = new TimeUtils(bundle, getTimeZone());
 		}
 		return timeUtils;
 	}
-	
+
 	protected void setPersonSearchTooltip(Component component, String value, Constants.SearchType searchType) {
 		if (searchType.equals(Constants.SearchType.AUTHOR)) {
 			WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);
@@ -74,6 +82,7 @@
 			super(event, true, new Model<String>(msg));
 		}
 
+		@Override
 		protected String newValue(final String currentValue, final String replacementValue) {
 			String prefix = "var conf = confirm('" + replacementValue + "'); "
 					+ "if (!conf) return false; ";
@@ -90,12 +99,13 @@
 		private static final long serialVersionUID = 1L;
 
 		private String initialValue = "";
-		
+
 		public JavascriptTextPrompt(String event, String msg, String value) {
 			super(event, true, new Model<String>(msg));
 			initialValue = value;
 		}
 
+		@Override
 		protected String newValue(final String currentValue, final String message) {
 			String result = "var userText = prompt('" + message + "','"
 					+ (initialValue == null ? "" : initialValue) + "'); " + "return userText; ";

--
Gitblit v1.9.1