| | |
| | | import com.gitblit.models.PathModel;
|
| | | import com.gitblit.models.RepositoryModel;
|
| | | import com.gitblit.models.UserModel;
|
| | | import com.gitblit.utils.ArrayUtils;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.MarkdownUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.wicket.GitBlitWebSession;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.panels.BranchesPanel;
|
| | | import com.gitblit.wicket.panels.DetailedRepositoryUrlPanel;
|
| | | import com.gitblit.wicket.panels.LinkPanel;
|
| | | import com.gitblit.wicket.panels.LogPanel;
|
| | | import com.gitblit.wicket.panels.RepositoryUrlPanel;
|
| | |
| | | int numberRefs = GitBlit.getInteger(Keys.web.summaryRefsCount, 5);
|
| | |
|
| | | Repository r = getRepository();
|
| | | RepositoryModel model = getRepositoryModel();
|
| | | final RepositoryModel model = getRepositoryModel();
|
| | | UserModel user = GitBlitWebSession.get().getUser();
|
| | | if (user == null) {
|
| | | user = UserModel.ANONYMOUS;
|
| | | }
|
| | |
|
| | | List<Metric> metrics = null;
|
| | | Metric metricsTotal = null;
|
| | |
| | | add(new BookmarkablePageLink<Void>("metrics", MetricsPage.class,
|
| | | WicketUtils.newRepositoryParameter(repositoryName)));
|
| | |
|
| | | List<String> repositoryUrls = new ArrayList<String>();
|
| | |
|
| | | if (GitBlit.getBoolean(Keys.git.enableGitServlet, true)) {
|
| | | if (GitBlit.getBoolean(Keys.git.enableGitServlet, true)) { |
| | | AccessRestrictionType accessRestriction = getRepositoryModel().accessRestriction;
|
| | | switch (accessRestriction) {
|
| | | case NONE:
|
| | |
| | | default:
|
| | | add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
|
| | | }
|
| | | // add the Gitblit repository url
|
| | | repositoryUrls.add(getRepositoryUrl(getRepositoryModel()));
|
| | | } else {
|
| | | add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
|
| | | }
|
| | | repositoryUrls.addAll(GitBlit.self().getOtherCloneUrls(repositoryName));
|
| | |
|
| | | String primaryUrl = ArrayUtils.isEmpty(repositoryUrls) ? "" : repositoryUrls.remove(0);
|
| | | add(new RepositoryUrlPanel("repositoryCloneUrl", primaryUrl));
|
| | | add(new RepositoryUrlPanel("repositoryUrlPanel", false, user, model, getLocalizer(), this));
|
| | | |
| | | List<String> otherUrls = GitBlit.self().getOtherCloneUrls(repositoryName, UserModel.ANONYMOUS.equals(user) ? "" : user.username);
|
| | | ListDataProvider<String> urls = new ListDataProvider<String>(otherUrls);
|
| | | DataView<String> otherUrlsView = new DataView<String>("otherUrls", urls) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | add(new Label("otherUrls", StringUtils.flattenStrings(repositoryUrls, "<br/>"))
|
| | | .setEscapeModelStrings(false));
|
| | | public void populateItem(final Item<String> item) {
|
| | | final String url = item.getModelObject();
|
| | | item.add(new DetailedRepositoryUrlPanel("otherUrl", getLocalizer(), this, model.name, url));
|
| | | }
|
| | | };
|
| | | add(otherUrlsView);
|
| | |
|
| | | add(new LogPanel("commitsPanel", repositoryName, getRepositoryModel().HEAD, r, numberCommits, 0, getRepositoryModel().showRemoteBranches));
|
| | | add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty());
|