From: James Moger Date: Fri, 28 Feb 2014 23:14:54 +0000 (-0500) Subject: Add the No Docs page if there are no root documents X-Git-Tag: v1.4.0~76 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c8a833a2ea7d03a5c29ebcd1cf7e2e05c96f3e70;p=gitblit.git Add the No Docs page if there are no root documents --- diff --git a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties index 23cb649c..8f3a6aaf 100644 --- a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties @@ -509,3 +509,6 @@ gb.home = home gb.isMirror = this repository is a mirror gb.mirrorOf = mirror of {0} gb.mirrorWarning = this repository is a mirror and can not receive pushes +gb.docsWelcome1 = You can use docs to document your repository. +gb.docsWelcome2 = Commit a README.md or a HOME.md file to get started. +gb.createReadme = create a README \ No newline at end of file diff --git a/src/main/java/com/gitblit/wicket/pages/DocsPage.java b/src/main/java/com/gitblit/wicket/pages/DocsPage.java index 85c19e22..907dd6e2 100644 --- a/src/main/java/com/gitblit/wicket/pages/DocsPage.java +++ b/src/main/java/com/gitblit/wicket/pages/DocsPage.java @@ -59,8 +59,9 @@ public class DocsPage extends RepositoryPage { List roots = processor.getRootDocs(r, repositoryName, commitId); Fragment fragment = null; if (roots.isEmpty()) { - // no identified root documents just show the standard document list + // no identified root documents fragment = new Fragment("docs", "noIndexFragment", this); + setResponsePage(NoDocsPage.class, params); } else { // root documents, use tabbed ui of index/root and document list fragment = new Fragment("docs", "tabsFragment", this); diff --git a/src/main/java/com/gitblit/wicket/pages/NoDocsPage.html b/src/main/java/com/gitblit/wicket/pages/NoDocsPage.html new file mode 100644 index 00000000..0672e94b --- /dev/null +++ b/src/main/java/com/gitblit/wicket/pages/NoDocsPage.html @@ -0,0 +1,22 @@ + + + + + +
+
+
+
+

+

+

+

+ +
+
+
+
+ \ No newline at end of file diff --git a/src/main/java/com/gitblit/wicket/pages/NoDocsPage.java b/src/main/java/com/gitblit/wicket/pages/NoDocsPage.java new file mode 100644 index 00000000..868e5d02 --- /dev/null +++ b/src/main/java/com/gitblit/wicket/pages/NoDocsPage.java @@ -0,0 +1,39 @@ +/* + * Copyright 2014 gitblit.com. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gitblit.wicket.pages; + +import org.apache.wicket.PageParameters; + +public class NoDocsPage extends RepositoryPage { + + public NoDocsPage(PageParameters params) { + super(params); + + //UserModel user = GitBlitWebSession.get().getUser(); + //boolean isAuthenticated = user != null && user.isAuthenticated; + //add(new BookmarkablePageLink("newreadme", NewTicketPage.class, WicketUtils.newRepositoryParameter(repositoryName)).setVisible(isAuthenticated)); + } + + @Override + protected String getPageName() { + return getString("gb.docs"); + } + + @Override + protected Class getRepoNavPageClass() { + return DocsPage.class; + } +} diff --git a/src/main/resources/gitblit.css b/src/main/resources/gitblit.css index 91825f7e..cd5c57b0 100644 --- a/src/main/resources/gitblit.css +++ b/src/main/resources/gitblit.css @@ -520,6 +520,18 @@ th { text-align: left; } +div.featureWelcome { + padding: 15px; + background-color: #fbfbfb; + border: 1px solid #ccc; + border-radius: 5px; +} + +div.featureWelcome div.icon { + color: #ccc; + font-size: 144px; +} + div.sourceview { overflow: hidden; }