浏览代码

Hide allow forks control if forking is disabled

tags/v1.6.0
James Moger 10 年前
父节点
当前提交
2d291de884

+ 4
- 1
src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.html 查看文件

</div> </div>
</div> </div>
<div wicket:id="allowForks"></div>
<wicket:fragment wicket:id="allowForksFragment">
<hr /> <hr />
<div wicket:id="allowForks"></div> <div wicket:id="allowForks"></div>
</wicket:fragment>
</wicket:panel> </wicket:panel>
</body> </body>
</html> </html>

+ 10
- 3
src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java 查看文件

import org.apache.wicket.markup.html.form.RadioGroup; import org.apache.wicket.markup.html.form.RadioGroup;
import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView; 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.IModel;
import org.apache.wicket.model.Model; import org.apache.wicket.model.Model;
} }
add(policiesGroup); 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.allowForks"),
getString("gb.allowForksDescription"), getString("gb.allowForksDescription"),
allowForks).setEnabled(app().settings().getBoolean(Keys.web.allowForking, true)));
allowForks));
add(fragment);
} else {
add(new Label("allowForks").setVisible(false));
}
setOutputMarkupId(true); setOutputMarkupId(true);
} }

正在加载...
取消
保存