]> source.dussan.org Git - gitblit.git/commitdiff
Overhaul EditRepositoryPage for layout and usability
authorJames Moger <james.moger@gitblit.com>
Tue, 3 Jun 2014 04:16:38 +0000 (00:16 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 3 Jun 2014 14:34:51 +0000 (10:34 -0400)
src/main/java/com/gitblit/wicket/GitBlitWebApp.properties
src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.html
src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java
src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.html
src/main/java/com/gitblit/wicket/panels/AccessPolicyPanel.java
src/main/java/com/gitblit/wicket/panels/RepositoryNamePanel.html

index 13abcc066415e8151e4e32b50fba735066dc8735..bd5d89e01d72ac21222fd92ff82418d5e9b52b4c 100644 (file)
@@ -133,7 +133,7 @@ gb.sendProposal = propose
 gb.status = status
 gb.origin = origin
 gb.headRef = default branch (HEAD)
-gb.headRefDescription = change the ref that HEAD links to. e.g. refs/heads/master
+gb.headRefDescription = The default branch that will be cloned and displayed on the Summary page.
 gb.federationStrategy = federation strategy
 gb.federationRegistration = federation registration
 gb.federationResults = federation pull results
@@ -223,8 +223,8 @@ gb.queryResults = results {0} - {1} ({2} hits)
 gb.noHits = no hits
 gb.authored = authored
 gb.committed = committed
-gb.indexedBranches = indexed branches
-gb.indexedBranchesDescription = select the branches to include in your Lucene index
+gb.indexedBranches = Indexed Branches
+gb.indexedBranchesDescription = Select the branches to be indexed by Lucene
 gb.noIndexedRepositoriesWarning = none of your repositories are configured for Lucene indexing
 gb.undefinedQueryWarning = query is undefined!
 gb.noSelectedRepositoriesWarning = please select one or more repositories!
@@ -704,3 +704,21 @@ gb.initWithReadme = Include a README
 gb.initWithReadmeDescription = This will generate a simple README document for your repository.
 gb.initWithGitignore = Include a .gitignore file
 gb.initWithGitignoreDescription = This will insert a config file that instructs your Git clients to ignore files or directories that match defined patterns.
+gb.receive = receive
+gb.permissions = permissions
+gb.ownersDescription = Owners can manage all repository settings but they are not allowed to rename a repository unless it is their personal repository.
+gb.userPermissionsDescription = You can specify individual user permissions. These settings will override team or regex permissions.
+gb.teamPermissionsDescription = You can specify individual team permissions. These settings will override regex permissions.
+gb.ticketSettings = Ticket Settings
+gb.receiveSettings = Receive Settings
+gb.receiveSettingsDescription = The receive settings control pushes to the repository.
+gb.preReceiveDescription = Pre-receive hooks are executed after commits are received but <em>BEFORE</em> the refs are updated.<p>This is the appropriate hook for rejecting a push.</p>
+gb.postReceiveDescription = Post-receive hooks are executed after commits are received but <em>AFTER</em> the refs are updated.<p>This is the appropriate hook for notifications, build triggers, etc.</p>
+gb.federationStrategyDescription = Control if and how to federate this repository with another Gitblit.
+gb.federationSetsDescription = This repository will be included in the selected federation sets.
+gb.miscellaneous = miscellaneous
+gb.originDescription = The url from which this repository was cloned.
+gb.gc = GC 
+gb.garbageCollection = Garbage Collection
+gb.garbageCollectionDescription = The garbage collector will pack loose objects pushed from clients and will remove unreferenced objects from the repository.
+gb.commitMessageRendererDescription = Commit messages can be displayed as plaintext or as rendered markup.
\ No newline at end of file
index ab448038fde8a131543ea24f843d83f27895524f..b5f9528f36e5486ae5c0abcdf5a711083f95018b 100644 (file)
@@ -9,14 +9,17 @@
        <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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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" /> &nbsp;<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> &nbsp;<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" /> &nbsp; <input class="btn" type="submit" value="Cancel" wicket:message="value:gb.cancel" wicket:id="cancel" /> &nbsp; <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" /> &nbsp; <input class="btn" type="submit" value="Cancel" wicket:message="value:gb.cancel" wicket:id="cancel" /> &nbsp; <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
index e86bd1ee5892e26d8286896962728ff03e2da719..16dac895bb9c23d41e252c342285a505ffd4bdc8 100644 (file)
@@ -43,9 +43,11 @@ import org.apache.wicket.markup.html.form.TextField;
 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
@@ -200,7 +202,7 @@ public class EditRepositoryPage extends RootSubPage {
                        }\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
@@ -387,21 +389,7 @@ public class EditRepositoryPage extends RootSubPage {
                        }\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
@@ -414,53 +402,79 @@ public class EditRepositoryPage extends RootSubPage {
                                }\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
@@ -472,6 +486,116 @@ public class EditRepositoryPage extends RootSubPage {
                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
@@ -488,6 +612,9 @@ public class EditRepositoryPage extends RootSubPage {
                        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
@@ -516,10 +643,10 @@ public class EditRepositoryPage extends RootSubPage {
                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
@@ -625,6 +752,51 @@ public class EditRepositoryPage extends RootSubPage {
                }\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
index 38fa7f6a73765439bdfdb00765e8fc6407aaa35d..965c4d519dfc99774cca92b17d542129bc5c23c5 100644 (file)
        <h4><wicket:message key="gb.accessPolicy"></wicket:message></h4>\r
        <p><wicket:message key="gb.accessPolicyDescription"></wicket:message></p>\r
                \r
-       <span wicket:id="policiesGroup">\r
-                       <div wicket:id="policies">\r
-                               <div style="display: inline-block;vertical-align: top;">\r
-                                       <input type="radio" wicket:id="radio" />\r
-                                       <img wicket:id="image"></img> \r
-                               </div>\r
-                               <div style="display: inline-block;vertical-align: top;">\r
-                                       <b><span wicket:id="name"></span></b><br/>\r
-                                       <span wicket:id="description"></span>\r
-                               </div>\r
+       <div wicket:id="policiesGroup">\r
+               <div wicket:id="policies" style="padding-top:4px;">\r
+                       <div style="display: inline-block;vertical-align: top;">\r
+                               <input type="radio" wicket:id="radio" />\r
+                               <img wicket:id="image"></img> \r
                        </div>\r
-               </span>\r
+                       <div style="display: inline-block;vertical-align: top;">\r
+                               <b><span wicket:id="name"></span></b><br/>\r
+                               <span class="help-inline" wicket:id="description"></span>\r
+                       </div>\r
+               </div>\r
+       </div>\r
+       \r
+       <hr />\r
        \r
+       <div wicket:id="allowForks"></div>\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:panel>\r
 </body>\r
 </html>
\ No newline at end of file
index 057b96f47fbd080bb4085531036a62e3d5d6f19d..7aa801f4a59d3f230cde15bbad8fe3dbe3d717bb 100644 (file)
@@ -21,10 +21,13 @@ import java.util.List;
 \r
 import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;\r
 import org.apache.wicket.markup.html.basic.Label;\r
+import org.apache.wicket.markup.html.form.CheckBox;\r
 import org.apache.wicket.markup.html.form.Radio;\r
 import org.apache.wicket.markup.html.form.RadioGroup;\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.IModel;\r
 import org.apache.wicket.model.Model;\r
 \r
 import com.gitblit.Constants.AccessRestrictionType;\r
@@ -49,6 +52,8 @@ public class AccessPolicyPanel extends BasePanel {
 \r
        private RadioGroup<AccessPolicy> policiesGroup;\r
 \r
+       private IModel<Boolean> allowForks;\r
+\r
        public AccessPolicyPanel(String wicketId, RepositoryModel repository) {\r
                this(wicketId, repository, null);\r
        }\r
@@ -142,13 +147,28 @@ public class AccessPolicyPanel extends BasePanel {
                }\r
                add(policiesGroup);\r
 \r
+               allowForks = Model.of(true);\r
+               add(newCheckbox("allowForks",\r
+                               getString("gb.allowForks"),\r
+                               getString("gb.allowForksDescription"),\r
+                               allowForks).setEnabled(app().settings().getBoolean(Keys.web.allowForking, true)));\r
+\r
                setOutputMarkupId(true);\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
        public void updateModel(RepositoryModel repository) {\r
                AccessPolicy policy = policiesGroup.getModelObject();\r
                repository.authorizationControl = policy.control;\r
                repository.accessRestriction = policy.type;\r
+               repository.allowForks = allowForks.getObject();\r
        }\r
 \r
        @Override\r
index 3c6516201b7c8ad0208becde3014abed5dd33091..6fb6e45cf03610126bbcc204c16ac06f314c3ea7 100644 (file)
@@ -15,7 +15,7 @@
                        </tr>\r
                        <tr>\r
                                <td><select class="span2" wicket:id="projectPath" /></td>\r
-                               <td class="edit"><input class="span3" type="text" wicket:id="name" id="name" /> &nbsp;<span class="help-inline"><wicket:message key="gb.nameDescription"></wicket:message></span></td>\r
+                               <td class="edit"><input class="span4" type="text" wicket:id="name" id="name" /> &nbsp;<span class="help-inline"><wicket:message key="gb.nameDescription"></wicket:message></span></td>\r
                        </tr>\r
                </tbody>\r
        </table>\r