]> source.dussan.org Git - gitblit.git/commitdiff
Strip folder name and .git from repo links in the project view
authorJames Moger <james.moger@gitblit.com>
Mon, 10 Sep 2012 20:26:27 +0000 (16:26 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 10 Sep 2012 20:26:27 +0000 (16:26 -0400)
src/com/gitblit/wicket/pages/ProjectPage.java

index be3cf38966da53d08326ec2706375be661fcdd04..808cc065d4b19af244d482b3ee6a67cb4465e7d0 100644 (file)
@@ -117,22 +117,22 @@ public class ProjectPage extends RootPage {
                add(WicketUtils.syndicationDiscoveryLink(SyndicationServlet.getTitle(project.getDisplayName(),\r
                                null), feedLink));\r
                \r
-               String groupName = projectName;\r
+               final String projectPath;\r
                if (project.isRoot) {\r
-                       groupName = "";\r
+                       projectPath = "";\r
                } else {\r
-                       groupName += "/";\r
+                       projectPath = projectName + "/";\r
                }\r
                \r
                // project markdown message\r
-               File pmkd = new File(GitBlit.getRepositoriesFolder(),  groupName + "project.mkd");\r
+               File pmkd = new File(GitBlit.getRepositoriesFolder(),  projectPath + "project.mkd");\r
                String pmessage = readMarkdown(projectName, pmkd);\r
                Component projectMessage = new Label("projectMessage", pmessage)\r
                                .setEscapeModelStrings(false).setVisible(pmessage.length() > 0);\r
                add(projectMessage);\r
 \r
                // markdown message above repositories list\r
-               File rmkd = new File(GitBlit.getRepositoriesFolder(),  groupName + "repositories.mkd");\r
+               File rmkd = new File(GitBlit.getRepositoriesFolder(),  projectPath + "repositories.mkd");\r
                String rmessage = readMarkdown(projectName, rmkd);\r
                Component repositoriesMessage = new Label("repositoriesMessage", rmessage)\r
                                .setEscapeModelStrings(false).setVisible(rmessage.length() > 0);\r
@@ -172,7 +172,7 @@ public class ProjectPage extends RootPage {
                                swatch.setVisible(showSwatch);\r
                                \r
                                PageParameters pp = WicketUtils.newRepositoryParameter(entry.name);\r
-                               item.add(new LinkPanel("repositoryName", "list", entry.name, SummaryPage.class, pp));\r
+                               item.add(new LinkPanel("repositoryName", "list", StringUtils.getRelativePath(projectPath, StringUtils.stripDotGit(entry.name)), SummaryPage.class, pp));\r
                                item.add(new Label("repositoryDescription", entry.description).setVisible(!StringUtils.isEmpty(entry.description)));\r
                                \r
                                item.add(new BookmarkablePageLink<Void>("tickets", TicketsPage.class, pp).setVisible(entry.useTickets));\r