From b94965e87929c6b4e42f9a2078dc0d910cc2637d Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 09 May 2012 07:59:00 -0400
Subject: [PATCH] Merge pull request #17 from peterloron/master

---
 src/com/gitblit/wicket/pages/SummaryPage.java |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java
index d928b06..2996b66 100644
--- a/src/com/gitblit/wicket/pages/SummaryPage.java
+++ b/src/com/gitblit/wicket/pages/SummaryPage.java
@@ -22,9 +22,11 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.wicket.Component;
 import org.apache.wicket.PageParameters;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.panel.Fragment;
 import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.revwalk.RevCommit;
 import org.wicketstuff.googlecharts.Chart;
@@ -37,9 +39,9 @@
 import org.wicketstuff.googlecharts.MarkerType;
 import org.wicketstuff.googlecharts.ShapeMarker;
 
+import com.gitblit.Constants.AccessRestrictionType;
 import com.gitblit.GitBlit;
 import com.gitblit.Keys;
-import com.gitblit.Constants.AccessRestrictionType;
 import com.gitblit.models.Metric;
 import com.gitblit.models.PathModel;
 import com.gitblit.models.RepositoryModel;
@@ -82,12 +84,12 @@
 		add(new Label("repositoryOwner", getRepositoryModel().owner));
 
 		add(WicketUtils.createTimestampLabel("repositoryLastChange",
-				JGitUtils.getLastChange(r, null), getTimeZone()));
+				JGitUtils.getLastChange(r), getTimeZone()));
 		if (metricsTotal == null) {
 			add(new Label("branchStats", ""));
 		} else {
 			add(new Label("branchStats",
-					MessageFormat.format("{0} commits and {1} tags in {2}", metricsTotal.count,
+					MessageFormat.format(getString("gb.branchStats"), metricsTotal.count,
 							metricsTotal.tag, TimeUtils.duration(metricsTotal.duration))));
 		}
 		add(new BookmarkablePageLink<Void>("metrics", MetricsPage.class,
@@ -129,17 +131,17 @@
 		add(new Label("otherUrls", StringUtils.flattenStrings(repositoryUrls, "<br/>"))
 		.setEscapeModelStrings(false));
 
-		add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0));
+		add(new LogPanel("commitsPanel", repositoryName, getRepositoryModel().HEAD, r, numberCommits, 0));
 		add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty());
 		add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs).hideIfEmpty());
 
 		if (getRepositoryModel().showReadme) {
 			String htmlText = null;
+			String readme = null;
 			try {
 				RevCommit head = JGitUtils.getCommit(r, null);
 				List<String> markdownExtensions = GitBlit.getStrings(Keys.web.markdownExtensions);
-				List<PathModel> paths = JGitUtils.getFilesInPath(r, null, head);
-				String readme = null;
+				List<PathModel> paths = JGitUtils.getFilesInPath(r, null, head);				
 				for (PathModel path : paths) {
 					if (!path.isTree()) {
 						String name = path.name.toLowerCase();
@@ -162,9 +164,12 @@
 			} catch (ParseException p) {
 				error(p.getMessage());
 			}
+			Fragment fragment = new Fragment("readme", "markdownPanel");
+			fragment.add(new Label("readmeFile", readme));
 			// Add the html to the page
-			add(new Label("readme", htmlText).setEscapeModelStrings(false).setVisible(
-					!StringUtils.isEmpty(htmlText)));
+			Component content = new Label("readmeContent", htmlText).setEscapeModelStrings(false);
+			fragment.add(content.setVisible(!StringUtils.isEmpty(htmlText)));
+			add(fragment);
 		} else {
 			add(new Label("readme").setVisible(false));
 		}
@@ -183,7 +188,7 @@
 				&& GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {
 			IChartData data = WicketUtils.getChartData(metrics);
 
-			ChartProvider provider = new ChartProvider(new Dimension(400, 100), ChartType.LINE,
+			ChartProvider provider = new ChartProvider(new Dimension(340, 100), ChartType.LINE,
 					data);
 			ChartAxis dateAxis = new ChartAxis(ChartAxisType.BOTTOM);
 			dateAxis.setLabels(new String[] { metrics.get(0).name,

--
Gitblit v1.9.1