From c19ae5c6d45085528dae8c94a2eb737e06c335ce Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Sun, 22 May 2011 13:04:11 -0400
Subject: [PATCH] Documentation.
---
src/com/gitblit/wicket/pages/SummaryPage.java | 52 +++++++++++++++++++++++++++++++++++-----------------
1 files changed, 35 insertions(+), 17 deletions(-)
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java
index 53a684b..d83f596 100644
--- a/src/com/gitblit/wicket/pages/SummaryPage.java
+++ b/src/com/gitblit/wicket/pages/SummaryPage.java
@@ -7,19 +7,19 @@
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.image.ContextImage;
import org.eclipse.jgit.lib.Repository;
+import org.wicketstuff.googlecharts.AbstractChartData;
+import org.wicketstuff.googlecharts.Chart;
+import org.wicketstuff.googlecharts.ChartAxis;
+import org.wicketstuff.googlecharts.ChartAxisType;
+import org.wicketstuff.googlecharts.ChartProvider;
+import org.wicketstuff.googlecharts.ChartType;
+import org.wicketstuff.googlecharts.IChartData;
+import org.wicketstuff.googlecharts.LineStyle;
+import org.wicketstuff.googlecharts.MarkerType;
+import org.wicketstuff.googlecharts.ShapeMarker;
-import com.codecommit.wicket.AbstractChartData;
-import com.codecommit.wicket.Chart;
-import com.codecommit.wicket.ChartAxis;
-import com.codecommit.wicket.ChartAxisType;
-import com.codecommit.wicket.ChartProvider;
-import com.codecommit.wicket.ChartType;
-import com.codecommit.wicket.IChartData;
-import com.codecommit.wicket.LineStyle;
-import com.codecommit.wicket.MarkerType;
-import com.codecommit.wicket.ShapeMarker;
+import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.GitBlit;
import com.gitblit.Keys;
import com.gitblit.utils.JGitUtils;
@@ -58,8 +58,8 @@
}
// repository description
- add(new Label("repositoryDescription", description));
- add(new Label("repositoryOwner", JGitUtils.getRepositoryOwner(r)));
+ add(new Label("repositoryDescription", getRepositoryModel().description));
+ add(new Label("repositoryOwner", getRepositoryModel().owner));
add(WicketUtils.createTimestampLabel("repositoryLastChange", JGitUtils.getLastChange(r), getTimeZone()));
if (metricsTotal == null) {
@@ -67,11 +67,29 @@
} else {
add(new Label("repositoryStats", MessageFormat.format("{0} commits and {1} tags in {2}", metricsTotal.count, metricsTotal.tag, TimeUtils.duration(metricsTotal.duration))));
}
+
+ AccessRestrictionType accessRestriction = getRepositoryModel().accessRestriction;
+ switch (accessRestriction) {
+ case NONE:
+ add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
+ break;
+ case PUSH:
+ add(WicketUtils.newImage("accessRestrictionIcon", "lock_go_16x16.png", getAccessRestrictions().get(accessRestriction)));
+ break;
+ case CLONE:
+ add(WicketUtils.newImage("accessRestrictionIcon", "lock_pull_16x16.png", getAccessRestrictions().get(accessRestriction)));
+ break;
+ case VIEW:
+ add(WicketUtils.newImage("accessRestrictionIcon", "shield_16x16.png", getAccessRestrictions().get(accessRestriction)));
+ break;
+ default:
+ add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
+ }
add(new Label("repositoryCloneUrl", GitBlit.self().getCloneUrl(repositoryName)));
add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0));
add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs));
- add(new BranchesPanel("branchesPanel", repositoryName, r, numberRefs));
+ add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs));
// Display an activity line graph
insertActivityGraph(metrics);
@@ -83,7 +101,7 @@
}
private void insertActivityGraph(List<Metric> metrics) {
- if (GitBlit.self().settings().getBoolean(Keys.web.generateActivityGraph, true)) {
+ if (metrics.size() > 0 && GitBlit.self().settings().getBoolean(Keys.web.generateActivityGraph, true)) {
IChartData data = getChartData(metrics);
ChartProvider provider = new ChartProvider(new Dimension(400, 100), ChartType.LINE, data);
@@ -96,11 +114,11 @@
provider.addAxis(commitAxis);
provider.setLineStyles(new LineStyle[] {new LineStyle(2, 4, 0), new LineStyle(0, 4, 1)});
- provider.addShapeMarker(new ShapeMarker(MarkerType.DIAMOND, Color.BLUE, 1, -1, 5));
+ provider.addShapeMarker(new ShapeMarker(MarkerType.CIRCLE, Color.BLUE, 1, -1, 5));
add(new Chart("commitsChart", provider));
} else {
- add(new ContextImage("commitsChart", "blank.png"));
+ add(WicketUtils.newBlankImage("commitsChart"));
}
}
--
Gitblit v1.9.1