From 7c08c78b0f80609f3ea911b8a3eeb598f99c0fd2 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 3 Feb 2012 23:48:42 -0500 Subject: [PATCH] Show HEAD on metrics page if objectid is not specified --- resources/bootstrap.gb.css | 2 +- src/com/gitblit/wicket/pages/MetricsPage.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/bootstrap.gb.css b/resources/bootstrap.gb.css index 7ff8fa87..7a122636 100644 --- a/resources/bootstrap.gb.css +++ b/resources/bootstrap.gb.css @@ -713,7 +713,7 @@ td.date { font-style: italic !important; } -span.sha1, span.sha1 a, span.sha1 a span { +span.sha1, span.sha1 a, span.sha1 a span, pre.commit_message { font-family: monospace; font-size: 13px; } diff --git a/src/com/gitblit/wicket/pages/MetricsPage.java b/src/com/gitblit/wicket/pages/MetricsPage.java index 41c605cb..8fce27a8 100644 --- a/src/com/gitblit/wicket/pages/MetricsPage.java +++ b/src/com/gitblit/wicket/pages/MetricsPage.java @@ -40,6 +40,7 @@ import org.wicketstuff.googlecharts.ShapeMarker; import com.gitblit.models.Metric; import com.gitblit.utils.MetricUtils; +import com.gitblit.utils.StringUtils; import com.gitblit.utils.TimeUtils; import com.gitblit.wicket.WicketUtils; @@ -48,7 +49,11 @@ public class MetricsPage extends RepositoryPage { public MetricsPage(PageParameters params) { super(params); Repository r = getRepository(); - add(new Label("branchTitle", objectId)); + if (StringUtils.isEmpty(objectId)) { + add(new Label("branchTitle", getRepositoryModel().HEAD)); + } else { + add(new Label("branchTitle", objectId)); + } Metric metricsTotal = null; List metrics = MetricUtils.getDateMetrics(r, objectId, true, null); metricsTotal = metrics.remove(0); -- 2.39.5