| | |
| | | import com.gitblit.Keys;
|
| | | import com.gitblit.models.Metric;
|
| | | import com.gitblit.models.PathModel;
|
| | | import com.gitblit.models.RepositoryModel;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.MarkdownUtils;
|
| | | import com.gitblit.utils.MetricUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.utils.TimeUtils;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.panels.BranchesPanel;
|
| | | import com.gitblit.wicket.panels.LogPanel;
|
| | | import com.gitblit.wicket.panels.RepositoryUrlPanel;
|
| | | import com.gitblit.wicket.panels.TagsPanel;
|
| | |
|
| | | public class SummaryPage extends RepositoryPage {
|
| | |
| | | int numberRefs = GitBlit.getInteger(Keys.web.summaryRefsCount, 5);
|
| | |
|
| | | Repository r = getRepository();
|
| | | RepositoryModel model = getRepositoryModel();
|
| | |
|
| | | List<Metric> metrics = null;
|
| | | Metric metricsTotal = null;
|
| | | if (GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {
|
| | | metrics = MetricUtils.getDateMetrics(r, null, true, null);
|
| | | if (!model.skipSummaryMetrics && GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {
|
| | | metrics = GitBlit.self().getRepositoryDefaultMetrics(model, r);
|
| | | metricsTotal = metrics.remove(0);
|
| | | }
|
| | |
|
| | |
| | | add(new Label("repositoryDescription", getRepositoryModel().description));
|
| | | add(new Label("repositoryOwner", getRepositoryModel().owner));
|
| | |
|
| | | add(WicketUtils.createTimestampLabel("repositoryLastChange", JGitUtils.getLastChange(r),
|
| | | getTimeZone()));
|
| | | add(WicketUtils.createTimestampLabel("repositoryLastChange",
|
| | | JGitUtils.getLastChange(r, null), getTimeZone()));
|
| | | if (metricsTotal == null) {
|
| | | add(new Label("branchStats", ""));
|
| | | } else {
|
| | |
| | | add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
|
| | | }
|
| | | StringBuilder sb = new StringBuilder();
|
| | | sb.append(WicketUtils.getHostURL(getRequestCycle().getRequest()));
|
| | | sb.append(WicketUtils.getGitblitURL(getRequestCycle().getRequest()));
|
| | | sb.append(Constants.GIT_PATH);
|
| | | sb.append(repositoryName);
|
| | | repositoryUrls.add(sb.toString());
|
| | |
| | | add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
|
| | | }
|
| | | repositoryUrls.addAll(GitBlit.self().getOtherCloneUrls(repositoryName));
|
| | | |
| | | String primaryUrl = repositoryUrls.remove(0);
|
| | | add(new RepositoryUrlPanel("repositoryCloneUrl", primaryUrl));
|
| | |
|
| | | add(new Label("repositoryCloneUrl", StringUtils.flattenStrings(repositoryUrls, "<br/>"))
|
| | | .setEscapeModelStrings(false));
|
| | | add(new Label("otherUrls", StringUtils.flattenStrings(repositoryUrls, "<br/>"))
|
| | | .setEscapeModelStrings(false));
|
| | |
|
| | | add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0));
|
| | | add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty());
|