James Moger
2013-05-24 51c76e7366c2e8851f1639fbdbf2b8deb219c7fc
Added support for displaying refs/pull/n/head|merge
2 files modified
21 ■■■■ changed files
src/main/java/com/gitblit/wicket/panels/RefsPanel.java 10 ●●●●● patch | view | raw | blame | history
src/main/resources/gitblit.css 11 ●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/panels/RefsPanel.java
@@ -43,6 +43,8 @@
    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) {
@@ -114,6 +116,14 @@
                    // 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;
src/main/resources/gitblit.css
@@ -1266,7 +1266,7 @@
    font-size: 2em;
}
.tagRef, .headRef, .localBranch, .remoteBranch, .otherRef {
.tagRef, .headRef, .localBranch, .remoteBranch, .otherRef, .pullRef {
    padding: 0px 3px;
    margin-right:2px;
    font-family: sans-serif;
@@ -1276,13 +1276,13 @@
    color: black;    
}
.tagRef a, .headRef a, .localBranch a, .remoteBranch a, .otherRef a {
.tagRef a, .headRef a, .localBranch a, .remoteBranch a, .otherRef a, .pullRef a {
    font-size: 9px;
    text-decoration: none;
    color: black !important;
}
.tagRef a:hover, .headRef a:hover, .localBranch a:hover, .remoteBranch a:hover, .otherRef a:hover {
.tagRef a:hover, .headRef a:hover, .localBranch a:hover, .remoteBranch a:hover, .otherRef a:hover, .pullRef a:hover {
    color: black !important;
    text-decoration: underline;
}
@@ -1292,6 +1292,11 @@
    border-color: #80aaaa;    
}
.pullRef {
    background-color: rgb(255, 221, 136);
    border-color: rgb(136, 136, 136);
}
.remoteBranch {
    background-color: #cAc2f5;
    border-color: #6c6cbf;