Added placeholder for Admin links on main page.
Added placeholder for Admin links on main page.
Dynamically add ticgit link to nav links, if ticgit branch is
discovered.
Settings refinements.
2 files added
12 files modified
| | |
| | | #
|
| | | # GIT Servlet Settings
|
| | | # Git Servlet Settings
|
| | | #
|
| | |
|
| | | # Allow push/pull over http/https with JGit servlet
|
| | | allowPushPull = true
|
| | |
|
| | | # Base folder for repositories
|
| | | # Use forward slashes on Windows!!
|
| | |
| | | # Authentication Settings
|
| | | #
|
| | |
|
| | | # Require authentication for http push/pull of git repositories
|
| | | authenticateAccess = true
|
| | | # Require authentication for http/https push/pull access of git repositories
|
| | | authenticatePushPull = true
|
| | |
|
| | | # Simple user realm file to authenticate users for push/pull
|
| | | realmFile = users.properties
|
| | |
| | | debug = true
|
| | | tempFolder = temp
|
| | | log4jPattern = %-5p %d{MM-dd HH:mm:ss.SSS} %-20.20c{1} %m%n
|
| | | # Aggressive garbage collection will run the collector on every generated page
|
| | | # this slows down page generation but improves heap consumption |
| | | aggressiveGC = true
|
| | | # Aggressive heap management will run the garbage collector on every generated
|
| | | # page. This slows down page generation but improves heap consumption. |
| | | aggressiveHeapManagement = true
|
| | |
|
| | | #
|
| | | # Git:Blit UI Settings
|
| | | #
|
| | | siteName = Repositories
|
| | | allowAdministration = true
|
| | | indexMessage = Welcome to Git:Blit!<br>A quick and easy way to host your own GIT repositories.<br>Built with <a href="http://eclipse.org/jgit">JGit</a>, <a href="http://wicket.apache.org">Wicket</a>, <a href="http://code.google.com/p/google-code-prettify/">google-code-prettify</a>, <a href="http://eclipse.org/jetty">Jetty</a>, <a href="http://www.slf4j.org">SLF4J</a>, <a href="http://logging.apache.org/log4j">Log4j</a>, and <a href="http://jcommander.org">JCommander</a>.
|
| | | repositoriesMessage = Welcome to Git:Blit!<br>A quick and easy way to host your own Git repositories.<br>Built with <a href="http://eclipse.org/jgit">JGit</a>, <a href="http://wicket.apache.org">Wicket</a>, <a href="http://code.google.com/p/google-code-prettify/">google-code-prettify</a>, <a href="http://eclipse.org/jetty">Jetty</a>, <a href="http://www.slf4j.org">SLF4J</a>, <a href="http://logging.apache.org/log4j">Log4j</a>, and <a href="http://jcommander.org">JCommander</a>.
|
| | |
|
| | | # Date and Time formats
|
| | | timestampFormat = h:mm a
|
| | |
| | | padding: 8px;
|
| | | }
|
| | |
|
| | | div.repositories_message {
|
| | | line-height: inherit;
|
| | | }
|
| | |
|
| | | div.header {
|
| | | background-color: #D2C3AF;
|
| | | padding: 3px;
|
| | |
| | | border-width: 1px 0px 1px;
|
| | | }
|
| | |
|
| | | div.bug_open {
|
| | | div.bug_open, span.bug_open {
|
| | | padding: 2px;
|
| | | background-color: #800000;
|
| | | color: white;
|
| | | text-align: center;
|
| | | }
|
| | |
|
| | | div.bug_resolved {
|
| | | div.bug_resolved, span.bug_resolved {
|
| | | padding: 2px;
|
| | | background-color: #008000;
|
| | | color: white;
|
| | | text-align: center;
|
| | | }
|
| | |
|
| | | div.bug_invalid {
|
| | | div.bug_invalid, span.bug_invalid {
|
| | | padding: 2px;
|
| | | background-color: gray;
|
| | | text-align: center;
|
| | | }
|
| | |
|
| | | div.bug_hold {
|
| | | div.bug_hold, span.bug_hold {
|
| | | padding: 2px;
|
| | | background-color: orange;
|
| | | text-align: center;
|
| | |
| | | }
|
| | |
|
| | | table.repositories th {
|
| | | background-color:#000070;
|
| | | background-color:#D2C3AF;
|
| | | padding: 4px;
|
| | | border-bottom: 1px solid #bbb;
|
| | | border-bottom: 1px solid #808080;
|
| | | }
|
| | |
|
| | | table.repositories td {
|
| | |
| | | }
|
| | |
|
| | | table.repositories th a {
|
| | | color:#ddd;
|
| | | color:black;/*#ddd;*/
|
| | | text-decoration: none;
|
| | | font-weight: normal;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | table.repositories th.wicket_orderDown a, table.repositories th.wicket_orderUp a {
|
| | | color: yellow;
|
| | | color: black;
|
| | | font-weight: bold;
|
| | | }
|
| | |
|
| | | tr th a { padding-right: 15px; background-position: right; background-repeat:no-repeat; }
|
| | |
| | | import org.eclipse.jetty.webapp.WebAppContext;
|
| | | import org.eclipse.jgit.http.server.GitServlet;
|
| | |
|
| | |
|
| | | import com.beust.jcommander.JCommander;
|
| | | import com.beust.jcommander.Parameter;
|
| | | import com.beust.jcommander.ParameterException;
|
| | |
| | | Connector httpConnector = createConnector(params.useNIO, params.port);
|
| | | connectors.add(httpConnector);
|
| | | }
|
| | | |
| | |
|
| | | if (params.securePort > 0) {
|
| | | if (new File("keystore").exists()) {
|
| | | Connector secureConnector = createSSLConnector(params.useNIO, params.securePort, params.storePassword);
|
| | |
| | | wicketFilter.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, wicketPathSpec);
|
| | | rootContext.addFilter(wicketFilter, wicketPathSpec, FilterMapping.DEFAULT);
|
| | |
|
| | | // GIT Servlet
|
| | | String gitServletPathSpec = "/git/*";
|
| | | ServletHolder gitServlet = rootContext.addServlet(GitServlet.class, gitServletPathSpec);
|
| | | gitServlet.setInitParameter("base-path", params.repositoriesFolder);
|
| | | gitServlet.setInitParameter("export-all", params.exportAll ? "1" : "0");
|
| | |
|
| | | String realmUsers = params.realmFile;
|
| | |
|
| | | // Authentication Realm
|
| | | Handler handler;
|
| | | if (realmUsers != null && new File(realmUsers).exists() && params.authenticateAccess) {
|
| | | List<String> list = StoredSettings.getStrings("gitRoles");
|
| | | String[] roles;
|
| | | if (list.size() == 0) {
|
| | | roles = new String[] { "*" };
|
| | |
|
| | | // Git Servlet
|
| | | ServletHolder gitServlet = null;
|
| | | String gitServletPathSpec = "/git/*";
|
| | | if (StoredSettings.getBoolean("allowPushPull", true)) {
|
| | | gitServlet = rootContext.addServlet(GitServlet.class, gitServletPathSpec);
|
| | | gitServlet.setInitParameter("base-path", params.repositoriesFolder);
|
| | | gitServlet.setInitParameter("export-all", params.exportAll ? "1" : "0");
|
| | | String realmUsers = params.realmFile;
|
| | |
|
| | | if (realmUsers != null && new File(realmUsers).exists() && params.authenticatePushPull) {
|
| | | // Authenticate Pull/Push
|
| | | List<String> list = StoredSettings.getStrings("gitRoles");
|
| | | String[] roles;
|
| | | if (list.size() == 0) {
|
| | | roles = new String[] { "*" };
|
| | | } else {
|
| | | roles = list.toArray(new String[list.size()]);
|
| | | }
|
| | | logger.info("Authentication required for git servlet pull/push access");
|
| | | logger.info("Setting up realm from " + realmUsers);
|
| | | HashLoginService loginService = new HashLoginService(Constants.NAME, realmUsers);
|
| | |
|
| | | Constraint constraint = new Constraint();
|
| | | constraint.setName("auth");
|
| | | constraint.setAuthenticate(true);
|
| | | constraint.setRoles(roles);
|
| | |
|
| | | ConstraintMapping mapping = new ConstraintMapping();
|
| | | mapping.setPathSpec(gitServletPathSpec);
|
| | | mapping.setConstraint(constraint);
|
| | |
|
| | | ConstraintSecurityHandler security = new ConstraintSecurityHandler();
|
| | | security.addConstraintMapping(mapping);
|
| | | for (String role : roles) {
|
| | | security.addRole(role);
|
| | | }
|
| | | security.setAuthenticator(new BasicAuthenticator());
|
| | | security.setLoginService(loginService);
|
| | | security.setStrict(false);
|
| | |
|
| | | security.setHandler(rootContext);
|
| | |
|
| | | handler = security;
|
| | | } else {
|
| | | roles = list.toArray(new String[list.size()]);
|
| | | // Anonymous Pull/Push
|
| | | logger.info("Setting up anonymous git servlet pull/push access");
|
| | | handler = rootContext;
|
| | | }
|
| | | logger.info("Authentication required for GIT access");
|
| | | logger.info("Setting up realm from " + realmUsers);
|
| | | HashLoginService loginService = new HashLoginService(Constants.NAME, realmUsers);
|
| | |
|
| | | Constraint constraint = new Constraint();
|
| | | constraint.setName("auth");
|
| | | constraint.setAuthenticate(true);
|
| | | constraint.setRoles(roles);
|
| | |
|
| | | ConstraintMapping mapping = new ConstraintMapping();
|
| | | mapping.setPathSpec(gitServletPathSpec);
|
| | | mapping.setConstraint(constraint);
|
| | |
|
| | | ConstraintSecurityHandler security = new ConstraintSecurityHandler();
|
| | | security.addConstraintMapping(mapping);
|
| | | for (String role : roles) {
|
| | | security.addRole(role);
|
| | | }
|
| | | security.setAuthenticator(new BasicAuthenticator());
|
| | | security.setLoginService(loginService);
|
| | | security.setStrict(false);
|
| | |
|
| | | security.setHandler(rootContext);
|
| | |
|
| | | handler = security;
|
| | | } else {
|
| | | logger.info("Setting up anonymous access");
|
| | | logger.info("Git servlet pull/push disabled");
|
| | | handler = rootContext;
|
| | | }
|
| | |
|
| | |
| | | /*
|
| | | * GIT Servlet Parameters
|
| | | */
|
| | | @Parameter(names = { "--repos" }, description = "GIT Repositories Folder")
|
| | | @Parameter(names = { "--repos" }, description = "Git Repositories Folder")
|
| | | public String repositoriesFolder = StoredSettings.getString("repositoriesFolder", "repos");
|
| | |
|
| | | @Parameter(names = { "--exportAll" }, description = "Export All Found Repositories")
|
| | |
| | | /*
|
| | | * Authentication Parameters
|
| | | */
|
| | | @Parameter(names = { "--authenticateAccess" }, description = "Authenticate GIT access")
|
| | | public Boolean authenticateAccess = StoredSettings.getBoolean("authenticateAccess", true);
|
| | | @Parameter(names = { "--authenticatePushPull" }, description = "Authenticate Git Push/Pull access")
|
| | | public Boolean authenticatePushPull = StoredSettings.getBoolean("authenticatePushPull", true);
|
| | |
|
| | | @Parameter(names = { "--realm" }, description = "Users Realm Hash File")
|
| | | public String realmFile = StoredSettings.getString("realmFile", "users.properties");
|
| | |
| | | import com.gitblit.wicket.panels.PageLinksPanel;
|
| | | import com.gitblit.wicket.panels.RefsPanel;
|
| | |
|
| | |
|
| | | public abstract class RepositoryPage extends BasePage {
|
| | |
|
| | | protected final String repositoryName;
|
| | | protected final String commitId;
|
| | | protected String description;
|
| | |
|
| | | private transient Repository r = null;
|
| | |
|
| | | public RepositoryPage(PageParameters params, String pageName) {
|
| | | super(params);
|
| | |
| | | repositoryName = params.getString("p", "");
|
| | | commitId = params.getString("h", "");
|
| | |
|
| | | Repository r = getRepository();
|
| | |
|
| | | add(new PageHeader("pageHeader", repositoryName, "/ " + pageName));
|
| | | add(new PageLinksPanel("pageLinks", repositoryName, pageName));
|
| | | add(new PageLinksPanel("pageLinks", r, repositoryName, pageName));
|
| | | setStatelessHint(true);
|
| | | }
|
| | |
|
| | | protected Repository getRepository() {
|
| | | ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest();
|
| | | HttpServletRequest req = servletWebRequest.getHttpServletRequest();
|
| | | req.getServerName();
|
| | |
|
| | | Repository r = GitBlitWebApp.get().getRepository(req, repositoryName);
|
| | | if (r == null) {
|
| | | error("Can not load repository " + repositoryName);
|
| | | redirectToInterceptPage(new RepositoriesPage());
|
| | | return null;
|
| | | ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest();
|
| | | HttpServletRequest req = servletWebRequest.getHttpServletRequest();
|
| | | req.getServerName();
|
| | |
|
| | | Repository r = GitBlitWebApp.get().getRepository(req, repositoryName);
|
| | | if (r == null) {
|
| | | error("Can not load repository " + repositoryName);
|
| | | redirectToInterceptPage(new RepositoriesPage());
|
| | | return null;
|
| | | }
|
| | | description = JGitUtils.getRepositoryDescription(r);
|
| | | this.r = r;
|
| | | }
|
| | | description = JGitUtils.getRepositoryDescription(r);
|
| | | return r;
|
| | | }
|
| | |
|
| | |
| | | String html = WicketUtils.breakLines(text);
|
| | | if (substituteRegex) {
|
| | | Map<String, String> map = new HashMap<String, String>();
|
| | | // global regex keys |
| | | // global regex keys
|
| | | for (String key : StoredSettings.getAllKeys("regex.global")) {
|
| | | String subKey = key.substring(key.lastIndexOf('.') + 1);
|
| | | map.put(subKey, StoredSettings.getString(key, ""));
|
| | | }
|
| | | |
| | |
|
| | | // repository-specific regex keys
|
| | | List<String> keys = StoredSettings.getAllKeys("regex." + repositoryName.toLowerCase());
|
| | | for (String key : keys) {
|
| | | String subKey = key.substring(key.lastIndexOf('.') + 1);
|
| | | map.put(subKey, StoredSettings.getString(key, ""));
|
| | | }
|
| | | |
| | |
|
| | | for (String key : map.keySet()) {
|
| | | String definition = map.get(key).trim();
|
| | | String [] chunks = definition.split("!!!");
|
| | | String[] chunks = definition.split("!!!");
|
| | | if (chunks.length == 2) {
|
| | | html = html.replaceAll(chunks[0], chunks[1]);
|
| | | } else {
|
| | |
| | | }
|
| | |
|
| | | protected void addFooter() {
|
| | | r.close();
|
| | | add(new PageFooter("pageFooter", description));
|
| | | }
|
| | |
|
| | | protected PageParameters newRepositoryParameter() {
|
| | | return new PageParameters("p=" + repositoryName); |
| | | return new PageParameters("p=" + repositoryName);
|
| | | }
|
| | | |
| | |
|
| | | protected PageParameters newCommitParameter() {
|
| | | return newCommitParameter(commitId);
|
| | | }
|
| | | |
| | |
|
| | | protected PageParameters newCommitParameter(String commitId) {
|
| | | if (commitId == null || commitId.trim().length() == 0) {
|
| | | return newRepositoryParameter(); |
| | | return newRepositoryParameter();
|
| | | }
|
| | | return new PageParameters("p=" + repositoryName + ",h=" + commitId);
|
| | | }
|
| | |
|
| | | protected PageParameters newPathParameter(String path) { |
| | | protected PageParameters newPathParameter(String path) {
|
| | | if (path == null || path.trim().length() == 0) {
|
| | | return newCommitParameter();
|
| | | }
|
| | | return new PageParameters("p=" + repositoryName + ",h=" + commitId + ",f=" + path);
|
| | | } |
| | | }
|
| | | }
|
| | |
| | | <link href="prettify/prettify.css" type="text/css" rel="stylesheet" />
|
| | | <script type="text/javascript" src="prettify/prettify.js"></script>
|
| | | </head>
|
| | | <body onload="prettyPrint()">
|
| | | <body>
|
| | | <!-- page header -->
|
| | | <div wicket:id="pageHeader"></div>
|
| | |
|
| | |
| | | <html xmlns="http://www.w3.org/1999/xhtml" >
|
| | | <body>
|
| | | <div wicket:id="pageHeader"></div>
|
| | | <div class="repositories_message" wicket:id="indexInclude"></div> |
| | | |
| | | <div wicket:id="adminPanel"></div>
|
| | | |
| | | <div class="repositories_message" wicket:id="repositoriesMessage"></div>
|
| | | |
| | | <table class="repositories">
|
| | | <tr>
|
| | | <th wicket:id="orderByRepository">Repository</th>
|
| | |
| | | import com.gitblit.wicket.LinkPanel;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.models.RepositoryModel;
|
| | | import com.gitblit.wicket.panels.AdminLinksPanel;
|
| | | import com.gitblit.wicket.panels.PageFooter;
|
| | | import com.gitblit.wicket.panels.PageHeader;
|
| | |
|
| | |
| | | public RepositoriesPage() {
|
| | | add(new PageHeader("pageHeader"));
|
| | |
|
| | | add(new Label("indexInclude", StoredSettings.getString("indexMessage", "")).setEscapeModelStrings(false));
|
| | | add(new AdminLinksPanel("adminPanel").setVisible(StoredSettings.getBoolean("allowAdministration", false)));
|
| | | |
| | | add(new Label("repositoriesMessage", StoredSettings.getString("repositoriesMessage", "")).setEscapeModelStrings(false));
|
| | |
|
| | | List<RepositoryModel> rows = GitBlitWebApp.get().getRepositories(getRequest());
|
| | | DataProvider dp = new DataProvider(rows);
|
| | |
| | | <table style="width:100%" class="pretty">
|
| | | <tbody>
|
| | | <tr wicket:id="ticket">
|
| | | <td style="padding:0; margin:0;" ><div wicket:id="ticketState"></div></td>
|
| | | <td style="padding:0; margin:0;"><div wicket:id="ticketState"></div></td>
|
| | | <td class="date"><span wicket:id="ticketDate"></span></td>
|
| | | <td><div wicket:id="ticketHandler"></div></td>
|
| | | <td><div wicket:id="ticketTitle"></div></td>
|
| | |
| | | public class TicGitTicketPage extends RepositoryPage {
|
| | |
|
| | | public TicGitTicketPage(PageParameters params) {
|
| | | super(params, "ticgit ticket");
|
| | | super(params, "ticket");
|
| | |
|
| | | final String ticketFolder = params.getString("f", "");
|
| | |
|
| | |
| | | add(new Label("ticketHandler", t.handler));
|
| | | String openDate = GitBlitWebSession.get().formatDateTimeLong(t.date);
|
| | | add(new Label("ticketOpenDate", openDate));
|
| | | add(new Label("ticketState", t.state));
|
| | | Label stateLabel = new Label("ticketState", t.state);
|
| | | String css = null;
|
| | | if (t.state.equals("open")) {
|
| | | css = "bug_open";
|
| | | } else if (t.state.equals("hold")) {
|
| | | css = "bug_hold";
|
| | | } else if (t.state.equals("resolved")) {
|
| | | css = "bug_resolved";
|
| | | } else if (t.state.equals("invalid")) {
|
| | | css = "bug_invalid";
|
| | | }
|
| | | if (css != null) {
|
| | | WicketUtils.setCssClass(stateLabel, css);
|
| | | }
|
| | | add(stateLabel);
|
| | | add(new Label("ticketTags", flattenStrings(t.tags)));
|
| | |
|
| | | ListDataProvider<Comment> commentsDp = new ListDataProvider<Comment>(t.comments);
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
|
| | | <wicket:panel>
|
| | | <!-- page nav links --> |
| | | <div class="page_nav">
|
| | | <span wicket:id="newRepository"></span> | <span wicket:id="newUser"></span>
|
| | | </div> |
| | | </wicket:panel>
|
| | | </html> |
New file |
| | |
| | | package com.gitblit.wicket.panels;
|
| | |
|
| | | import org.apache.wicket.markup.html.basic.Label;
|
| | | import org.apache.wicket.markup.html.panel.Panel;
|
| | |
|
| | | public class AdminLinksPanel extends Panel {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public AdminLinksPanel(String id) {
|
| | | super(id);
|
| | |
|
| | | add(new Label("newRepository", "new repository"));
|
| | | add(new Label("newUser", "new user"));
|
| | | }
|
| | | } |
| | |
| | | super(id);
|
| | | add(new Label("footerText", description));
|
| | | add(new Label("gbVersion", "v" + Constants.VERSION));
|
| | | if (StoredSettings.getBoolean("aggressiveGC", false)) {
|
| | | if (StoredSettings.getBoolean("aggressiveHeapManagement", false)) {
|
| | | System.gc();
|
| | | }
|
| | | }
|
| | |
| | | <wicket:panel>
|
| | | <!-- page nav links -->
|
| | | <div class="page_nav">
|
| | | <span wicket:id="summary"></span> | <span wicket:id="shortlog"></span> | <span wicket:id="branches"></span> | <span wicket:id="tags"></span> | <span wicket:id="tree"></span>
|
| | | <span wicket:id="summary"></span> | <span wicket:id="shortlog"></span> | <span wicket:id="branches"></span> | <span wicket:id="tags"></span> | <span wicket:id="tree"></span> <span wicket:id="extra"><span wicket:id="extraSeparator"></span><span wicket:id="extraLink"></span></span>
|
| | | </div>
|
| | | </wicket:panel>
|
| | | </html> |
| | |
| | | package com.gitblit.wicket.panels;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.wicket.PageParameters;
|
| | | import org.apache.wicket.markup.html.basic.Label;
|
| | | import org.apache.wicket.markup.html.panel.Panel;
|
| | | import org.apache.wicket.markup.repeater.Item;
|
| | | import org.apache.wicket.markup.repeater.data.DataView;
|
| | | import org.apache.wicket.markup.repeater.data.ListDataProvider;
|
| | | import org.eclipse.jgit.lib.Repository;
|
| | |
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.wicket.LinkPanel;
|
| | | import com.gitblit.wicket.pages.BranchesPage;
|
| | | import com.gitblit.wicket.pages.CommitPage;
|
| | | import com.gitblit.wicket.pages.ShortLogPage;
|
| | | import com.gitblit.wicket.pages.SummaryPage;
|
| | | import com.gitblit.wicket.pages.TagsPage;
|
| | | import com.gitblit.wicket.pages.TicGitPage;
|
| | | import com.gitblit.wicket.pages.TreePage;
|
| | |
|
| | |
|
| | | public class PageLinksPanel extends Panel {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public PageLinksPanel(String id, String repositoryName, String pageName) {
|
| | | public PageLinksPanel(String id, Repository r, final String repositoryName, String pageName) {
|
| | | super(id);
|
| | |
|
| | | // summary
|
| | | if (pageName.equals("summary")) {
|
| | | add(new Label("summary", pageName));
|
| | |
| | | } else {
|
| | | add(new LinkPanel("shortlog", null, "shortlog", ShortLogPage.class, new PageParameters("p=" + repositoryName)));
|
| | | }
|
| | | |
| | |
|
| | | // branches
|
| | | if (pageName.equals("branches")) {
|
| | | add(new Label("branches", pageName));
|
| | | } else {
|
| | | add(new LinkPanel("branches", null, "branches", BranchesPage.class, new PageParameters("p=" + repositoryName)));
|
| | | }
|
| | | |
| | |
|
| | | // tags
|
| | | if (pageName.equals("tags")) {
|
| | | add(new Label("tags", pageName));
|
| | | } else {
|
| | | add(new LinkPanel("tags", null, "tags", TagsPage.class, new PageParameters("p=" + repositoryName)));
|
| | | }
|
| | | |
| | |
|
| | | // tree
|
| | | if (pageName.equals("tree")) {
|
| | | add(new Label("tree", pageName));
|
| | | } else {
|
| | | add(new LinkPanel("tree", null, "tree", TreePage.class, new PageParameters("p=" + repositoryName + ",h=HEAD")));
|
| | | } |
| | | }
|
| | |
|
| | | // Add dynamic repository extras
|
| | | List<String> extras = new ArrayList<String>();
|
| | | if (JGitUtils.getTicGitBranch(r) != null) {
|
| | | extras.add("ticgit");
|
| | | }
|
| | |
|
| | | ListDataProvider<String> extrasDp = new ListDataProvider<String>(extras);
|
| | | DataView<String> extrasView = new DataView<String>("extra", extrasDp) {
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public void populateItem(final Item<String> item) {
|
| | | String extra = item.getModelObject();
|
| | | if (extra.equals("ticgit")) {
|
| | | item.add(new Label("extraSeparator", " | "));
|
| | | item.add(new LinkPanel("extraLink", null, "ticgit", TicGitPage.class, new PageParameters("p=" + repositoryName)));
|
| | | }
|
| | | }
|
| | | };
|
| | | add(extrasView);
|
| | | }
|
| | | } |