From: James Moger Date: Sat, 4 Feb 2012 04:48:42 +0000 (-0500) Subject: Show HEAD on metrics page if objectid is not specified X-Git-Tag: v0.9.0~106 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7c08c78b0f80609f3ea911b8a3eeb598f99c0fd2;p=gitblit.git Show HEAD on metrics page if objectid is not specified --- 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);