Merge "Add gitweb.linkDrafts to control if gitweb links are shown on drafts"
This commit is contained in:
@@ -35,6 +35,16 @@ public class GitwebLink {
|
||||
type = link.type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can we link to a patch set if it's a draft
|
||||
*
|
||||
* @param ps Patch set to check draft status
|
||||
* @return true if it's not a draft, or we can link to drafts
|
||||
*/
|
||||
public boolean canLink(final PatchSet ps) {
|
||||
return !ps.isDraft() || type.getLinkDrafts();
|
||||
}
|
||||
|
||||
public String getLinkName() {
|
||||
return "(" + type.getLinkName() + ")";
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class PatchSetComplexDisclosurePanel extends ComplexDisclosurePanel
|
||||
final InlineLabel revtxt = new InlineLabel(ps.getRevision().get() + " ");
|
||||
revtxt.addStyleName(Gerrit.RESOURCES.css().patchSetRevision());
|
||||
getHeader().add(revtxt);
|
||||
if (gw != null) {
|
||||
if (gw != null && gw.canLink(ps)) {
|
||||
final Anchor revlink =
|
||||
new Anchor(gw.getLinkName(), false, gw.toRevision(changeDetail.getChange()
|
||||
.getProject(), ps));
|
||||
|
||||
Reference in New Issue
Block a user