| | |
| | | }
|
| | | }
|
| | |
|
| | | 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");
|
| | |
| | | default:
|
| | | setCssClass(container, "badge");
|
| | | break;
|
| | | } |
| | | }
|
| | | }
|
| | |
|
| | | public static void setAlternatingBackground(Component c, int i) {
|
| | |
| | |
|
| | | 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);
|
| | | }
|
| | |
| | | return new HeaderContributor(new IHeaderContributor() {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public void renderHead(IHeaderResponse response) {
|
| | | String contentType = "application/rss+xml";
|
| | |
|
| | |
| | | }
|
| | |
|
| | | 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) {
|
| | |
| | | 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);
|
| | | }
|
| | |
| | | IChartData data = new AbstractChartData(max) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public double[][] getData() {
|
| | | return new double[][] { commits, tags };
|
| | | }
|
| | |
| | | IChartData data = new AbstractChartData(max) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Override
|
| | | public double[][] getData() {
|
| | | return new double[][] { x, y };
|
| | | }
|