From: James Moger Date: Tue, 3 Jun 2014 14:56:26 +0000 (-0400) Subject: Hide allow forks control if forking is disabled X-Git-Tag: v1.6.0~42 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2d291de884b4bb3164fda516ebc8510f757495b7;p=gitblit.git Hide allow forks control if forking is disabled --- diff --git a/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.html b/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.html index a2d76b7e..87a02068 100644 --- a/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.html +++ b/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.html @@ -19,10 +19,13 @@ +
+ +
- +
\ No newline at end of file diff --git a/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java b/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java index 4f234263..7a812307 100644 --- a/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java @@ -25,6 +25,7 @@ import org.apache.wicket.markup.html.form.Radio; import org.apache.wicket.markup.html.form.RadioGroup; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; +import org.apache.wicket.markup.html.panel.Fragment; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; @@ -145,11 +146,17 @@ public class AccessPolicyPanel extends BasePanel { } add(policiesGroup); - allowForks = Model.of(true); - add(new CheckboxOption("allowForks", + allowForks = Model.of(app().settings().getBoolean(Keys.web.allowForking, true)); + if (allowForks.getObject()) { + Fragment fragment = new Fragment("allowForks", "allowForksFragment", this); + fragment.add(new CheckboxOption("allowForks", getString("gb.allowForks"), getString("gb.allowForksDescription"), - allowForks).setEnabled(app().settings().getBoolean(Keys.web.allowForking, true))); + allowForks)); + add(fragment); + } else { + add(new Label("allowForks").setVisible(false)); + } setOutputMarkupId(true); }