From 0e44acbb2fec928a1606dc60f427a148fff405c9 Mon Sep 17 00:00:00 2001
From: Mohamed Ragab <moragab@gmail.com>
Date: Wed, 02 May 2012 11:15:01 -0400
Subject: [PATCH] Added a script to facilitate setting the proxy host and port and no proxy hosts, and then it concatenates all the java system properties for setting the java proxy configurations and puts the resulting string in an environment variable JAVA_PROXY_CONFIG, modified the scirpts gitblit, gitblit-ubuntu, and gitblit-centos to source the java-proxy-config.sh script and then include the resulting java proxy configuration in the java command
---
src/com/gitblit/wicket/WicketUtils.java | 43 +++++++++++++++++++++++++++++--------------
1 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/src/com/gitblit/wicket/WicketUtils.java b/src/com/gitblit/wicket/WicketUtils.java
index 59a9450..864ebe6 100644
--- a/src/com/gitblit/wicket/WicketUtils.java
+++ b/src/com/gitblit/wicket/WicketUtils.java
@@ -95,11 +95,11 @@
public static void setTicketCssClass(Component container, String state) {
String css = null;
if (state.equals("open")) {
- css = "label important";
+ css = "label label-important";
} else if (state.equals("hold")) {
- css = "label warning";
+ css = "label label-warning";
} else if (state.equals("resolved")) {
- css = "label success";
+ css = "label label-success";
} else if (state.equals("invalid")) {
css = "label";
}
@@ -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);
}
@@ -408,9 +421,10 @@
public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone) {
String format = GitBlit.getString(Keys.web.datestampShortFormat, "MM/dd/yy");
DateFormat df = new SimpleDateFormat(format);
- if (timeZone != null) {
- df.setTimeZone(timeZone);
+ if (timeZone == null) {
+ timeZone = GitBlit.getTimezone();
}
+ df.setTimeZone(timeZone);
String dateString;
if (date.getTime() == 0) {
dateString = "--";
@@ -438,9 +452,10 @@
public static Label createTimeLabel(String wicketId, Date date, TimeZone timeZone) {
String format = GitBlit.getString(Keys.web.timeFormat, "HH:mm");
DateFormat df = new SimpleDateFormat(format);
- if (timeZone != null) {
- df.setTimeZone(timeZone);
+ if (timeZone == null) {
+ timeZone = GitBlit.getTimezone();
}
+ df.setTimeZone(timeZone);
String timeString;
if (date.getTime() == 0) {
timeString = "--";
@@ -449,7 +464,6 @@
}
String title = TimeUtils.timeAgo(date);
Label label = new Label(wicketId, timeString);
- WicketUtils.setCssClass(label, TimeUtils.timeAgoCss(date));
if (!StringUtils.isEmpty(title)) {
WicketUtils.setHtmlTooltip(label, title);
}
@@ -459,9 +473,10 @@
public static Label createDatestampLabel(String wicketId, Date date, TimeZone timeZone) {
String format = GitBlit.getString(Keys.web.datestampLongFormat, "EEEE, MMMM d, yyyy");
DateFormat df = new SimpleDateFormat(format);
- if (timeZone != null) {
- df.setTimeZone(timeZone);
+ if (timeZone == null) {
+ timeZone = GitBlit.getTimezone();
}
+ df.setTimeZone(timeZone);
String dateString;
if (date.getTime() == 0) {
dateString = "--";
@@ -483,7 +498,6 @@
title = tmp;
}
Label label = new Label(wicketId, dateString);
- WicketUtils.setCssClass(label, TimeUtils.timeAgoCss(date));
if (!StringUtils.isEmpty(title)) {
WicketUtils.setHtmlTooltip(label, title);
}
@@ -492,11 +506,12 @@
public static Label createTimestampLabel(String wicketId, Date date, TimeZone timeZone) {
String format = GitBlit.getString(Keys.web.datetimestampLongFormat,
- "EEEE, MMMM d, yyyy h:mm a z");
+ "EEEE, MMMM d, yyyy HH:mm Z");
DateFormat df = new SimpleDateFormat(format);
- if (timeZone != null) {
- df.setTimeZone(timeZone);
+ if (timeZone == null) {
+ timeZone = GitBlit.getTimezone();
}
+ df.setTimeZone(timeZone);
String dateString;
if (date.getTime() == 0) {
dateString = "--";
--
Gitblit v1.9.1