<form style="padding-top:5px;" wicket:id="editForm">\r
<div class="row">\r
<div class="span12">\r
-<div class="tabbable">\r
+<div class="tabbable tabs-left">\r
<!-- tab titles -->\r
<ul class="nav nav-tabs">\r
<li class="active"><a href="#general" data-toggle="tab"><wicket:message key="gb.general"></wicket:message></a></li>\r
- <li><a href="#permissions" data-toggle="tab"><wicket:message key="gb.accessPermissions"></wicket:message></a></li>\r
+ <li><a href="#permissions" data-toggle="tab"><wicket:message key="gb.permissions"></wicket:message></a></li>\r
+ <li><a href="#receive" data-toggle="tab"><wicket:message key="gb.receive"></wicket:message></a></li>\r
+ <li><a href="#tickets" data-toggle="tab"><wicket:message key="gb.tickets"></wicket:message></a></li>\r
<li><a href="#federation" data-toggle="tab"><wicket:message key="gb.federation"></wicket:message></a></li>\r
<li><a href="#search" data-toggle="tab"><wicket:message key="gb.search"></wicket:message></a></li>\r
- <li><a href="#hooks" data-toggle="tab"><wicket:message key="gb.hookScripts"></wicket:message></a></li>\r
+ <li><a href="#gc" data-toggle="tab"><wicket:message key="gb.gc"></wicket:message></a></li>\r
+ <li><a href="#misc" data-toggle="tab"><wicket:message key="gb.miscellaneous"></wicket:message></a></li>\r
</ul>\r
\r
<!-- tab content -->\r
\r
<!-- general tab -->\r
<div class="tab-pane active" id="general">\r
- <div wicket:id="namePanel"></div>\r
+\r
+ <div wicket:id="namePanel"></div>\r
+ \r
+ <hr/>\r
+ \r
+ <div wicket:id="accessPolicyPanel"></div>\r
\r
- <table class="plain">\r
- <tbody class="settings">\r
- <tr><th colspan="2"><hr/></th></tr>\r
- <tr><th><wicket:message key="gb.origin"></wicket:message></th><td class="edit"><input class="span5" type="text" wicket:id="origin" size="80" tabindex="3" /></td></tr>\r
- <tr><th><wicket:message key="gb.headRef"></wicket:message></th><td class="edit"><select class="span3" wicket:id="HEAD" tabindex="4" /> <span class="help-inline"><wicket:message key="gb.headRefDescription"></wicket:message></span></td></tr>\r
- <tr><th><wicket:message key="gb.gcPeriod"></wicket:message></th><td class="edit"><select class="span2" wicket:id="gcPeriod" tabindex="5" /> <span class="help-inline"><wicket:message key="gb.gcPeriodDescription"></wicket:message></span></td></tr>\r
- <tr><th><wicket:message key="gb.gcThreshold"></wicket:message></th><td class="edit"><input class="span1" type="text" wicket:id="gcThreshold" tabindex="6" /> <span class="help-inline"><wicket:message key="gb.gcThresholdDescription"></wicket:message></span></td></tr>\r
- <tr><th colspan="2"><hr/></th></tr>\r
- <tr><th><wicket:message key="gb.acceptNewTickets"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="acceptNewTickets" tabindex="7" /> <span class="help-inline"><wicket:message key="gb.acceptNewTicketsDescription"></wicket:message></span></label></td></tr>\r
- <tr><th><wicket:message key="gb.acceptNewPatchsets"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="acceptNewPatchsets" tabindex="8" /> <span class="help-inline"><wicket:message key="gb.acceptNewPatchsetsDescription"></wicket:message></span></label></td></tr>\r
- <tr><th><wicket:message key="gb.requireApproval"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="requireApproval" tabindex="9" /> <span class="help-inline"><wicket:message key="gb.requireApprovalDescription"></wicket:message></span></label></td></tr>\r
- <tr><th><wicket:message key="gb.mergeTo"></wicket:message></th><td class="edit"><select class="span2" wicket:id="mergeTo" tabindex="10" /> <span class="help-inline"><wicket:message key="gb.mergeToDescription"></wicket:message></span></td></tr>\r
- <tr><th colspan="2"><hr/></th></tr>\r
- <tr><th><wicket:message key="gb.enableIncrementalPushTags"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="useIncrementalPushTags" tabindex="11" /> <span class="help-inline"><wicket:message key="gb.useIncrementalPushTagsDescription"></wicket:message></span></label></td></tr>\r
- <tr><th><wicket:message key="gb.showRemoteBranches"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="showRemoteBranches" tabindex="12" /> <span class="help-inline"><wicket:message key="gb.showRemoteBranchesDescription"></wicket:message></span></label></td></tr>\r
- <tr><th><wicket:message key="gb.skipSizeCalculation"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="skipSizeCalculation" tabindex="13" /> <span class="help-inline"><wicket:message key="gb.skipSizeCalculationDescription"></wicket:message></span></label></td></tr>\r
- <tr><th><wicket:message key="gb.skipSummaryMetrics"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="skipSummaryMetrics" tabindex="14" /> <span class="help-inline"><wicket:message key="gb.skipSummaryMetricsDescription"></wicket:message></span></label></td></tr>\r
- <tr><th><wicket:message key="gb.maxActivityCommits"></wicket:message></th><td class="edit"><select class="span2" wicket:id="maxActivityCommits" tabindex="15" /> <span class="help-inline"><wicket:message key="gb.maxActivityCommitsDescription"></wicket:message></span></td></tr>\r
- <tr><th><wicket:message key="gb.metricAuthorExclusions"></wicket:message></th><td class="edit"><input class="span8" type="text" wicket:id="metricAuthorExclusions" size="40" tabindex="16" /></td></tr>\r
- <tr><th><wicket:message key="gb.commitMessageRenderer"></wicket:message></th><td class="edit"><select class="span2" wicket:id="commitMessageRenderer" tabindex="17" /></td></tr>\r
- <tr><th colspan="2"><hr/></th></tr>\r
- <tr><th><wicket:message key="gb.mailingLists"></wicket:message></th><td class="edit"><input class="span8" type="text" wicket:id="mailingLists" size="40" tabindex="18" /></td></tr>\r
- </tbody>\r
- </table>\r
</div>\r
\r
<!-- access permissions -->\r
<div class="tab-pane" id="permissions">\r
+ \r
+ <h4><wicket:message key="gb.owners"></wicket:message></h4>\r
+ <p><wicket:message key="gb.ownersDescription"></wicket:message></p>\r
+ <div wicket:id="owners"></div>\r
+ \r
+ <hr />\r
+\r
+ <h4><wicket:message key="gb.userPermissions"></wicket:message></h4>\r
+ <p><wicket:message key="gb.userPermissionsDescription"></wicket:message></p>\r
+ <div wicket:id="users"></div>\r
+ \r
+ <hr />\r
+\r
+ <h4><wicket:message key="gb.teamPermissions"></wicket:message></h4>\r
+ <p><wicket:message key="gb.teamPermissionsDescription"></wicket:message></p>\r
+ <div wicket:id="teams"></div>\r
+ \r
+ </div>\r
+\r
+ <!-- receive -->\r
+ <div class="tab-pane" id="receive">\r
+ <h4><wicket:message key="gb.receiveSettings"></wicket:message></h4>\r
+ <p><wicket:message key="gb.receiveSettingsDescription"></wicket:message></p>\r
+ \r
+ <hr/>\r
+ \r
+ <div wicket:id="isFrozen"></div>\r
+ <div wicket:id="verifyCommitter"></div>\r
+ <div wicket:id="incrementalPushTags"></div>\r
+ \r
+ <hr />\r
+ \r
+ <h4><wicket:message key="gb.preReceiveScripts"></wicket:message></h4>\r
+ <p><wicket:message key="gb.preReceiveDescription"></wicket:message></p>\r
+ \r
<table class="plain">\r
<tbody class="settings">\r
- <tr><th><wicket:message key="gb.owners"></wicket:message></th><td class="edit"><span wicket:id="owners" tabindex="19" /> </td></tr>\r
- <tr><th colspan="2"><hr/></th></tr>\r
- <tr><th></th><td style="padding:2px;"><span wicket:id="accessPolicyPanel"></span></td></tr>\r
- <tr><th colspan="2"><hr/></th></tr>\r
- <tr><th><wicket:message key="gb.isFrozen"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="isFrozen" tabindex="21" /> <span class="help-inline"><wicket:message key="gb.isFrozenDescription"></wicket:message></span></label></td></tr>\r
- <tr><th><wicket:message key="gb.allowForks"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="allowForks" tabindex="22" /> <span class="help-inline"><wicket:message key="gb.allowForksDescription"></wicket:message></span></label></td></tr>\r
- <tr><th><wicket:message key="gb.verifyCommitter"></wicket:message></th><td class="edit"><label class="checkbox"><input type="checkbox" wicket:id="verifyCommitter" tabindex="23" /> <span class="help-inline"><wicket:message key="gb.verifyCommitterDescription"></wicket:message></span><br/><span class="help-inline" style="padding-left:10px;"><wicket:message key="gb.verifyCommitterNote"></wicket:message></span></label></td></tr>\r
- <tr><th colspan="2"><hr/></th></tr>\r
- <tr><th><wicket:message key="gb.userPermissions"></wicket:message></th><td style="padding:2px;"><span wicket:id="users"></span></td></tr>\r
- <tr><th colspan="2"><hr/></th></tr>\r
- <tr><th><wicket:message key="gb.teamPermissions"></wicket:message></th><td style="padding:2px;"><span wicket:id="teams"></span></td></tr>\r
+ <tr>\r
+ <td style="padding:2px;"><span wicket:id="preReceiveScripts"></span></td>\r
+ <td style="vertical-align: top;"><span wicket:id="inheritedPreReceive"></span></td>\r
+ </tr>\r
</tbody>\r
</table>\r
- </div>\r
\r
- <!-- federation -->\r
- <div class="tab-pane" id="federation">\r
+ <hr />\r
+ \r
+ <h4><wicket:message key="gb.postReceiveScripts"></wicket:message></h4>\r
+ <p><wicket:message key="gb.postReceiveDescription"></wicket:message></p>\r
+ \r
<table class="plain">\r
<tbody class="settings">\r
- <tr><th><wicket:message key="gb.federationStrategy"></wicket:message></th><td class="edit"><select class="span4" wicket:id="federationStrategy" tabindex="24" /></td></tr>\r
- <tr><th><wicket:message key="gb.federationSets"></wicket:message></th><td style="padding:2px;"><span wicket:id="federationSets"></span></td></tr>\r
+ <tr>\r
+ <td style="padding:2px;"><span wicket:id="postReceiveScripts"></span></td>\r
+ <td style="vertical-align: top;"><span wicket:id="inheritedPostReceive"></span></td>\r
+ </tr>\r
</tbody>\r
</table>\r
+\r
+ <div wicket:id="customFieldsSection">\r
+ <hr />\r
+ \r
+ <h4><wicket:message key="gb.customFields"></wicket:message></h4>\r
+ <p><wicket:message key="gb.customFieldsDescription"></wicket:message></p>\r
+ <table class="plain">\r
+ <tbody class="settings">\r
+ <tr wicket:id="customFieldsListView"><th><span wicket:id="customFieldLabel"></span></th><td class="edit"><input class="span8" type="text" wicket:id="customFieldValue" /></td></tr>\r
+ </tbody>\r
+ </table>\r
+ </div>\r
+ \r
+ </div>\r
+\r
+ <!-- tickets tab --> \r
+ <div class="tab-pane" id="tickets">\r
+\r
+ <h4><wicket:message key="gb.ticketSettings"></wicket:message></h4>\r
+ <p><wicket:message key="gb.ticketsWelcome"></wicket:message></p>\r
+ \r
+ <hr/>\r
+ \r
+ <div wicket:id="acceptNewPatchsets"></div>\r
+ <div wicket:id="acceptNewTickets"></div>\r
+ <div wicket:id="requireApproval"></div>\r
+ <div wicket:id="mergeTo"></div>\r
+ \r
+ </div>\r
+ \r
+ <!-- federation -->\r
+ <div class="tab-pane" id="federation">\r
+ <h4><wicket:message key="gb.federation"></wicket:message></h4>\r
+ <p><wicket:message key="gb.federationRepositoryDescription"></wicket:message></p>\r
+ \r
+ <hr/>\r
+ \r
+ <div wicket:id="federationStrategy"></div>\r
+\r
+ <hr />\r
+ \r
+ <h4><wicket:message key="gb.federationSets"></wicket:message></h4>\r
+ <p><wicket:message key="gb.federationSetsDescription"></wicket:message></p>\r
+\r
+ <div wicket:id="federationSets"></div>\r
</div>\r
\r
<!-- search -->\r
<div class="tab-pane" id="search">\r
- <table class="plain">\r
- <tbody class="settings">\r
- <tr><th><wicket:message key="gb.indexedBranches"></wicket:message></th><td style="padding:2px;"><span wicket:id="indexedBranches"></span></td></tr>\r
- </tbody>\r
- </table>\r
+ \r
+ <h4><wicket:message key="gb.indexedBranches"></wicket:message></h4>\r
+ <p><wicket:message key="gb.indexedBranchesDescription"></wicket:message></p>\r
+ \r
+ <div wicket:id="indexedBranches"></div>\r
</div>\r
\r
- <!-- hooks -->\r
- <div class="tab-pane" id="hooks">\r
- <table class="plain">\r
- <tbody class="settings">\r
- <tr><th><wicket:message key="gb.preReceiveScripts"></wicket:message><p></p><span wicket:id="inheritedPreReceive"></span></th><td style="padding:2px;"><span wicket:id="preReceiveScripts"></span></td></tr>\r
- <tr><th><wicket:message key="gb.postReceiveScripts"></wicket:message><p></p><span wicket:id="inheritedPostReceive"></span></th><td style="padding:2px;"><span wicket:id="postReceiveScripts"></span></td></tr>\r
- <div wicket:id="customFieldsSection">\r
- <tr><td colspan="2"><h3><wicket:message key="gb.customFields"></wicket:message> <small><wicket:message key="gb.customFieldsDescription"></wicket:message></small></h3></td></tr>\r
- <tr wicket:id="customFieldsListView"><th><span wicket:id="customFieldLabel"></span></th><td class="edit"><input class="span8" type="text" wicket:id="customFieldValue" /></td></tr>\r
- </div>\r
- </tbody>\r
- </table>\r
+ <!-- garbage collection -->\r
+ <div class="tab-pane" id="gc">\r
+\r
+ <h4><wicket:message key="gb.garbageCollection"></wicket:message></h4>\r
+ <p><wicket:message key="gb.garbageCollectionDescription"></wicket:message></p>\r
+ \r
+ <div wicket:id="gcPeriod"></div>\r
+ <div wicket:id="gcThreshold"></div>\r
</div>\r
- </div>\r
-</div>\r
-</div>\r
-</div>\r
+ \r
+ <!-- misc -->\r
+ <div class="tab-pane" id="misc">\r
\r
-<div class="row">\r
-<div class="span12">\r
- <div class="form-actions"><input class="btn btn-appmenu" type="submit" value="Save" wicket:message="value:gb.save" wicket:id="save" /> <input class="btn" type="submit" value="Cancel" wicket:message="value:gb.cancel" wicket:id="cancel" /> <input class="btn btn-danger" type="submit" value="Delete" wicket:message="value:gb.delete" wicket:id="delete" /></div>\r
+ <div wicket:id="origin"></div>\r
+ <div wicket:id="head"></div>\r
+\r
+ <hr/>\r
+ \r
+ <div wicket:id="showRemoteBranches"></div>\r
+ <div wicket:id="skipSizeCalculation"></div>\r
+ <div wicket:id="skipSummaryMetrics"></div>\r
+ <div wicket:id="maxActivityCommits"></div>\r
+ <div wicket:id="commitMessageRenderer"></div>\r
+ <div wicket:id="metricAuthorExclusions"></div>\r
+ <div wicket:id="mailingLists"></div>\r
+ \r
+ </div>\r
+ \r
+ <div class="form-actions"><input class="btn btn-appmenu" type="submit" value="Save" wicket:message="value:gb.save" wicket:id="save" /> <input class="btn" type="submit" value="Cancel" wicket:message="value:gb.cancel" wicket:id="cancel" /> <input class="btn btn-danger" type="submit" value="Delete" wicket:message="value:gb.delete" wicket:id="delete" /></div>\r
+ \r
+ </div>\r
+ </div>\r
</div>\r
</div>\r
\r
</form> \r
</body>\r
+\r
+<wicket:fragment wicket:id="checkboxOption">\r
+ <div style="padding-top:4px;">\r
+ <div>\r
+ <label style="font-weight:bold;" class="checkbox"><input type="checkbox" wicket:id="checkbox" /> <span wicket:id="name"></span></label>\r
+ </div>\r
+ <label class="checkbox" style="color:#777;" wicket:id="description"></label>\r
+ </div>\r
+</wicket:fragment>\r
+\r
+<wicket:fragment wicket:id="choiceOption">\r
+ <div style="padding-top:4px;">\r
+ <div>\r
+ <b><span wicket:id="name"></span></b>\r
+ </div>\r
+ <label class="checkbox" style="color:#777;"> <span wicket:id="description"></span>\r
+ <p style="padding-top:5px;"><select class="span2" wicket:id="choice" /></p>\r
+ </label>\r
+ \r
+ </div>\r
+</wicket:fragment>\r
+\r
+<wicket:fragment wicket:id="textfieldOption">\r
+ <div style="padding-top:4px;">\r
+ <div>\r
+ <b><span wicket:id="name"></span></b>\r
+ </div>\r
+ <label class="checkbox" style="color:#777;"> <span wicket:id="description"></span>\r
+ <p style="padding-top:5px;"><input class="span2" type="text" wicket:id="text" /></p>\r
+ </label>\r
+ \r
+ </div>\r
+</wicket:fragment>\r
+\r
</wicket:extend>\r
</html>
\ No newline at end of file
import org.apache.wicket.markup.html.link.Link;\r
import org.apache.wicket.markup.html.list.ListItem;\r
import org.apache.wicket.markup.html.list.ListView;\r
+import org.apache.wicket.markup.html.panel.Fragment;\r
import org.apache.wicket.model.CompoundPropertyModel;\r
import org.apache.wicket.model.IModel;\r
import org.apache.wicket.model.Model;\r
+import org.apache.wicket.model.PropertyModel;\r
import org.apache.wicket.model.util.CollectionModel;\r
import org.apache.wicket.model.util.ListModel;\r
import org.eclipse.jgit.lib.Repository;\r
}\r
}\r
final Palette<UserChoice> ownersPalette = new Palette<UserChoice>("owners", new ListModel<UserChoice>(owners), new CollectionModel<UserChoice>(\r
- persons), new ChoiceRenderer<UserChoice>(null, "userId"), 12, true);\r
+ persons), new ChoiceRenderer<UserChoice>(null, "userId"), 12, false);\r
\r
// indexed local branches palette\r
List<String> allLocalBranches = new ArrayList<String>();\r
}\r
};\r
\r
- // do not let the browser pre-populate these fields\r
- form.add(new SimpleAttributeModifier("autocomplete", "off"));\r
-\r
- // field names reflective match RepositoryModel fields\r
- namePanel = new RepositoryNamePanel("namePanel", repositoryModel);\r
- namePanel.setEditable(allowEditName);\r
- form.add(namePanel);\r
-\r
- form.add(ownersPalette);\r
- form.add(new CheckBox("allowForks").setEnabled(app().settings().getBoolean(Keys.web.allowForking, true)));\r
- form.add(new CheckBox("isFrozen"));\r
- // TODO enable origin definition\r
- form.add(new TextField<String>("origin").setEnabled(false/* isCreate */));\r
-\r
- // allow relinking HEAD to a branch or tag other than master on edit repository\r
+ // Determine available refs & branches\r
List<String> availableRefs = new ArrayList<String>();\r
List<String> availableBranches = new ArrayList<String>();\r
if (!ArrayUtils.isEmpty(repositoryModel.availableRefs)) {\r
}\r
}\r
}\r
- form.add(new DropDownChoice<String>("HEAD", availableRefs).setEnabled(availableRefs.size() > 0));\r
\r
- boolean gcEnabled = app().settings().getBoolean(Keys.git.enableGarbageCollection, false);\r
- int defaultGcPeriod = app().settings().getInteger(Keys.git.defaultGarbageCollectionPeriod, 7);\r
- if (repositoryModel.gcPeriod == 0) {\r
- repositoryModel.gcPeriod = defaultGcPeriod;\r
- }\r
- List<Integer> gcPeriods = Arrays.asList(1, 2, 3, 4, 5, 7, 10, 14 );\r
- form.add(new DropDownChoice<Integer>("gcPeriod", gcPeriods, new GCPeriodRenderer()).setEnabled(gcEnabled));\r
- form.add(new TextField<String>("gcThreshold").setEnabled(gcEnabled));\r
+ // do not let the browser pre-populate these fields\r
+ form.add(new SimpleAttributeModifier("autocomplete", "off"));\r
\r
- // federation strategies - remove ORIGIN choice if this repository has\r
- // no origin.\r
- List<FederationStrategy> federationStrategies = new ArrayList<FederationStrategy>(\r
- Arrays.asList(FederationStrategy.values()));\r
- if (StringUtils.isEmpty(repositoryModel.origin)) {\r
- federationStrategies.remove(FederationStrategy.FEDERATE_ORIGIN);\r
- }\r
- form.add(new DropDownChoice<FederationStrategy>("federationStrategy", federationStrategies,\r
- new FederationTypeRenderer()));\r
- form.add(new CheckBox("acceptNewPatchsets"));\r
- form.add(new CheckBox("acceptNewTickets"));
- form.add(new CheckBox("requireApproval"));\r
- form.add(new DropDownChoice<String>("mergeTo", availableBranches).setEnabled(availableBranches.size() > 0));\r
- form.add(new CheckBox("useIncrementalPushTags"));\r
- form.add(new CheckBox("showRemoteBranches"));\r
- form.add(new CheckBox("skipSizeCalculation"));\r
- form.add(new CheckBox("skipSummaryMetrics"));\r
- List<Integer> maxActivityCommits = Arrays.asList(-1, 0, 25, 50, 75, 100, 150, 200, 250, 500);\r
- form.add(new DropDownChoice<Integer>("maxActivityCommits", maxActivityCommits, new MaxActivityCommitsRenderer()));\r
\r
- metricAuthorExclusions = new Model<String>(ArrayUtils.isEmpty(repositoryModel.metricAuthorExclusions) ? ""\r
- : StringUtils.flattenStrings(repositoryModel.metricAuthorExclusions, " "));\r
- form.add(new TextField<String>("metricAuthorExclusions", metricAuthorExclusions));\r
+ //\r
+ //\r
+ // GENERAL\r
+ //\r
+ namePanel = new RepositoryNamePanel("namePanel", repositoryModel);\r
+ namePanel.setEditable(allowEditName);\r
+ form.add(namePanel);\r
\r
- mailingLists = new Model<String>(ArrayUtils.isEmpty(repositoryModel.mailingLists) ? ""\r
- : StringUtils.flattenStrings(repositoryModel.mailingLists, " "));\r
- form.add(new TextField<String>("mailingLists", mailingLists));\r
- form.add(indexedBranchesPalette);\r
+ // XXX AccessPolicyPanel is defined later.\r
+\r
+ form.add(newChoice("head",\r
+ getString("gb.headRef"),\r
+ getString("gb.headRefDescription"),\r
+ new PropertyModel<String>(repositoryModel, "HEAD"),\r
+ availableRefs));\r
\r
- final CheckBox verifyCommitter = new CheckBox("verifyCommitter");\r
- verifyCommitter.setOutputMarkupId(true);\r
- form.add(verifyCommitter);\r
\r
+ //\r
+ // PERMISSIONS\r
+ //\r
+ form.add(ownersPalette);\r
form.add(usersPalette);\r
form.add(teamsPalette);\r
- form.add(federationSetsPalette);\r
+\r
+ //\r
+ // TICKETS\r
+ //\r
+ form.add(newCheckbox("acceptNewPatchsets",\r
+ getString("gb.acceptNewPatchsets"),\r
+ getString("gb.acceptNewPatchsetsDescription"),\r
+ new PropertyModel<Boolean>(repositoryModel, "acceptNewPatchsets")));\r
+\r
+ form.add(newCheckbox("acceptNewTickets",\r
+ getString("gb.acceptNewTickets"),\r
+ getString("gb.acceptNewTicketsDescription"),\r
+ new PropertyModel<Boolean>(repositoryModel, "acceptNewPatchsets")));\r
+\r
+ form.add(newCheckbox("requireApproval",\r
+ getString("gb.requireApproval"),\r
+ getString("gb.requireApprovalDescription"),\r
+ new PropertyModel<Boolean>(repositoryModel, "requireApproval")));\r
+\r
+ form.add(newChoice("mergeTo",\r
+ getString("gb.mergeTo"),\r
+ getString("gb.mergeToDescription"),\r
+ new PropertyModel<String>(repositoryModel, "mergeTo"),\r
+ availableBranches));\r
+\r
+ //\r
+ // RECEIVE\r
+ //\r
+ form.add(newCheckbox("isFrozen",\r
+ getString("gb.isFrozen"),\r
+ getString("gb.isFrozenDescription"),\r
+ new PropertyModel<Boolean>(repositoryModel, "isFrozen")));\r
+\r
+ form.add(newCheckbox("incrementalPushTags",\r
+ getString("gb.enableIncrementalPushTags"),\r
+ getString("gb.useIncrementalPushTagsDescription"),\r
+ new PropertyModel<Boolean>(repositoryModel, "useIncrementalPushTags")));\r
+\r
+ final CheckBox verifyCommitter = new CheckBox("checkbox", new PropertyModel<Boolean>(repositoryModel, "verifyCommitter"));\r
+ verifyCommitter.setOutputMarkupId(true);\r
+ form.add(newCheckbox("verifyCommitter",\r
+ getString("gb.verifyCommitter"),\r
+ getString("gb.verifyCommitterDescription"),\r
+ verifyCommitter));\r
+\r
form.add(preReceivePalette);\r
form.add(new BulletListPanel("inheritedPreReceive", getString("gb.inherited"), app().repositories()\r
.getPreReceiveScriptsInherited(repositoryModel)));\r
customFieldsSection.add(customFieldsListView);\r
form.add(customFieldsSection.setVisible(!app().settings().getString(Keys.groovy.customFields, "").isEmpty()));\r
\r
+ //\r
+ // FEDERATION\r
+ //\r
+ List<FederationStrategy> federationStrategies = new ArrayList<FederationStrategy>(\r
+ Arrays.asList(FederationStrategy.values()));\r
+ // federation strategies - remove ORIGIN choice if this repository has no origin.\r
+ if (StringUtils.isEmpty(repositoryModel.origin)) {\r
+ federationStrategies.remove(FederationStrategy.FEDERATE_ORIGIN);\r
+ }\r
+\r
+ form.add(newChoice("federationStrategy",\r
+ getString("gb.federationStrategy"),\r
+ getString("gb.federationStrategyDescription"),\r
+ new DropDownChoice<FederationStrategy>(\r
+ "choice",\r
+ new PropertyModel<FederationStrategy>(repositoryModel, "federationStrategy"),\r
+ federationStrategies,\r
+ new FederationTypeRenderer())));\r
+\r
+ form.add(federationSetsPalette);\r
+\r
+ //\r
+ // SEARCH\r
+ //\r
+ form.add(indexedBranchesPalette);\r
+\r
+ //\r
+ // GARBAGE COLLECTION\r
+ //\r
+ boolean gcEnabled = app().settings().getBoolean(Keys.git.enableGarbageCollection, false);\r
+ int defaultGcPeriod = app().settings().getInteger(Keys.git.defaultGarbageCollectionPeriod, 7);\r
+ if (repositoryModel.gcPeriod == 0) {\r
+ repositoryModel.gcPeriod = defaultGcPeriod;\r
+ }\r
+ List<Integer> gcPeriods = Arrays.asList(1, 2, 3, 4, 5, 7, 10, 14 );\r
+ form.add(newChoice("gcPeriod",\r
+ getString("gb.gcPeriod"),\r
+ getString("gb.gcPeriodDescription"),\r
+ new DropDownChoice<Integer>("choice",\r
+ new PropertyModel<Integer>(repositoryModel, "gcPeriod"),\r
+ gcPeriods,\r
+ new GCPeriodRenderer())).setEnabled(gcEnabled));\r
+\r
+ form.add(newTextfield("gcThreshold",\r
+ getString("gb.gcThreshold"),\r
+ getString("gb.gcThresholdDescription"),\r
+ "span1",\r
+ new PropertyModel<String>(repositoryModel, "gcThreshold")).setEnabled(gcEnabled));\r
+\r
+ //\r
+ // MISCELLANEOUS\r
+ //\r
+\r
+ form.add(newTextfield("origin",\r
+ getString("gb.origin"),\r
+ getString("gb.originDescription"),\r
+ "span6",\r
+ new PropertyModel<String>(repositoryModel, "origin")).setEnabled(false));\r
+\r
+ form.add(newCheckbox("showRemoteBranches",\r
+ getString("gb.showRemoteBranches"),\r
+ getString("gb.showRemoteBranchesDescription"),\r
+ new PropertyModel<Boolean>(repositoryModel, "showRemoteBranches")));\r
+\r
+ form.add(newCheckbox("skipSizeCalculation",\r
+ getString("gb.skipSizeCalculation"),\r
+ getString("gb.skipSizeCalculationDescription"),\r
+ new PropertyModel<Boolean>(repositoryModel, "skipSizeCalculation")));\r
+\r
+ form.add(newCheckbox("skipSummaryMetrics",\r
+ getString("gb.skipSummaryMetrics"),\r
+ getString("gb.skipSummaryMetricsDescription"),\r
+ new PropertyModel<Boolean>(repositoryModel, "skipSummaryMetrics")));\r
+\r
+ List<Integer> maxActivityCommits = Arrays.asList(-1, 0, 25, 50, 75, 100, 150, 200, 250, 500);\r
+ form.add(newChoice("maxActivityCommits",\r
+ getString("gb.maxActivityCommits"),\r
+ getString("gb.maxActivityCommitsDescription"),\r
+ new DropDownChoice<Integer>("choice",\r
+ new PropertyModel<Integer>(repositoryModel, "maxActivityCommits"),\r
+ maxActivityCommits,\r
+ new MaxActivityCommitsRenderer())));\r
+\r
+ List<CommitMessageRenderer> renderers = Arrays.asList(CommitMessageRenderer.values());\r
+ form.add(newChoice("commitMessageRenderer",\r
+ getString("gb.commitMessageRenderer"),\r
+ getString("gb.commitMessageRendererDescription"),\r
+ new DropDownChoice<CommitMessageRenderer>("choice",\r
+ new PropertyModel<CommitMessageRenderer>(repositoryModel, "commitMessageRenderer"),\r
+ renderers)));\r
+\r
+ metricAuthorExclusions = new Model<String>(ArrayUtils.isEmpty(repositoryModel.metricAuthorExclusions) ? ""\r
+ : StringUtils.flattenStrings(repositoryModel.metricAuthorExclusions, " "));\r
+\r
+ form.add(newTextfield("metricAuthorExclusions",\r
+ getString("gb.metricAuthorExclusions"),\r
+ getString("gb.metricAuthorExclusions"),\r
+ "span6",\r
+ metricAuthorExclusions));\r
+\r
+ mailingLists = new Model<String>(ArrayUtils.isEmpty(repositoryModel.mailingLists) ? ""\r
+ : StringUtils.flattenStrings(repositoryModel.mailingLists, " "));\r
+\r
+ form.add(newTextfield("mailingLists",\r
+ getString("gb.mailingLists"),\r
+ getString("gb.mailingLists"),\r
+ "span6",\r
+ mailingLists));\r
+\r
+\r
// initial enable/disable of permission controls\r
if (repositoryModel.accessRestriction.equals(AccessRestrictionType.NONE)) {\r
// anonymous everything, disable all controls\r
teamsPalette.setEnabled(allowFineGrainedControls);\r
}\r
\r
+ //\r
+ // ACCESS POLICY PANEL (GENERAL)\r
+ //\r
AjaxFormChoiceComponentUpdatingBehavior callback = new AjaxFormChoiceComponentUpdatingBehavior() {\r
\r
private static final long serialVersionUID = 1L;\r
accessPolicyPanel = new AccessPolicyPanel("accessPolicyPanel", repositoryModel, callback);\r
form.add(accessPolicyPanel);\r
\r
- List<CommitMessageRenderer> renderers = Arrays.asList(CommitMessageRenderer.values());\r
- DropDownChoice<CommitMessageRenderer> messageRendererChoice = new DropDownChoice<CommitMessageRenderer>("commitMessageRenderer", renderers);\r
- form.add(messageRendererChoice);\r
\r
+ //\r
+ // FORM CONTROLS\r
+ //\r
form.add(new Button("save"));\r
Button cancel = new Button("cancel") {\r
private static final long serialVersionUID = 1L;\r
}\r
}\r
\r
+ private Fragment newCheckbox(String wicketId, String title, String description, IModel<Boolean> model) {\r
+ Fragment fragment = new Fragment(wicketId, "checkboxOption", this);\r
+ fragment.add(new Label("name", title));\r
+ fragment.add(new Label("description", description));\r
+ fragment.add(new CheckBox("checkbox", model));\r
+ return fragment;\r
+ }\r
+\r
+ private Fragment newCheckbox(String wicketId, String title, String description, CheckBox checkbox) {\r
+ Fragment fragment = new Fragment(wicketId, "checkboxOption", this);\r
+ fragment.add(new Label("name", title));\r
+ fragment.add(new Label("description", description));\r
+ fragment.add(checkbox);\r
+ return fragment;\r
+ }\r
+\r
+ private <T> Fragment newChoice(String wicketId, String title, String description, IModel<T> model, List<T> choices) {\r
+ Fragment fragment = new Fragment(wicketId, "choiceOption", this);\r
+ fragment.add(new Label("name", title));\r
+ fragment.add(new Label("description", description));\r
+ fragment.add(new DropDownChoice<>("choice", model, choices).setEnabled(choices.size() > 0));\r
+ return fragment;\r
+ }\r
+\r
+ private <T> Fragment newChoice(String wicketId, String title, String description, DropDownChoice<?> choice) {\r
+ Fragment fragment = new Fragment(wicketId, "choiceOption", this);\r
+ fragment.add(new Label("name", title));\r
+ fragment.add(new Label("description", description));\r
+ fragment.add(choice.setEnabled(choice.getChoices().size() > 0));\r
+ return fragment;\r
+ }\r
+\r
+ private Fragment newTextfield(String wicketId, String title, String description, String css, IModel<String> model) {\r
+ Fragment fragment = new Fragment(wicketId, "textfieldOption", this);\r
+ fragment.add(new Label("name", title));\r
+ fragment.add(new Label("description", description));\r
+ TextField<String> tf = new TextField<String>("text", model);\r
+ if (!StringUtils.isEmpty(css)) {\r
+ WicketUtils.setCssClass(tf, css);\r
+ }\r
+ fragment.add(tf);\r
+ return fragment;\r
+ }\r
+\r
+\r
private class FederationTypeRenderer implements IChoiceRenderer<FederationStrategy> {\r
\r
private static final long serialVersionUID = 1L;\r