my-issues: Change sorting order - updated first
@61ffbe6f02181dff6a5ba6795aa8e1e8188fa1f0
--- app/controllers/IssueApp.java
+++ app/controllers/IssueApp.java
... | ... | @@ -76,6 +76,12 @@ |
76 | 76 |
} |
77 | 77 |
searchCondition.pageNum = pageNum - 1; |
78 | 78 |
|
79 |
+ // default for my issues |
|
80 |
+ String orderBy = request().getQueryString("orderBy"); |
|
81 |
+ if (StringUtils.isBlank(orderBy)) { |
|
82 |
+ searchCondition.orderBy = "updatedDate"; |
|
83 |
+ } |
|
84 |
+ |
|
79 | 85 |
// determine pjax or json when requested with XHR |
80 | 86 |
if (HttpUtil.isRequestedWithXHR(request())) { |
81 | 87 |
format = HttpUtil.isPJAXRequest(request()) ? "pjax" : "json"; |
... | ... | @@ -819,6 +825,9 @@ |
819 | 825 |
IssueEvent.addFromNotificationEvent( |
820 | 826 |
NotificationEvent.afterStateChanged(issue.previousState(), issue), |
821 | 827 |
issue, UserApp.currentUser().loginId); |
828 |
+ } else { |
|
829 |
+ issue.updatedDate = JodaDateUtil.now(); |
|
830 |
+ issue.update(); |
|
822 | 831 |
} |
823 | 832 |
|
824 | 833 |
return redirect(RouteUtil.getUrl(savedComment)); |
--- app/models/AbstractPosting.java
+++ app/models/AbstractPosting.java
... | ... | @@ -146,6 +146,8 @@ |
146 | 146 |
super.update(); |
147 | 147 |
} catch (PersistenceException ole) { |
148 | 148 |
play.Logger.warn("PersistenceException: " + ole.getMessage()); |
149 |
+ } catch (Exception e) { |
|
150 |
+ play.Logger.warn(e.getMessage()); |
|
149 | 151 |
} |
150 | 152 |
updateMention(); |
151 | 153 |
} |
--- app/utils/TemplateHelper.scala
+++ app/utils/TemplateHelper.scala
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 |
import models._ |
19 | 19 |
import java.net.URLEncoder |
20 | 20 |
import java.util |
21 |
+import java.util.Date |
|
21 | 22 |
|
22 | 23 |
import scala.annotation.tailrec |
23 | 24 |
import playRepository.FileDiff |
... | ... | @@ -95,11 +96,15 @@ |
95 | 96 |
} |
96 | 97 |
|
97 | 98 |
def agoOrDateString(date: java.util.Date) = { |
99 |
+ var year = JodaDateUtil.getDateString(date, "yyyy") |
|
100 |
+ var thisYear = JodaDateUtil.getDateString(new Date(), "yyyy") |
|
98 | 101 |
val ago = JodaDateUtil.ago(date) |
99 | 102 |
if (ago.getStandardDays < 8) { |
100 |
- agoString(ago) |
|
103 |
+ agoString(ago) |
|
104 |
+ } else if (thisYear.equals(year)) { |
|
105 |
+ JodaDateUtil.getDateString(date, "MM-dd") |
|
101 | 106 |
} else { |
102 |
- JodaDateUtil.getDateString(date, "yyyy-MM-dd") |
|
107 |
+ JodaDateUtil.getDateString(date, "yyyy-MM-dd") |
|
103 | 108 |
} |
104 | 109 |
} |
105 | 110 |
|
--- app/views/issue/my_partial_list.scala.html
+++ app/views/issue/my_partial_list.scala.html
... | ... | @@ -51,6 +51,11 @@ |
51 | 51 |
<span class="infos-item" data-toggle="tooltip" data-placement="bottom" title="@JodaDateUtil.getDateString(issue.createdDate)"> |
52 | 52 |
@agoOrDateString(issue.createdDate) |
53 | 53 |
</span> |
54 |
+ @if(!issue.createdDate.equals(issue.updatedDate)) { |
|
55 |
+ <span class="infos-item" data-toggle="tooltip" data-placement="bottom" title="@JodaDateUtil.getDateString(issue.updatedDate)"> |
|
56 |
+ update: @agoOrDateString(issue.updatedDate) |
|
57 |
+ </span> |
|
58 |
+ } |
|
54 | 59 |
|
55 | 60 |
@partial_list_subtask(project, issue) |
56 | 61 |
|
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?