summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-04-23 17:39:02 -0400
committerJames Moger <james.moger@gitblit.com>2013-04-23 17:39:02 -0400
commit342a0566918d561b382b31ddd8a9696f363ca5e3 (patch)
treeeee6cd594c910765f838319994e8d55c3074d5ec
parentea2c2a00f68a784761e8b68cd91a87693c37a0a7 (diff)
downloadgitblit-342a0566918d561b382b31ddd8a9696f363ca5e3.tar.gz
gitblit-342a0566918d561b382b31ddd8a9696f363ca5e3.zip
Improve Gerrit change ref rendering (issue-206)
-rw-r--r--releases.moxie1
-rw-r--r--src/main/java/com/gitblit/client/BranchRenderer.java5
-rw-r--r--src/main/java/com/gitblit/wicket/panels/RefsPanel.java6
3 files changed, 12 insertions, 0 deletions
diff --git a/releases.moxie b/releases.moxie
index 5aedcacc..c0654353 100644
--- a/releases.moxie
+++ b/releases.moxie
@@ -26,6 +26,7 @@ r17: {
- Use standard ServletRequestWrapper instead of custom wrapper (issue 224)
changes:
+ - Improve Gerrit change ref decoration in the refs panel (issue 206)
- Disable Gson's pretty printing which has a huge performance gain
- Properly set application/json content-type on api calls
- Updated Polish translation
diff --git a/src/main/java/com/gitblit/client/BranchRenderer.java b/src/main/java/com/gitblit/client/BranchRenderer.java
index 9a303c38..5f12c42c 100644
--- a/src/main/java/com/gitblit/client/BranchRenderer.java
+++ b/src/main/java/com/gitblit/client/BranchRenderer.java
@@ -37,6 +37,8 @@ public class BranchRenderer extends DefaultTableCellRenderer implements ListCell
private static final String R_HEADS = "refs/heads/";
private static final String R_REMOTES = "refs/remotes/";
+
+ private static final String R_CHANGES = "refs/changes/";
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
@@ -71,6 +73,9 @@ public class BranchRenderer extends DefaultTableCellRenderer implements ListCell
} else if (name.startsWith(R_REMOTES)) {
name = name.substring(R_REMOTES.length());
fg = Color.decode("#6C6CBF");
+ } else if (name.startsWith(R_CHANGES)) {
+ name = name.substring(R_CHANGES.length());
+ fg = Color.decode("#B0E0F0");
}
setForeground(fg);
super.setText(name);
diff --git a/src/main/java/com/gitblit/wicket/panels/RefsPanel.java b/src/main/java/com/gitblit/wicket/panels/RefsPanel.java
index 3ba22c0b..c3807ac2 100644
--- a/src/main/java/com/gitblit/wicket/panels/RefsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/RefsPanel.java
@@ -41,6 +41,8 @@ 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/";
public RefsPanel(String id, final String repositoryName, RevCommit c,
Map<ObjectId, List<RefModel>> refs) {
@@ -108,6 +110,10 @@ public class RefsPanel extends Panel {
// 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(Constants.R_REMOTES)) {
// remote branch
linkClass = LogPage.class;