| | |
| | | import java.util.Map;
|
| | |
|
| | | import org.apache.wicket.Component;
|
| | | import org.apache.wicket.markup.html.WebPage;
|
| | | import org.apache.wicket.markup.html.basic.Label;
|
| | | import org.apache.wicket.markup.html.panel.Panel;
|
| | | import org.apache.wicket.markup.repeater.Item;
|
| | |
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.pages.CommitPage;
|
| | | import com.gitblit.wicket.pages.LogPage;
|
| | | import com.gitblit.wicket.pages.RepositoryPage;
|
| | | import com.gitblit.wicket.pages.TagPage;
|
| | |
|
| | | public class RefsPanel extends Panel {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | private static final String R_CHANGES = "refs/changes/";
|
| | | |
| | | private static final String R_PULL= "refs/pull/";
|
| | |
|
| | | public RefsPanel(String id, final String repositoryName, RevCommit c,
|
| | | Map<ObjectId, List<RefModel>> refs) {
|
| | |
| | | String name = entry.displayName;
|
| | | String objectid = entry.getReferencedObjectId().getName();
|
| | | boolean breakLine = false;
|
| | | Class<? extends RepositoryPage> linkClass = CommitPage.class;
|
| | | Class<? extends WebPage> linkClass = CommitPage.class;
|
| | | String cssClass = "";
|
| | | if (name.startsWith(Constants.R_HEADS)) {
|
| | | // local branch
|
| | |
| | | // local head
|
| | | linkClass = LogPage.class;
|
| | | cssClass = "headRef";
|
| | | } else if (name.startsWith(R_CHANGES)) {
|
| | | // Gerrit change ref
|
| | | name = name.substring(R_CHANGES.length());
|
| | | cssClass = "otherRef";
|
| | | } else if (name.startsWith(R_PULL)) {
|
| | | // Pull Request ref
|
| | | name = "pull #" + name.substring(R_PULL.length());
|
| | | if (name.endsWith("/head")) {
|
| | | // strip pull request head from name |
| | | name = name.substring(0, name.length() - "/head".length());
|
| | | }
|
| | | cssClass = "pullRef";
|
| | | } else if (name.startsWith(Constants.R_REMOTES)) {
|
| | | // remote branch
|
| | | linkClass = LogPage.class;
|