]> source.dussan.org Git - gitblit.git/commitdiff
Moved edit link to button
authorJames Moger <james.moger@gitblit.com>
Wed, 19 Jun 2013 03:05:27 +0000 (23:05 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 19 Jun 2013 03:05:27 +0000 (23:05 -0400)
src/main/java/com/gitblit/wicket/pages/RepositoryPage.html
src/main/java/com/gitblit/wicket/pages/RepositoryPage.java

index 86e8bbe41f7ec9f9e27950dbb9028fa47eef531d..1af9127ed87eaeb035f842e279043f09aa880346 100644 (file)
@@ -40,9 +40,9 @@
                                                        <!-- future spot for other repo buttons -->\r
                                                        <a class="btn" wicket:id="starLink"></a>\r
                                                        <a class="btn" wicket:id="unstarLink"></a>\r
-                                                       \r
                                                        <a class="btn" wicket:id="myForkLink"><img style="border:0px;vertical-align:middle;" src="fork-black_16x16.png"></img> <wicket:message key="gb.myFork"></wicket:message></a>\r
                                                        <a class="btn" wicket:id="forkLink"><img style="border:0px;vertical-align:middle;" src="fork-black_16x16.png"></img> <wicket:message key="gb.fork"></wicket:message></a>\r
+                                                       <a class="btn" wicket:id="editLink"><i class="icon-cog"></i> <wicket:message key="gb.edit"></wicket:message></a>\r
                                                </div>\r
                                                \r
                                                <div wicket:id="repositoryNavPanel"></div>\r
index 96573012411332a513c217dc5ed90134ea8482f9..774604fa81f59e6536a1ba127844067530edb4dd 100644 (file)
@@ -226,9 +226,6 @@ public abstract class RepositoryPage extends RootPage {
                isOwner = GitBlitWebSession.get().isLoggedIn()\r
                                && (model.isOwner(GitBlitWebSession.get()\r
                                                .getUsername()));\r
-               if (showAdmin || isOwner) {\r
-                       pages.put("edit", new PageRegistration("gb.edit", EditRepositoryPage.class, params));\r
-               }\r
                return pages;\r
        }\r
        \r
@@ -336,6 +333,13 @@ public abstract class RepositoryPage extends RootPage {
                        }\r
                }\r
                \r
+               if (showAdmin || isOwner) {\r
+                       String url = getRequestCycle().urlFor(EditRepositoryPage.class, WicketUtils.newRepositoryParameter(model.name)).toString();\r
+                       add(new ExternalLink("editLink", url)); \r
+               } else {\r
+                       add(new Label("editLink").setVisible(false));\r
+               }\r
+               \r
                super.setupPage(repositoryName, pageName);\r
        }\r
        \r