From 832aa2a6f35b70da370e2f25060132150c91d220 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Sat, 25 Aug 2012 08:24:58 -0400
Subject: [PATCH] Reset build identifiers for the next release

---
 src/com/gitblit/wicket/WicketUtils.java |   35 ++++++++++++++++++++++++-----------
 1 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/src/com/gitblit/wicket/WicketUtils.java b/src/com/gitblit/wicket/WicketUtils.java
index 7be5328..34a14a1 100644
--- a/src/com/gitblit/wicket/WicketUtils.java
+++ b/src/com/gitblit/wicket/WicketUtils.java
@@ -220,6 +220,19 @@
 		return img;
 	}
 
+	public static Label newIcon(String wicketId, String css) {
+		Label lbl = new Label(wicketId);
+		setCssClass(lbl, css);		
+		return lbl;
+	}
+	
+	public static Label newBlankIcon(String wicketId) {
+		Label lbl = new Label(wicketId);
+		setCssClass(lbl, "");
+		lbl.setRenderBodyOnly(true);
+		return lbl;
+	}
+	
 	public static ContextRelativeResource getResource(String file) {
 		return new ContextRelativeResource(file);
 	}
@@ -405,7 +418,7 @@
 		return params.getString("n", "");
 	}
 
-	public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone) {
+	public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone, TimeUtils timeUtils) {
 		String format = GitBlit.getString(Keys.web.datestampShortFormat, "MM/dd/yy");
 		DateFormat df = new SimpleDateFormat(format);
 		if (timeZone == null) {
@@ -421,7 +434,7 @@
 		String title = null;
 		if (date.getTime() <= System.currentTimeMillis()) {
 			// past
-			title = TimeUtils.timeAgo(date);
+			title = timeUtils.timeAgo(date);
 		}
 		if ((System.currentTimeMillis() - date.getTime()) < 10 * 24 * 60 * 60 * 1000L) {
 			String tmp = dateString;
@@ -429,14 +442,14 @@
 			title = tmp;
 		}
 		Label label = new Label(wicketId, dateString);
-		WicketUtils.setCssClass(label, TimeUtils.timeAgoCss(date));
+		WicketUtils.setCssClass(label, timeUtils.timeAgoCss(date));
 		if (!StringUtils.isEmpty(title)) {
 			WicketUtils.setHtmlTooltip(label, title);
 		}
 		return label;
 	}
 
-	public static Label createTimeLabel(String wicketId, Date date, TimeZone timeZone) {
+	public static Label createTimeLabel(String wicketId, Date date, TimeZone timeZone, TimeUtils timeUtils) {
 		String format = GitBlit.getString(Keys.web.timeFormat, "HH:mm");
 		DateFormat df = new SimpleDateFormat(format);
 		if (timeZone == null) {
@@ -449,7 +462,7 @@
 		} else {
 			timeString = df.format(date);
 		}
-		String title = TimeUtils.timeAgo(date);
+		String title = timeUtils.timeAgo(date);
 		Label label = new Label(wicketId, timeString);
 		if (!StringUtils.isEmpty(title)) {
 			WicketUtils.setHtmlTooltip(label, title);
@@ -457,7 +470,7 @@
 		return label;
 	}
 
-	public static Label createDatestampLabel(String wicketId, Date date, TimeZone timeZone) {
+	public static Label createDatestampLabel(String wicketId, Date date, TimeZone timeZone, TimeUtils timeUtils) {
 		String format = GitBlit.getString(Keys.web.datestampLongFormat, "EEEE, MMMM d, yyyy");
 		DateFormat df = new SimpleDateFormat(format);
 		if (timeZone == null) {
@@ -472,12 +485,12 @@
 		}
 		String title = null;
 		if (TimeUtils.isToday(date)) {
-			title = "today";
+			title = timeUtils.today();
 		} else if (TimeUtils.isYesterday(date)) {
-				title = "yesterday";
+				title = timeUtils.yesterday();
 		} else if (date.getTime() <= System.currentTimeMillis()) {
 			// past
-			title = TimeUtils.timeAgo(date);
+			title = timeUtils.timeAgo(date);
 		}
 		if ((System.currentTimeMillis() - date.getTime()) < 10 * 24 * 60 * 60 * 1000L) {
 			String tmp = dateString;
@@ -491,7 +504,7 @@
 		return label;
 	}
 
-	public static Label createTimestampLabel(String wicketId, Date date, TimeZone timeZone) {
+	public static Label createTimestampLabel(String wicketId, Date date, TimeZone timeZone, TimeUtils timeUtils) {
 		String format = GitBlit.getString(Keys.web.datetimestampLongFormat,
 				"EEEE, MMMM d, yyyy HH:mm Z");
 		DateFormat df = new SimpleDateFormat(format);
@@ -508,7 +521,7 @@
 		String title = null;
 		if (date.getTime() <= System.currentTimeMillis()) {
 			// past
-			title = TimeUtils.timeAgo(date);
+			title = timeUtils.timeAgo(date);
 		}
 		Label label = new Label(wicketId, dateString);
 		if (!StringUtils.isEmpty(title)) {

--
Gitblit v1.9.1