form.add(teamsPalette);
//
// TICKETS
//
form.add(new BooleanOption("acceptNewPatchsets",
getString("gb.acceptNewPatchsets"),
getString("gb.acceptNewPatchsetsDescription"),
new PropertyModel<Boolean>(repositoryModel, "acceptNewPatchsets")));
form.add(new BooleanOption("acceptNewTickets",
getString("gb.acceptNewTickets"),
getString("gb.acceptNewTicketsDescription"),
new PropertyModel<Boolean>(repositoryModel, "acceptNewPatchsets")));
form.add(new BooleanOption("requireApproval",
getString("gb.requireApproval"),
getString("gb.requireApprovalDescription"),
new PropertyModel<Boolean>(repositoryModel, "requireApproval")));
form.add(new ChoiceOption<String>("mergeTo",
getString("gb.mergeTo"),
getString("gb.mergeToDescription"),
new PropertyModel<String>(repositoryModel, "mergeTo"),
availableBranches));
//
// RECEIVE
//
form.add(new BooleanOption("isFrozen",
getString("gb.isFrozen"),
getString("gb.isFrozenDescription"),
new PropertyModel<Boolean>(repositoryModel, "isFrozen")));
form.add(new BooleanOption("incrementalPushTags",
getString("gb.enableIncrementalPushTags"),
getString("gb.useIncrementalPushTagsDescription"),
new PropertyModel<Boolean>(repositoryModel, "useIncrementalPushTags")));
final CheckBox verifyCommitter = new CheckBox("checkbox", new PropertyModel<Boolean>(repositoryModel, "verifyCommitter"));
verifyCommitter.setOutputMarkupId(true);
form.add(new BooleanOption("verifyCommitter",
getString("gb.verifyCommitter"),
getString("gb.verifyCommitterDescription") + "<br/>" + getString("gb.verifyCommitterNote"),
verifyCommitter).setIsHtmlDescription(true));
form.add(preReceivePalette);
form.add(new BulletListPanel("inheritedPreReceive", getString("gb.inherited"), app().repositories()
.getPreReceiveScriptsInherited(repositoryModel)));
form.add(postReceivePalette);
form.add(new BulletListPanel("inheritedPostReceive", getString("gb.inherited"), app().repositories()
.getPostReceiveScriptsInherited(repositoryModel)));
WebMarkupContainer customFieldsSection = new WebMarkupContainer("customFieldsSection");
customFieldsSection.add(customFieldsListView);
form.add(customFieldsSection.setVisible(!app().settings().getString(Keys.groovy.customFields, "").isEmpty()));
//
// FEDERATION
//
List<FederationStrategy> federationStrategies = new ArrayList<FederationStrategy>(
Arrays.asList(FederationStrategy.values()));
// federation strategies - remove ORIGIN choice if this repository has no origin.
if (StringUtils.isEmpty(repositoryModel.origin)) {
federationStrategies.remove(FederationStrategy.FEDERATE_ORIGIN);
}
form.add(new ChoiceOption<FederationStrategy>("federationStrategy",
getString("gb.federationStrategy"),
getString("gb.federationStrategyDescription"),
new DropDownChoice<FederationStrategy>(
"choice",
new PropertyModel<FederationStrategy>(repositoryModel, "federationStrategy"),
federationStrategies,
new FederationTypeRenderer())));
form.add(federationSetsPalette);
//
// SEARCH
//
form.add(indexedBranchesPalette);
//
// GARBAGE COLLECTION
//
boolean gcEnabled = app().settings().getBoolean(Keys.git.enableGarbageCollection, false);
int defaultGcPeriod = app().settings().getInteger(Keys.git.defaultGarbageCollectionPeriod, 7);
if (repositoryModel.gcPeriod == 0) {
repositoryModel.gcPeriod = defaultGcPeriod;
}
List<Integer> gcPeriods = Arrays.asList(1, 2, 3, 4, 5, 7, 10, 14 );
form.add(new ChoiceOption<Integer>("gcPeriod",
getString("gb.gcPeriod"),
getString("gb.gcPeriodDescription"),
new DropDownChoice<Integer>("choice",
new PropertyModel<Integer>(repositoryModel, "gcPeriod"),
gcPeriods,
new GCPeriodRenderer())).setEnabled(gcEnabled));
form.add(new TextOption("gcThreshold",
getString("gb.gcThreshold"),
getString("gb.gcThresholdDescription"),
"span1",
new PropertyModel<String>(repositoryModel, "gcThreshold")).setEnabled(gcEnabled));
//
// MISCELLANEOUS
//
form.add(new TextOption("origin",
getString("gb.origin"),
getString("gb.originDescription"),
"span6",
new PropertyModel<String>(repositoryModel, "origin")).setEnabled(false));
form.add(new BooleanOption("showRemoteBranches",
getString("gb.showRemoteBranches"),
getString("gb.showRemoteBranchesDescription"),
new PropertyModel<Boolean>(repositoryModel, "showRemoteBranches")));
form.add(new BooleanOption("skipSizeCalculation",
getString("gb.skipSizeCalculation"),
getString("gb.skipSizeCalculationDescription"),
new PropertyModel<Boolean>(repositoryModel, "skipSizeCalculation")));
form.add(new BooleanOption("skipSummaryMetrics",
getString("gb.skipSummaryMetrics"),
getString("gb.skipSummaryMetricsDescription"),
new PropertyModel<Boolean>(repositoryModel, "skipSummaryMetrics")));
List<Integer> maxActivityCommits = Arrays.asList(-1, 0, 25, 50, 75, 100, 150, 200, 250, 500);