*/\r
package com.gitblit.wicket.panels;\r
\r
+import java.text.MessageFormat;\r
import java.util.ArrayList;\r
import java.util.Collections;\r
import java.util.Comparator;\r
\r
import com.gitblit.Constants;\r
import com.gitblit.models.RefModel;\r
+import com.gitblit.utils.StringUtils;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.pages.CommitPage;\r
import com.gitblit.wicket.pages.LogPage;\r
boolean breakLine = false;\r
Class<? extends WebPage> linkClass = CommitPage.class;\r
String cssClass = "";\r
+ String tooltip = "";\r
if (name.startsWith(Constants.R_HEADS)) {\r
// local branch\r
linkClass = LogPage.class;\r
} else if (name.startsWith(Constants.R_CHANGES)) {\r
// Gerrit change ref\r
name = name.substring(Constants.R_CHANGES.length());\r
+ // strip leading nn/ from nn/#####nn/ps = #####nn-ps\r
+ name = name.substring(name.indexOf('/') + 1).replace('/', '-');\r
+ String [] values = name.split("-");\r
+ tooltip = MessageFormat.format(getString("gb.reviewPatchset"), values[0], values[1]);\r
cssClass = "otherRef";\r
} else if (name.startsWith(Constants.R_PULL)) {\r
// Pull Request ref\r
Component c = new LinkPanel("refName", null, name, linkClass,\r
WicketUtils.newObjectParameter(repositoryName, objectid));\r
WicketUtils.setCssClass(c, cssClass);\r
- WicketUtils.setHtmlTooltip(c, name);\r
+ if (StringUtils.isEmpty(tooltip)) {\r
+ WicketUtils.setHtmlTooltip(c, name);\r
+ } else {\r
+ WicketUtils.setHtmlTooltip(c, tooltip);\r
+ }\r
item.add(c);\r
Label lb = new Label("lineBreak", "<br/>");\r
lb.setVisible(breakLine);\r