]> source.dussan.org Git - gitblit.git/commitdiff
Fixed delete repository from repository panel
authorJames Moger <james.moger@gitblit.com>
Tue, 2 Oct 2012 03:00:50 +0000 (23:00 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 2 Oct 2012 03:00:50 +0000 (23:00 -0400)
src/com/gitblit/wicket/panels/ProjectRepositoryPanel.java

index c66fa60f94484573b30b8269bab4b00bbff281a1..6f693ee043cb76c9cbecaa5c29f527b8a03b67a6 100644 (file)
@@ -22,6 +22,7 @@ import java.util.Map;
 \r
 import org.apache.wicket.Component;\r
 import org.apache.wicket.Localizer;\r
+import org.apache.wicket.Page;\r
 import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.markup.html.basic.Label;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
@@ -153,7 +154,12 @@ public class ProjectRepositoryPanel extends BasePanel {
                                        public void onClick() {\r
                                                if (GitBlit.self().deleteRepositoryModel(entry)) {\r
                                                        info(MessageFormat.format(getString("gb.repositoryDeleted"), entry));\r
-                                                       // TODO dp.remove(entry);\r
+                                                       // redirect to the owning page\r
+                                                       if (entry.isPersonalRepository()) {\r
+                                                               setResponsePage(getPage().getClass(), WicketUtils.newUsernameParameter(entry.projectPath.substring(1)));\r
+                                                       } else {\r
+                                                               setResponsePage(getPage().getClass(), WicketUtils.newProjectParameter(entry.projectPath));\r
+                                                       }\r
                                                } else {\r
                                                        error(MessageFormat.format(getString("gb.repositoryDeleteFailed"), entry));\r
                                                }\r