James Moger
2013-07-15 8f6e672ffe19c439aadc07b64e36ae4b83e78f1e
src/main/java/com/gitblit/wicket/pages/ActivityPage.java
@@ -61,7 +61,7 @@
      // parameters
      int daysBack = WicketUtils.getDaysBack(params);
      if (daysBack < 1) {
         daysBack = 14;
         daysBack = GitBlit.getInteger(Keys.web.activityDuration, 7);
      }
      String objectId = WicketUtils.getObject(params);
@@ -70,9 +70,26 @@
      List<Activity> recentActivity = ActivityUtils.getRecentActivity(models, 
            daysBack, objectId, getTimeZone());
      String headerPattern;
      if (daysBack == 1) {
         // today
         if (recentActivity.size() == 0) {
            headerPattern = getString("gb.todaysActivityNone");
         } else {
            headerPattern = getString("gb.todaysActivityStats");
         }
      } else {
         // multiple days
         if (recentActivity.size() == 0) {
            headerPattern = getString("gb.recentActivityNone");
         } else {
            headerPattern = getString("gb.recentActivityStats");
         }
      }
      if (recentActivity.size() == 0) {
         // no activity, skip graphs and activity panel
         add(new Label("subheader", MessageFormat.format(getString("gb.recentActivityNone"),
         add(new Label("subheader", MessageFormat.format(headerPattern,
               daysBack)));
         add(new Label("activityPanel"));
      } else {
@@ -86,7 +103,7 @@
         int totalAuthors = uniqueAuthors.size();
         // add the subheader with stat numbers
         add(new Label("subheader", MessageFormat.format(getString("gb.recentActivityStats"),
         add(new Label("subheader", MessageFormat.format(headerPattern,
               daysBack, totalCommits, totalAuthors)));
         // create the activity charts
@@ -109,7 +126,7 @@
            ActivityPage.class);
      PageParameters currentParameters = getPageParameters();
      int daysBack = GitBlit.getInteger(Keys.web.activityDuration, 14);
      int daysBack = GitBlit.getInteger(Keys.web.activityDuration, 7);
      if (currentParameters != null && !currentParameters.containsKey("db")) {
         currentParameters.put("db", daysBack);
      }
@@ -162,8 +179,6 @@
      }
      // build google charts
      int w = 310;
      int h = 150;
      GoogleCharts charts = new GoogleCharts();
      // sort in reverse-chronological order and then reverse that
@@ -178,8 +193,6 @@
      for (Activity metric : recentActivity) {
         chart.addValue(df.format(metric.startDate), metric.getCommitCount());
      }
      chart.setWidth(w);
      chart.setHeight(h);
      charts.addChart(chart);
      // active repositories pie chart
@@ -188,8 +201,7 @@
      for (Metric metric : repositoryMetrics.values()) {
         chart.addValue(metric.name, metric.count);
      }
      chart.setWidth(w);
      chart.setHeight(h);
      chart.setShowLegend(false);
      charts.addChart(chart);
      // active authors pie chart
@@ -198,8 +210,7 @@
      for (Metric metric : authorMetrics.values()) {
         chart.addValue(metric.name, metric.count);
      }
      chart.setWidth(w);
      chart.setHeight(h);
      chart.setShowLegend(false);
      charts.addChart(chart);
      return charts;