[Notice] Announcing the End of Demo Server [Read me]

Merge branch 'improve/pullrequest-list-140729' of dlab/hive
from pull request 1184
@d8a65c621e723e8a4d17069481851882c85a86d1
--- app/models/User.java
+++ app/models/User.java
... | ... | @@ -558,6 +558,7 @@ |
558 | 558 |
String sql = "SELECT user.id, user.name, user.login_id FROM pull_request pullrequest, n4user user WHERE pullrequest.contributor_id = user.id GROUP BY pullrequest.contributor_id"; |
559 | 559 |
return createUserSearchQueryWithRawSql(sql).where() |
560 | 560 |
.eq("pullrequest.to_project_id", projectId) |
561 |
+ .orderBy("user.name ASC") |
|
561 | 562 |
.findList(); |
562 | 563 |
} |
563 | 564 |
|
--- app/views/git/list.scala.html
+++ app/views/git/list.scala.html
... | ... | @@ -28,6 +28,9 @@ |
28 | 28 |
@views.html.git.partial_search(project, page, condition, requestType) |
29 | 29 |
</div> |
30 | 30 |
</div> |
31 |
+ |
|
32 |
+@common.select2() |
|
33 |
+ |
|
31 | 34 |
<script type="text/javascript"> |
32 | 35 |
$(document).ready(function(){ |
33 | 36 |
var htPjaxOptions = { |
--- app/views/git/partial_search.scala.html
+++ app/views/git/partial_search.scala.html
... | ... | @@ -58,32 +58,22 @@ |
58 | 58 |
<dl class="issue-option"> |
59 | 59 |
<dt>@Messages("pullRequest.sender")</dt> |
60 | 60 |
<dd> |
61 |
- <div class="btn-group" data-name="contributorId"> |
|
62 |
- <button class="btn dropdown-toggle auto" data-toggle="dropdown"> |
|
63 |
- <span class="d-label">@Messages("common.order.all")</span> |
|
64 |
- <span class="d-caret"><span class="caret"></span></span> |
|
65 |
- </button> |
|
66 |
- <ul class="dropdown-menu"> |
|
67 |
- <li data-value=""><a>@Messages("common.order.all")</a></li> |
|
68 |
- @defining(User.findPullRequestContributorsByProjectId(project.id)){ contributors => |
|
61 |
+ <select id="contributors" name="contributorId" data-format="user"> |
|
62 |
+ @defining(User.findPullRequestContributorsByProjectId(project.id)){ contributors => |
|
63 |
+ <option value="">@Messages("common.order.all")</option> |
|
69 | 64 |
@if(contributors.contains(UserApp.currentUser)){ |
70 |
- <li data-value="@UserApp.currentUser().id"><a>@Messages("pullRequest.sentByMe")</a></li> |
|
65 |
+ <option value="@UserApp.currentUser().id">@Messages("pullRequest.sentByMe")</option> |
|
71 | 66 |
} |
72 |
- <li class="divider"></li> |
|
73 | 67 |
@for(contributor <- contributors){ |
74 |
- <li data-value="@contributor.id" @if(condition.contributorId != null && condition.contributorId == contributor.id){data-selected="true" class="active"}> |
|
75 |
- <a class="usf-group"> |
|
76 |
- <span class="avatar-wrap smaller"> |
|
77 |
- <img src="@contributor.avatarUrl" width="20" height="20"> |
|
78 |
- </span> |
|
79 |
- <strong class="name">@contributor.name</strong> |
|
80 |
- <span class="loginid"> <strong>@{"@"}</strong>@contributor.loginId</span> |
|
81 |
- </a> |
|
82 |
- </li> |
|
68 |
+ <option value="@contributor.id" |
|
69 |
+ data-avatar-url="@contributor.avatarUrl" |
|
70 |
+ data-login-id="@contributor.loginId" |
|
71 |
+ @if(condition.contributorId != null && condition.contributorId == contributor.id){selected}> |
|
72 |
+ @contributor.name |
|
73 |
+ </option> |
|
83 | 74 |
} |
84 |
- } |
|
85 |
- </ul> |
|
86 |
- </div> |
|
75 |
+ } |
|
76 |
+ </select> |
|
87 | 77 |
</dd> |
88 | 78 |
</dl> |
89 | 79 |
</div> |
... | ... | @@ -132,12 +122,9 @@ |
132 | 122 |
</div> |
133 | 123 |
</div> |
134 | 124 |
<script type="text/javascript"> |
135 |
- $(document).ready(function(){ |
|
136 |
- var oSearchContributor = new yobi.ui.Dropdown({ |
|
137 |
- 'elContainer': $('div[data-name="contributorId"]'), |
|
138 |
- 'fOnChange' : function() { |
|
139 |
- $('#search').submit(); |
|
140 |
- } |
|
125 |
+ $(function(){ |
|
126 |
+ yobi.ui.Select2("#contributors").on("change", function(){ |
|
127 |
+ $('#search').submit(); |
|
141 | 128 |
}); |
142 | 129 |
}); |
143 | 130 |
</script> |
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?