[Notice] Announcing the End of Demo Server [Read me]
feature: add sorted view myproject list in front page
@26b348e388f0506529c0e69afba58e0a7b1dd91d
--- app/views/index.scala.html
+++ app/views/index.scala.html
... | ... | @@ -274,13 +274,38 @@ |
274 | 274 |
|
275 | 275 |
<div class="project-count-wrap"> |
276 | 276 |
@Messages("project.myproject") <i>·</i><span class="p-num">@projects.size()</span> |
277 |
+ <div class="project-list-sort"> |
|
278 |
+ <span class="ordertype-date"> |
|
279 |
+ @if( orderString == "createdDate desc" ){ |
|
280 |
+ <a href="@routes.Application.index()?order=createdDate"><strong>@Messages("orderby.recent")</strong> <i class="icon-chevron-down"></i></a> |
|
281 |
+ } else { |
|
282 |
+ @if( orderString == "createdDate" ){ |
|
283 |
+ <a href="@routes.Application.index()?order=createdDate desc"><strong>@Messages("orderby.recent")</strong> <i class="icon-chevron-up"></i></a> |
|
284 |
+ } else { |
|
285 |
+ <a href="@routes.Application.index()?order=createdDate">@Messages("orderby.recent")</a> |
|
286 |
+ } |
|
287 |
+ } |
|
288 |
+ </span><span class="delimeter"> | </span><span class="ordertype-name"> |
|
289 |
+ @if( orderString == "name desc" ){ |
|
290 |
+ <a href="@routes.Application.index()?order=name"><strong>@Messages("orderby.name")</strong> <i class="icon-chevron-down"></i></a> |
|
291 |
+ } else { |
|
292 |
+ @if( orderString == "name" ){ |
|
293 |
+ <a href="@routes.Application.index()?order=name desc"><strong>@Messages("orderby.name")</strong> <i class="icon-chevron-up"></i></a> |
|
294 |
+ } else { |
|
295 |
+ <a href="@routes.Application.index()?order=name">@Messages("orderby.name")</a> |
|
296 |
+ } |
|
297 |
+ } |
|
298 |
+ </span> |
|
299 |
+ </div> |
|
277 | 300 |
</div> |
301 |
+ |
|
278 | 302 |
|
279 | 303 |
<div class="my-projects"> |
280 | 304 |
<ul class="unstyled"> |
281 |
- @myProjectList(projects) |
|
305 |
+ @myProjectList(projects, orderString) |
|
282 | 306 |
</ul> |
283 | 307 |
|
308 |
+ |
|
284 | 309 |
<div class="btn-wrap"> |
285 | 310 |
<a href="@routes.ProjectApp.newProjectForm()"><i class="ico ico-pencil"></i> @Messages("button.newProject")</a> |
286 | 311 |
</div> |
--- app/views/myProjectList.scala.html
+++ app/views/myProjectList.scala.html
... | ... | @@ -1,4 +1,4 @@ |
1 |
-@(projects:List[Project]) |
|
1 |
+@(projects:List[Project], orderString:String) |
|
2 | 2 |
@import utils.TemplateHelper._ |
3 | 3 |
@if(projects != null){ |
4 | 4 |
@for(project <- projects){ |
... | ... | @@ -17,6 +17,7 @@ |
17 | 17 |
<div class="ico-wrap"> |
18 | 18 |
<i class="ico ico-gray-arrow-right"></i> |
19 | 19 |
</div> |
20 |
+ |
|
20 | 21 |
<div class="project-detail hidden"> |
21 | 22 |
<ul class="contributors unstyled"> |
22 | 23 |
@project.projectUser.map{ member => |
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?