[Notice] Announcing the End of Demo Server [Read me]
--- app/controllers/ProjectApp.java
+++ app/controllers/ProjectApp.java
... | ... | @@ -1,5 +1,6 @@ |
1 | 1 |
package controllers; |
2 | 2 |
|
3 |
+import com.avaje.ebean.Ebean; |
|
3 | 4 |
import com.avaje.ebean.ExpressionList; |
4 | 5 |
import com.avaje.ebean.Page; |
5 | 6 |
import models.Project; |
... | ... | @@ -21,6 +22,8 @@ |
21 | 22 |
import views.html.project.*; |
22 | 23 |
|
23 | 24 |
import java.io.File; |
25 |
+import java.util.Collections; |
|
26 |
+import java.util.List; |
|
24 | 27 |
|
25 | 28 |
import static play.data.Form.form; |
26 | 29 |
|
... | ... | @@ -248,7 +251,11 @@ |
248 | 251 |
} if (state.equals("private")) { |
249 | 252 |
el.eq("share_option", false); |
250 | 253 |
} |
254 |
+ |
|
255 |
+ // TODO change simple sorted projectList to Paging List |
|
256 |
+ List<Project> filteredList = Ebean.filter(Project.class).sort("date desc").filter(el.findList()); |
|
257 |
+ |
|
251 | 258 |
Page<Project> projects = el.findPagingList(25).getPage(0); |
252 |
- return ok(projectList.render("title.projectList", projects, filter, state)); |
|
259 |
+ return ok(projectList.render("title.projectList", filteredList, filter, state)); |
|
253 | 260 |
} |
254 | 261 |
} |
--- app/views/project/projectList.scala.html
+++ app/views/project/projectList.scala.html
... | ... | @@ -1,4 +1,4 @@ |
1 |
-@(message: String, currentPage: com.avaje.ebean.Page[Project], filter:String, state:String) |
|
1 |
+@(message: String, currentPage: List[Project], filter:String, state:String) |
|
2 | 2 |
|
3 | 3 |
@home(message, utils.MenuType.PROJECTS) { |
4 | 4 |
<div class="page"> |
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 |
</div> |
24 | 24 |
</div> |
25 | 25 |
<ul class="all-projects"> |
26 |
- @for(project <- currentPage.getList()) { |
|
26 |
+ @for(project <- currentPage) { |
|
27 | 27 |
<li class="project"> |
28 | 28 |
<div class="info-wrap"> |
29 | 29 |
<div class="header"> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?