| | |
| | | import com.gitblit.models.UserRepositoryPreferences;
|
| | | import com.gitblit.servlet.PagesServlet;
|
| | | import com.gitblit.servlet.SyndicationServlet;
|
| | | import com.gitblit.tickets.TicketIndexer.Lucene;
|
| | | import com.gitblit.utils.ArrayUtils;
|
| | | import com.gitblit.utils.DeepCopier;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | |
| | | public RepositoryPage(PageParameters params) {
|
| | | super(params);
|
| | | repositoryName = WicketUtils.getRepositoryName(params);
|
| | | String root =StringUtils.getFirstPathElement(repositoryName);
|
| | | String root = StringUtils.getFirstPathElement(repositoryName);
|
| | | if (StringUtils.isEmpty(root)) {
|
| | | projectName = app().settings().getString(Keys.web.repositoryRootGroupName, "main");
|
| | | } else {
|
| | |
| | | }
|
| | | pages.put("commits", new PageRegistration("gb.commits", LogPage.class, params));
|
| | | pages.put("tree", new PageRegistration("gb.tree", TreePage.class, params));
|
| | | if (app().tickets().isReady() && (app().tickets().isAcceptingNewTickets(getRepositoryModel()) || app().tickets().hasTickets(getRepositoryModel()))) {
|
| | | PageParameters tParams = new PageParameters(params);
|
| | | for (String state : TicketsPage.openStatii) {
|
| | | tParams.add(Lucene.status.name(), state);
|
| | | }
|
| | | pages.put("tickets", new PageRegistration("gb.tickets", TicketsPage.class, tParams)); |
| | | } |
| | | pages.put("docs", new PageRegistration("gb.docs", DocsPage.class, params, true));
|
| | | pages.put("compare", new PageRegistration("gb.compare", ComparePage.class, params, true));
|
| | | if (app().settings().getBoolean(Keys.web.allowForking, true)) {
|
| | | pages.put("forks", new PageRegistration("gb.forks", ForksPage.class, params, true));
|
| | | }
|
| | | pages.put("compare", new PageRegistration("gb.compare", ComparePage.class, params, true)); |
| | |
|
| | | // conditional links
|
| | | // per-repository extra page links
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // new ticket button
|
| | | if (user.isAuthenticated && app().tickets().isAcceptingNewTickets(getRepositoryModel())) {
|
| | | String newTicketUrl = getRequestCycle().urlFor(NewTicketPage.class, WicketUtils.newRepositoryParameter(repositoryName)).toString();
|
| | | addToolbarButton("newTicketLink", "fa fa-ticket", getString("gb.new"), newTicketUrl);
|
| | | } else {
|
| | | add(new Label("newTicketLink").setVisible(false));
|
| | | }
|
| | |
|
| | | // (un)star link allows a user to star a repository
|
| | | if (user.isAuthenticated) {
|
| | | PageParameters starParams = DeepCopier.copy(getPageParameters());
|