summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket/pages/EditRepositoryPage.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-12-17 15:17:46 -0500
committerJames Moger <james.moger@gitblit.com>2011-12-17 15:17:46 -0500
commit3a2c57e652e5b688261fee02baa3853526e9893a (patch)
tree459c7d8879684b63da21ab1d8b44e9f8e73297c6 /src/com/gitblit/wicket/pages/EditRepositoryPage.java
parent9fd38cf138f0661990c4f542795beac618942c41 (diff)
downloadgitblit-3a2c57e652e5b688261fee02baa3853526e9893a.tar.gz
gitblit-3a2c57e652e5b688261fee02baa3853526e9893a.zip
Edit and store per-repository mail recipients in site and RPC
Diffstat (limited to 'src/com/gitblit/wicket/pages/EditRepositoryPage.java')
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
index 1a5ec3dd..56e44f88 100644
--- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java
+++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java
@@ -33,6 +33,8 @@ import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.CompoundPropertyModel;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
import org.apache.wicket.model.util.CollectionModel;
import org.apache.wicket.model.util.ListModel;
@@ -53,6 +55,8 @@ public class EditRepositoryPage extends RootSubPage {
private boolean isAdmin;
+ private IModel<String> mailRecipients;
+
public EditRepositoryPage() {
// create constructor
super();
@@ -86,8 +90,7 @@ public class EditRepositoryPage extends RootSubPage {
Collections.sort(repositoryUsers);
}
federationSets.addAll(repositoryModel.federationSets);
- }
-
+ }
final String oldName = repositoryModel.name;
// users palette
@@ -169,6 +172,13 @@ public class EditRepositoryPage extends RootSubPage {
}
}
+ // set mail recipients
+ String ml = mailRecipients.getObject();
+ if (!StringUtils.isEmpty(ml)) {
+ List<String> list = StringUtils.getStringsFromValue(ml.trim(), " ");
+ repositoryModel.mailRecipients = list;
+ }
+
// save the repository
GitBlit.self().updateRepositoryModel(oldName, repositoryModel, isCreate);
@@ -186,7 +196,7 @@ public class EditRepositoryPage extends RootSubPage {
repositoryUsers.add(repositoryModel.owner);
}
GitBlit.self().setRepositoryUsers(repositoryModel, repositoryUsers);
-
+
// save the team access list
Iterator<String> teams = teamsPalette.getSelectedChoices();
List<String> repositoryTeams = new ArrayList<String>();
@@ -230,6 +240,9 @@ public class EditRepositoryPage extends RootSubPage {
form.add(new CheckBox("showReadme"));
form.add(new CheckBox("skipSizeCalculation"));
form.add(new CheckBox("skipSummaryMetrics"));
+ mailRecipients = new Model<String>(repositoryModel.mailRecipients == null ? ""
+ : StringUtils.flattenStrings(repositoryModel.mailRecipients, " "));
+ form.add(new TextField<String>("mailRecipients", mailRecipients));
form.add(usersPalette);
form.add(teamsPalette);
form.add(federationSetsPalette);