James Moger
2011-06-28 be0fb213529d9d571078c59e534dbbd6b6cfc46c
src/com/gitblit/wicket/pages/MetricsPage.java
@@ -46,18 +46,18 @@
public class MetricsPage extends RepositoryPage {
   public MetricsPage(PageParameters params) {
      super(params);
      super(params);
      Repository r = getRepository();
      add(new Label("branchTitle", objectId));
      Metric metricsTotal = null;
      List<Metric> metrics = MetricUtils.getDateMetrics(r, objectId, true, null);
      metricsTotal = metrics.remove(0);
      if (metricsTotal == null) {
         add(new Label("branchStats", ""));
         add(new Label("branchStats", ""));
      } else {
         add(new Label("branchStats", MessageFormat.format(
               "{0} commits and {1} tags in {2}", metricsTotal.count, metricsTotal.tag,
               TimeUtils.duration(metricsTotal.duration))));
         add(new Label("branchStats",
               MessageFormat.format("{0} commits and {1} tags in {2}", metricsTotal.count,
                     metricsTotal.tag, TimeUtils.duration(metricsTotal.duration))));
      }
      insertLinePlot("commitsChart", metrics);
      insertBarPlot("dayOfWeekChart", getDayOfWeekMetrics(r, objectId));
@@ -134,7 +134,7 @@
      SimpleDateFormat sdf = new SimpleDateFormat("E");
      Calendar cal = Calendar.getInstance();
      List<Metric> sorted = new ArrayList<Metric>(7);
      List<Metric> sorted = new ArrayList<Metric>();
      int firstDayOfWeek = cal.getFirstDayOfWeek();
      int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
@@ -144,7 +144,7 @@
         String day = sdf.format(cal.getTime());
         for (Metric metric : list) {
            if (metric.name.equals(day)) {
               sorted.add(i, metric);
               sorted.add(metric);
               list.remove(metric);
               break;
            }