From 2e141ff31dedaa6dfefc4af47eda803d8dbb3eff Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 01 Sep 2015 08:49:02 -0400
Subject: [PATCH] Fix #909: Add missing SLFJ dependencies in Manager build
---
src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java b/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java
index 4f23426..2c88024 100644
--- a/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java
@@ -25,8 +25,9 @@
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.model.IModel;
+import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.Constants.AuthorizationControl;
@@ -49,8 +50,6 @@
private final AjaxFormChoiceComponentUpdatingBehavior callback;
private RadioGroup<AccessPolicy> policiesGroup;
-
- private IModel<Boolean> allowForks;
public AccessPolicyPanel(String wicketId, RepositoryModel repository) {
this(wicketId, repository, null);
@@ -145,11 +144,16 @@
}
add(policiesGroup);
- allowForks = Model.of(true);
- add(new CheckboxOption("allowForks",
+ if (app().settings().getBoolean(Keys.web.allowForking, true)) {
+ Fragment fragment = new Fragment("allowForks", "allowForksFragment", this);
+ fragment.add(new BooleanOption("allowForks",
getString("gb.allowForks"),
getString("gb.allowForksDescription"),
- allowForks).setEnabled(app().settings().getBoolean(Keys.web.allowForking, true)));
+ new PropertyModel<Boolean>(repository, "allowForks")));
+ add(fragment);
+ } else {
+ add(new Label("allowForks").setVisible(false));
+ }
setOutputMarkupId(true);
}
@@ -158,7 +162,6 @@
AccessPolicy policy = policiesGroup.getModelObject();
repository.authorizationControl = policy.control;
repository.accessRestriction = policy.type;
- repository.allowForks = allowForks.getObject();
}
@Override
--
Gitblit v1.9.1