doortts doortts 2017-04-17
projects: Show no projects message
See: Yona Github issue #200 #204
@1e07cac15411532be6dee897b4ec8fce5a3ebd24
app/controllers/ProjectApp.java
--- app/controllers/ProjectApp.java
+++ app/controllers/ProjectApp.java
@@ -1,23 +1,9 @@
 /**
- * Yobi, Project Hosting SW
- *
- * Copyright 2012 NAVER Corp.
- * http://yobi.io
- *
- * @author Sangcheol Hwang
- *
- * 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.
- */
+ * Yona, 21st Century Project Hosting SW
+ * <p>
+ * Copyright Yona & Yobi Authors & NAVER Corp.
+ * https://yona.io
+ **/
 package controllers;
 
 import actions.DefaultProjectCheckAction;
@@ -1001,9 +987,6 @@
 
         el.orderBy("createdDate desc");
         Page<Project> projects = getProjectPage(pageNum, el);
-        if (projects.getList().size() == 0) {
-            return notFound(ErrorViews.NotFound.render("error.notfound"));
-        }
 
         return ok(views.html.project.list.render("title.projectList", projects, query));
     }
app/views/project/list.scala.html
--- app/views/project/list.scala.html
+++ app/views/project/list.scala.html
@@ -1,22 +1,8 @@
 @**
-* Yobi, Project Hosting SW
+* Yona, 21st Century Project Hosting SW
 *
-* Copyright 2012 NAVER Corp.
-* http://yobi.io
-*
-* @author Hwi Ahn
-*
-* 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.
+* Copyright Yona & Yobi Authors & NAVER Corp.
+* https://yona.io
 **@
 @import utils.Config
 @import utils.AccessControl
@@ -43,6 +29,12 @@
     			</form>
              </div>
         </div>
+        @if(currentPage.getTotalRowCount == 0){
+            <div class="error-wrap">
+                <i class="ico ico-err1"></i>
+                <p>@Messages("project.is.empty")</p>
+            </div>
+        } else {
     	<ul class="all-projects">
         @for(project <- currentPage.getList) {
             @if(Config.displayPrivateRepositories() || AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.READ)){
@@ -115,6 +107,7 @@
 
     	<!-- pagination.js will fill here. -->
     	<div id="pagination"></div>
+        }
     </div>
 </div>
 <script type="text/javascript">
Add a comment
List