Merge "Allow configuring the Report Bug URL"

This commit is contained in:
Edwin Kempin
2012-08-20 00:56:38 -07:00
committed by gerrit code review
7 changed files with 40 additions and 6 deletions

View File

@@ -1110,6 +1110,13 @@ By default unset, as the HTTP daemon must be configured externally
by the system administrator, and might not even be running on the
same host as Gerrit.
[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
+
URL to direct users to when they need to report a bug about the
Gerrit service. By default this links to the upstream Gerrit
Code Review's own bug tracker but could be directed to the system
administrator's ticket queue.
[[gitweb]]Section gitweb
~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -28,6 +28,7 @@ import java.util.Set;
public class GerritConfig implements Cloneable {
protected String registerUrl;
protected String httpPasswordUrl;
protected String reportBugUrl;
protected String openIdSsoUrl;
protected List<OpenIdProviderPattern> allowedOpenIDs;
@@ -57,6 +58,14 @@ public class GerritConfig implements Cloneable {
registerUrl = u;
}
public String getReportBugUrl() {
return reportBugUrl;
}
public void setReportBugUrl(String u) {
reportBugUrl = u;
}
public String getEditFullNameUrl() {
return editFullNameUrl;
}

View File

@@ -58,8 +58,8 @@ import com.google.gwt.user.client.ui.Accessibility;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
import com.google.gwt.user.client.ui.InlineHTML;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
@@ -447,9 +447,19 @@ public class Gerrit implements EntryPoint {
vs = "dev";
}
final HTML version = new HTML(M.poweredBy(vs));
version.setStyleName(RESOURCES.css().version());
btmmenu.add(version);
FlowPanel poweredBy = new FlowPanel();
poweredBy.setStyleName(RESOURCES.css().version());
poweredBy.add(new InlineHTML(M.poweredBy(vs)));
if (getConfig().getReportBugUrl() != null) {
poweredBy.add(new InlineLabel(" | "));
Anchor a = new Anchor(
C.reportBug(),
getConfig().getReportBugUrl());
a.setTarget("_blank");
a.setStyleName("");
poweredBy.add(a);
}
btmmenu.add(poweredBy);
}
private void onModuleLoad2() {

View File

@@ -21,6 +21,7 @@ public interface GerritConstants extends Constants {
String menuSignOut();
String menuRegister();
String menuSettings();
String reportBug();
String signInDialogTitle();
String signInDialogClose();

View File

@@ -2,6 +2,7 @@ menuSignIn = Sign In
menuSignOut = Sign Out
menuRegister = Register
menuSettings = Settings
reportBug = Report Bug
signInDialogTitle = Code Review - Sign In
signInDialogClose = Close

View File

@@ -1,7 +1,6 @@
windowTitle1 = {0} Code Review
windowTitle2 = {0} | {1} Code Review
poweredBy = Powered by <a href="http://code.google.com/p/gerrit/" target="_blank">Gerrit Code Review</a> ({0}) \
| <a href="http://code.google.com/p/gerrit/issues/list" target="_blank">Report Bug</a>
poweredBy = Powered by <a href="http://code.google.com/p/gerrit/" target="_blank">Gerrit Code Review</a> ({0})
noSuchAccountMessage = {0} is not a registered user.

View File

@@ -121,6 +121,13 @@ class GerritConfigProvider implements Provider<GerritConfig> {
"test", false));
config.setAnonymousCowardName(anonymousCowardName);
config.setReportBugUrl(cfg.getString("gerrit", null, "reportBugUrl"));
if (config.getReportBugUrl() == null) {
config.setReportBugUrl("http://code.google.com/p/gerrit/issues/list");
} else if (config.getReportBugUrl().isEmpty()) {
config.setReportBugUrl(null);
}
final Set<Account.FieldName> fields = new HashSet<Account.FieldName>();
for (final Account.FieldName n : Account.FieldName.values()) {
if (realm.allowsEdit(n)) {