[Notice] Announcing the End of Demo Server [Read me]
doortts doortts 2017-04-22
site-admin: Change ordering of lists
@c9547404882d879d6b01b2501163d62ef2993e5c
app/controllers/SiteApp.java
--- app/controllers/SiteApp.java
+++ app/controllers/SiteApp.java
@@ -1,23 +1,9 @@
 /**
- * Yobi, 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.
- */
+ * Yona, 21st Century Project Hosting SW
+ * <p>
+ * Copyright Yona & Yobi Authors & NAVER Corp.
+ * https://yona.io
+ **/
 package controllers;
 
 import com.avaje.ebean.Page;
app/models/Project.java
--- app/models/Project.java
+++ app/models/Project.java
@@ -152,6 +152,10 @@
 
     public static Page<Project> findByName(String name, int pageSize,
                                            int pageNum) {
+        if(StringUtils.isBlank(name)){
+            return find.where().order().desc("createdDate").findPagingList(pageSize).getPage(pageNum);
+        }
+
         return find.where().ilike("name", "%" + decodeUrlString(name) + "%")
                 .findPagingList(pageSize).getPage(pageNum);
     }
app/models/User.java
--- app/models/User.java
+++ app/models/User.java
@@ -383,7 +383,7 @@
             el.endJunction();
         }
 
-        return el.findPagingList(USER_COUNT_PER_PAGE).getPage(pageNum);
+        return el.order().desc("createdDate").findPagingList(USER_COUNT_PER_PAGE).getPage(pageNum);
     }
 
     /**
app/views/site/projectList.scala.html
--- app/views/site/projectList.scala.html
+++ app/views/site/projectList.scala.html
@@ -1,26 +1,13 @@
 @**
-* 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
 **@
 @(message: String, currentPage: com.avaje.ebean.Page[Project], filter:String)
 
 @import utils.TemplateHelper._
+@import utils.JodaDateUtil._
 
 @siteMngLayout(message) {
     <div class="title_area">
@@ -54,10 +41,13 @@
                     @project.owner/@project.name
                 </a>
             </div>
-            <div class="span5 listitem-col">
+            <div class="span4 listitem-col">
               @project.overview
             </div>
             <div class="span2 listitem-col">
+            @geYMDDate(project.createdDate)
+            </div>
+            <div class="span1 listitem-col">
                 <button class="ybtn ybtn-danger" data-project-name="@project.owner/@project.name" data-toggle="delete-project" data-href="@routes.SiteApp.deleteProject(project.id)">@Messages("button.delete")</button>
             </div>
         </li>
Add a comment
List