| | |
| | | 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;
|
| | | import org.apache.wicket.model.PropertyModel;
|
| | |
|
| | | import com.gitblit.Constants.AccessRestrictionType;
|
| | | import com.gitblit.Constants.AuthorizationControl;
|
| | |
| | | private final AjaxFormChoiceComponentUpdatingBehavior callback;
|
| | |
|
| | | private RadioGroup<AccessPolicy> policiesGroup;
|
| | |
|
| | | private IModel<Boolean> allowForks;
|
| | |
|
| | | public AccessPolicyPanel(String wicketId, RepositoryModel repository) {
|
| | | this(wicketId, repository, null);
|
| | |
| | | }
|
| | | add(policiesGroup);
|
| | |
|
| | | allowForks = Model.of(app().settings().getBoolean(Keys.web.allowForking, true));
|
| | | if (allowForks.getObject()) {
|
| | | if (app().settings().getBoolean(Keys.web.allowForking, true)) {
|
| | | Fragment fragment = new Fragment("allowForks", "allowForksFragment", this);
|
| | | fragment.add(new CheckboxOption("allowForks",
|
| | | fragment.add(new BooleanOption("allowForks",
|
| | | getString("gb.allowForks"),
|
| | | getString("gb.allowForksDescription"),
|
| | | allowForks));
|
| | | new PropertyModel<Boolean>(repository, "allowForks")));
|
| | | add(fragment);
|
| | | } else {
|
| | | add(new Label("allowForks").setVisible(false));
|
| | |
| | | AccessPolicy policy = policiesGroup.getModelObject();
|
| | | repository.authorizationControl = policy.control;
|
| | | repository.accessRestriction = policy.type;
|
| | | repository.allowForks = allowForks.getObject();
|
| | | }
|
| | |
|
| | | @Override
|