| | |
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.MarkdownUtils;
|
| | | 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;
|
| | |
| | | add(new Label("repositoryOwner", getRepositoryModel().owner));
|
| | |
|
| | | add(WicketUtils.createTimestampLabel("repositoryLastChange",
|
| | | JGitUtils.getLastChange(r, null), getTimeZone()));
|
| | | JGitUtils.getLastChange(r), getTimeZone(), getTimeUtils()));
|
| | | if (metricsTotal == null) {
|
| | | 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))));
|
| | | MessageFormat.format(getString("gb.branchStats"), metricsTotal.count,
|
| | | metricsTotal.tag, getTimeUtils().duration(metricsTotal.duration))));
|
| | | }
|
| | | add(new BookmarkablePageLink<Void>("metrics", MetricsPage.class,
|
| | | WicketUtils.newRepositoryParameter(repositoryName)));
|
| | |
| | |
|
| | | if (getRepositoryModel().showReadme) {
|
| | | String htmlText = null;
|
| | | String markdownText = null;
|
| | | String readme = null;
|
| | | try {
|
| | | RevCommit head = JGitUtils.getCommit(r, null);
|
| | |
| | | }
|
| | | }
|
| | | if (!StringUtils.isEmpty(readme)) {
|
| | | String markdownText = JGitUtils.getStringContent(r, head.getTree(), readme);
|
| | | String [] encodings = GitBlit.getEncodings();
|
| | | markdownText = JGitUtils.getStringContent(r, head.getTree(), readme, encodings);
|
| | | htmlText = MarkdownUtils.transformMarkdown(markdownText);
|
| | | }
|
| | | } catch (ParseException p) {
|
| | | error(p.getMessage());
|
| | | markdownText = MessageFormat.format("<div class=\"alert alert-error\"><strong>{0}:</strong> {1}</div>{2}", getString("gb.error"), getString("gb.markdownFailure"), markdownText);
|
| | | htmlText = StringUtils.breakLinesForHtml(markdownText);
|
| | | }
|
| | | Fragment fragment = new Fragment("readme", "markdownPanel");
|
| | | fragment.add(new Label("readmeFile", readme));
|
| | |
| | | && 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(290, 100), ChartType.LINE,
|
| | | data);
|
| | | ChartAxis dateAxis = new ChartAxis(ChartAxisType.BOTTOM);
|
| | | dateAxis.setLabels(new String[] { metrics.get(0).name,
|