diff options
-rw-r--r-- | src/main/java/com/gitblit/wicket/GitBlitWebApp.properties | 3 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/DocsPage.java | 3 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/NoDocsPage.html | 22 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/NoDocsPage.java | 39 | ||||
-rw-r--r-- | src/main/resources/gitblit.css | 12 |
5 files changed, 78 insertions, 1 deletions
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<MarkupDocument> 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 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" + xml:lang="en" + lang="en"> + +<wicket:extend> + <!-- No tickets --> + <div class="featureWelcome"> + <div class="row"> + <div class="icon span2"><i class="fa fa-book"></i></div> + <div class="span9"> + <h1><wicket:message key="gb.docs"></wicket:message></h1> + <p><wicket:message key="gb.docsWelcome1"></wicket:message></p> + <p><wicket:message key="gb.docsWelcome2"></wicket:message></p> + <p></p> + <!-- <a wicket:id="newreadme" class="btn btn-appmenu"><wicket:message key="gb.createReadme"></wicket:message></a>--> + </div> + </div> + </div> +</wicket:extend> +</html>
\ 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<Void>("newreadme", NewTicketPage.class, WicketUtils.newRepositoryParameter(repositoryName)).setVisible(isAuthenticated)); + } + + @Override + protected String getPageName() { + return getString("gb.docs"); + } + + @Override + protected Class<? extends BasePage> 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;
}
|