From 020a4d6dccfa25235a1481efc3e449a73a0d659a Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Thu, 24 Oct 2013 08:12:03 -0400
Subject: [PATCH] Merge pull request #119 from simonharrer/fix-locale-test-run-bug
---
src/main/java/com/gitblit/wicket/WicketUtils.java | 35 ++++++++++++++---------------------
1 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/src/main/java/com/gitblit/wicket/WicketUtils.java b/src/main/java/com/gitblit/wicket/WicketUtils.java
index aa86686..a2522ef 100644
--- a/src/main/java/com/gitblit/wicket/WicketUtils.java
+++ b/src/main/java/com/gitblit/wicket/WicketUtils.java
@@ -95,22 +95,6 @@
}
}
- public static void setTicketCssClass(Component container, String state) {
- String css = null;
- if (state.equals("open")) {
- css = "label label-important";
- } else if (state.equals("hold")) {
- css = "label label-warning";
- } else if (state.equals("resolved")) {
- css = "label label-success";
- } else if (state.equals("invalid")) {
- css = "label";
- }
- if (css != null) {
- setCssClass(container, css);
- }
- }
-
public static void setPermissionClass(Component container, AccessPermission permission) {
if (permission == null) {
setCssClass(container, "badge");
@@ -131,7 +115,7 @@
default:
setCssClass(container, "badge");
break;
- }
+ }
}
public static void setAlternatingBackground(Component c, int i) {
@@ -248,17 +232,17 @@
public static Label newIcon(String wicketId, String css) {
Label lbl = new Label(wicketId);
- setCssClass(lbl, css);
+ 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);
}
@@ -273,6 +257,7 @@
return new HeaderContributor(new IHeaderContributor() {
private static final long serialVersionUID = 1L;
+ @Override
public void renderHead(IHeaderResponse response) {
String contentType = "application/rss+xml";
@@ -523,6 +508,10 @@
}
public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone, TimeUtils timeUtils) {
+ return createDateLabel(wicketId, date, timeZone, timeUtils, true);
+ }
+
+ public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone, TimeUtils timeUtils, boolean setCss) {
String format = GitBlit.getString(Keys.web.datestampShortFormat, "MM/dd/yy");
DateFormat df = new SimpleDateFormat(format);
if (timeZone == null) {
@@ -546,7 +535,9 @@
title = tmp;
}
Label label = new Label(wicketId, dateString);
- WicketUtils.setCssClass(label, timeUtils.timeAgoCss(date));
+ if (setCss) {
+ WicketUtils.setCssClass(label, timeUtils.timeAgoCss(date));
+ }
if (!StringUtils.isEmpty(title)) {
WicketUtils.setHtmlTooltip(label, title);
}
@@ -652,6 +643,7 @@
IChartData data = new AbstractChartData(max) {
private static final long serialVersionUID = 1L;
+ @Override
public double[][] getData() {
return new double[][] { commits, tags };
}
@@ -687,6 +679,7 @@
IChartData data = new AbstractChartData(max) {
private static final long serialVersionUID = 1L;
+ @Override
public double[][] getData() {
return new double[][] { x, y };
}
--
Gitblit v1.9.1