From 51c76e7366c2e8851f1639fbdbf2b8deb219c7fc Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 24 May 2013 17:38:12 -0400 Subject: Added support for displaying refs/pull/n/head|merge --- src/main/java/com/gitblit/wicket/panels/RefsPanel.java | 10 ++++++++++ src/main/resources/gitblit.css | 11 ++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/com/gitblit/wicket/panels/RefsPanel.java b/src/main/java/com/gitblit/wicket/panels/RefsPanel.java index 5776a13e..dc852e2e 100644 --- a/src/main/java/com/gitblit/wicket/panels/RefsPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/RefsPanel.java @@ -43,6 +43,8 @@ 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> refs) { @@ -114,6 +116,14 @@ public class RefsPanel extends Panel { // 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; diff --git a/src/main/resources/gitblit.css b/src/main/resources/gitblit.css index 0a1c3b0b..9ee0a737 100644 --- a/src/main/resources/gitblit.css +++ b/src/main/resources/gitblit.css @@ -1266,7 +1266,7 @@ span.metricsTitle { 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 @@ span.metricsTitle { 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 @@ span.metricsTitle { border-color: #80aaaa; } +.pullRef { + background-color: rgb(255, 221, 136); + border-color: rgb(136, 136, 136); +} + .remoteBranch { background-color: #cAc2f5; border-color: #6c6cbf; -- cgit v1.2.3