]> source.dussan.org Git - gitblit.git/commitdiff
Show HEAD on metrics page if objectid is not specified
authorJames Moger <james.moger@gitblit.com>
Sat, 4 Feb 2012 04:48:42 +0000 (23:48 -0500)
committerJames Moger <james.moger@gitblit.com>
Sat, 4 Feb 2012 04:48:42 +0000 (23:48 -0500)
resources/bootstrap.gb.css
src/com/gitblit/wicket/pages/MetricsPage.java

index 7ff8fa87ddb0d3e7837c3a9a5203eee5eb4bdc1a..7a12263690fbae6ddd3d737d8b0abf8767456946 100644 (file)
@@ -713,7 +713,7 @@ td.date {
        font-style: italic !important;  \r
 }\r
 \r
-span.sha1, span.sha1 a, span.sha1 a span {\r
+span.sha1, span.sha1 a, span.sha1 a span, pre.commit_message {\r
        font-family: monospace;\r
        font-size: 13px;\r
 }\r
index 41c605cbb970c67e4a29d8a44682ea54162ec0b7..8fce27a8dd4f6c4ab9f1baadab87d752551b47d2 100644 (file)
@@ -40,6 +40,7 @@ import org.wicketstuff.googlecharts.ShapeMarker;
 \r
 import com.gitblit.models.Metric;\r
 import com.gitblit.utils.MetricUtils;\r
+import com.gitblit.utils.StringUtils;\r
 import com.gitblit.utils.TimeUtils;\r
 import com.gitblit.wicket.WicketUtils;\r
 \r
@@ -48,7 +49,11 @@ public class MetricsPage extends RepositoryPage {
        public MetricsPage(PageParameters params) {\r
                super(params);\r
                Repository r = getRepository();\r
-               add(new Label("branchTitle", objectId));\r
+               if (StringUtils.isEmpty(objectId)) {\r
+                       add(new Label("branchTitle", getRepositoryModel().HEAD));\r
+               } else {\r
+                       add(new Label("branchTitle", objectId));\r
+               }\r
                Metric metricsTotal = null;\r
                List<Metric> metrics = MetricUtils.getDateMetrics(r, objectId, true, null);\r
                metricsTotal = metrics.remove(0);\r