Skip to content

Commit

Permalink
projects: Show no projects message
Browse files Browse the repository at this point in the history
See: Yona Github issue #200 #204
  • Loading branch information
doortts committed Apr 16, 2017
1 parent b1f7061 commit 1e07cac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 39 deletions.
27 changes: 5 additions & 22 deletions app/controllers/ProjectApp.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -1001,9 +987,6 @@ private static Result getPagingProjects(String query, int pageNum) {

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));
}
Expand Down
27 changes: 10 additions & 17 deletions app/views/project/list.scala.html
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -43,6 +29,12 @@ <h3>@Messages("project.public") @Messages("title.projectList")</h3>
</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)){
Expand Down Expand Up @@ -115,6 +107,7 @@ <h3>@Messages("project.public") @Messages("title.projectList")</h3>

<!-- pagination.js will fill here. -->
<div id="pagination"></div>
}
</div>
</div>
<script type="text/javascript">
Expand Down

0 comments on commit 1e07cac

Please sign in to comment.