| | |
| | | import com.gitblit.Constants;
|
| | | import com.gitblit.Constants.AccessRestrictionType;
|
| | | import com.gitblit.Constants.AuthorizationControl;
|
| | | import com.gitblit.Constants.CommitMessageRenderer;
|
| | | import com.gitblit.Constants.FederationStrategy;
|
| | | import com.gitblit.Constants.RegistrantType;
|
| | | import com.gitblit.GitBlit;
|
| | |
| | |
|
| | | RepositoryModel repositoryModel;
|
| | |
|
| | | private IModel<String> metricAuthorExclusions;
|
| | | |
| | | private IModel<String> mailingLists;
|
| | |
|
| | | public EditRepositoryPage() {
|
| | |
| | | @Override
|
| | | protected boolean requiresPageMap() {
|
| | | return true;
|
| | | }
|
| | | |
| | | @Override
|
| | | protected Class<? extends BasePage> getRootNavPageClass() {
|
| | | return RepositoriesPage.class;
|
| | | }
|
| | |
|
| | | protected void setupPage(RepositoryModel model) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // set author metric exclusions
|
| | | String ax = metricAuthorExclusions.getObject();
|
| | | if (!StringUtils.isEmpty(ax)) {
|
| | | Set<String> list = new HashSet<String>();
|
| | | for (String exclusion : StringUtils.getStringsFromValue(ax, " ")) {
|
| | | if (StringUtils.isEmpty(exclusion)) {
|
| | | continue;
|
| | | }
|
| | | if (exclusion.indexOf(' ') > -1) {
|
| | | list.add("\"" + exclusion + "\""); |
| | | } else {
|
| | | list.add(exclusion);
|
| | | }
|
| | | }
|
| | | repositoryModel.metricAuthorExclusions = new ArrayList<String>(list);
|
| | | }
|
| | |
|
| | | // set mailing lists
|
| | | String ml = mailingLists.getObject();
|
| | | if (!StringUtils.isEmpty(ml)) {
|
| | |
| | | new FederationTypeRenderer()));
|
| | | form.add(new CheckBox("useTickets"));
|
| | | form.add(new CheckBox("useDocs"));
|
| | | form.add(new CheckBox("useIncrementalRevisionNumbers"));
|
| | | form.add(new CheckBox("useIncrementalPushTags"));
|
| | | form.add(new CheckBox("showRemoteBranches"));
|
| | | form.add(new CheckBox("showReadme"));
|
| | | form.add(new CheckBox("skipSizeCalculation"));
|
| | | form.add(new CheckBox("skipSummaryMetrics"));
|
| | | List<Integer> maxActivityCommits = Arrays.asList(-1, 0, 25, 50, 75, 100, 150, 200, 250, 500 );
|
| | | form.add(new DropDownChoice<Integer>("maxActivityCommits", maxActivityCommits, new MaxActivityCommitsRenderer()));
|
| | |
|
| | | metricAuthorExclusions = new Model<String>(ArrayUtils.isEmpty(repositoryModel.metricAuthorExclusions) ? ""
|
| | | : StringUtils.flattenStrings(repositoryModel.metricAuthorExclusions, " "));
|
| | | form.add(new TextField<String>("metricAuthorExclusions", metricAuthorExclusions));
|
| | |
|
| | | mailingLists = new Model<String>(ArrayUtils.isEmpty(repositoryModel.mailingLists) ? ""
|
| | | : StringUtils.flattenStrings(repositoryModel.mailingLists, " "));
|
| | |
| | | target.addComponent(teamsPalette);
|
| | | }
|
| | | });
|
| | | |
| | | List<CommitMessageRenderer> renderers = Arrays.asList(CommitMessageRenderer.values());
|
| | | DropDownChoice<CommitMessageRenderer> messageRendererChoice = new DropDownChoice<CommitMessageRenderer>("commitMessageRenderer", renderers);
|
| | | form.add(messageRendererChoice);
|
| | |
|
| | | form.add(new Button("save"));
|
| | | Button cancel = new Button("cancel") {
|
| | |
| | | return Integer.toString(index);
|
| | | }
|
| | | }
|
| | | |
| | | }
|