gb.yourAssignedTickets = assigned to you
gb.newMilestone = new milestone
gb.editMilestone = edit milestone
+gb.deleteMilestone = Delete milestone \"{0}\"?
+gb.milestoneDeleteFailed = Failed to delete milestone ''{0}''!
gb.notifyChangedOpenTickets = send notification for changed open tickets
gb.overdue = overdue
gb.openMilestones = open milestones
*/\r
package com.gitblit.wicket.pages;\r
\r
+import java.text.MessageFormat;\r
import java.util.Arrays;\r
import java.util.Date;\r
import java.util.List;\r
import org.apache.wicket.markup.html.form.DropDownChoice;\r
import org.apache.wicket.markup.html.form.Form;\r
import org.apache.wicket.markup.html.form.TextField;\r
+import org.apache.wicket.markup.html.link.Link;\r
import org.apache.wicket.model.IModel;\r
import org.apache.wicket.model.Model;\r
\r
import com.gitblit.utils.StringUtils;\r
import com.gitblit.wicket.GitBlitWebSession;\r
import com.gitblit.wicket.WicketUtils;\r
+import com.gitblit.wicket.panels.BasePanel.JavascriptEventConfirmation;\r
\r
/**\r
* Page for creating a new milestone.\r
cancel.setDefaultFormProcessing(false);\r
form.add(cancel);\r
\r
- Button delete = new Button("delete") {\r
+ Link<Void> delete = new Link<Void>("delete") {\r
+\r
private static final long serialVersionUID = 1L;\r
\r
@Override\r
- public void onSubmit() {\r
+ public void onClick() {\r
UserModel currentUser = GitBlitWebSession.get().getUser();\r
String createdBy = currentUser.username;\r
boolean notify = notificationModel.getObject();\r
if (app().tickets().deleteMilestone(getRepositoryModel(), oldName, createdBy, notify)) {\r
setResponsePage(TicketsPage.class, WicketUtils.newOpenTicketsParameter(repositoryName));\r
} else {\r
- // TODO error processing\r
+ error(MessageFormat.format(getString("gb.milestoneDeleteFailed"), oldName));\r
}\r
}\r
};\r
- delete.setDefaultFormProcessing(false);\r
+\r
+ delete.add(new JavascriptEventConfirmation("onclick", MessageFormat.format(\r
+ getString("gb.deleteMilestone"), oldName)));\r
+\r
form.add(delete);\r
}\r
\r