
Merge branch 'show-numofthreads-pullrequest-list' of laziel/yobi
from pull request 853
@85a36991aef4f119d8ee04f636362b448617fd8e
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
... | ... | @@ -3322,11 +3322,30 @@ |
3322 | 3322 |
i {vertical-align: middle;} |
3323 | 3323 |
|
3324 | 3324 |
.size {margin-right:3px;} |
3325 |
+ .total {color:#777;} |
|
3325 | 3326 |
|
3326 | 3327 |
&:hover { |
3327 | 3328 |
color:#3592b5; |
3328 | 3329 |
text-decoration: none; |
3329 | 3330 |
} |
3331 |
+ &.open { |
|
3332 |
+ color:@state-open !important; |
|
3333 |
+ } |
|
3334 |
+ &.closed { |
|
3335 |
+ color:@state-closed !important; |
|
3336 |
+ .total { color:inherit !important; } |
|
3337 |
+ } |
|
3338 |
+ } |
|
3339 |
+ |
|
3340 |
+ .upload-progress { |
|
3341 |
+ display: inline-block; |
|
3342 |
+ width: 30px; |
|
3343 |
+ vertical-align: middle; |
|
3344 |
+ overflow: hidden; |
|
3345 |
+ margin-top: 3px; |
|
3346 |
+ .border-radius(5px); |
|
3347 |
+ |
|
3348 |
+ .bar { height:100%; } |
|
3330 | 3349 |
} |
3331 | 3350 |
} |
3332 | 3351 |
} |
--- app/models/PullRequest.java
+++ app/models/PullRequest.java
... | ... | @@ -973,6 +973,24 @@ |
973 | 973 |
} |
974 | 974 |
|
975 | 975 |
/** |
976 |
+ * 주어진 {@code state} 상태인 댓글 스레드 갯수를 반환한다 |
|
977 |
+ * |
|
978 |
+ * @param state |
|
979 |
+ * @return |
|
980 |
+ */ |
|
981 |
+ public int countCommentThreadsByState(CommentThread.ThreadState state){ |
|
982 |
+ Integer count = 0; |
|
983 |
+ |
|
984 |
+ for (CommentThread commentThread : commentThreads) { |
|
985 |
+ if(commentThread.state == state){ |
|
986 |
+ count++; |
|
987 |
+ } |
|
988 |
+ } |
|
989 |
+ |
|
990 |
+ return count; |
|
991 |
+ } |
|
992 |
+ |
|
993 |
+ /** |
|
976 | 994 |
* 주어진 {@commitId}의 변경내역을 돌려준다. |
977 | 995 |
* |
978 | 996 |
* @param commitId |
--- app/views/git/partial_list.scala.html
+++ app/views/git/partial_list.scala.html
... | ... | @@ -3,9 +3,6 @@ |
3 | 3 |
@import utils.JodaDateUtil |
4 | 4 |
@import utils.TemplateHelper._ |
5 | 5 |
|
6 |
-@branchName(branch:String) = @{ |
|
7 |
- branch.replace("refs/heads/", "") |
|
8 |
-} |
|
9 | 6 |
<ul class="post-list-wrap"> |
10 | 7 |
@if(page.getList.size()> 0){ |
11 | 8 |
@for(req <- page.getList.iterator()) { |
... | ... | @@ -36,12 +33,22 @@ |
36 | 33 |
<span class="infos-item" title="@JodaDateUtil.getDateString(req.created)"> |
37 | 34 |
@agoOrDateString(req.created) |
38 | 35 |
</span> |
39 |
- @defining(req.commentThreads.size) { count => |
|
40 |
- @if(count > 0) { |
|
41 |
- <a href="@routes.PullRequestApp.pullRequest(req.toProject.owner, req.toProject.name, req.number)#comments" class="infos-item infos-icon-link"> |
|
42 |
- <i class="yobicon-comments"></i> |
|
43 |
- <span class="size">@count</span> |
|
44 |
- </a> |
|
36 |
+ @if(!req.commentThreads.isEmpty){ |
|
37 |
+ @defining(req.countCommentThreadsByState(CommentThread.ThreadState.OPEN)){ countOpen => |
|
38 |
+ <i class="yobicon-post2 vmiddle" style="color:#777;"></i> |
|
39 |
+ <div class="infos-item" style="margin-right:3px"> |
|
40 |
+ <div class="upload-progress"> |
|
41 |
+ <div class="bar orange" style="width: @getPercent(countOpen.toDouble, req.commentThreads.size.toDouble)%;"></div> |
|
42 |
+ </div> |
|
43 |
+ </div> |
|
44 |
+ <a href="@routes.PullRequestApp.pullRequestChanges(req.toProject.owner, req.toProject.name, req.number)" class="infos-item" |
|
45 |
+ data-toggle="tooltip" title="@if(countOpen > 0){@Messages("pullRequest.review.open") / } @Messages("pullRequest.review.total")"> |
|
46 |
+ @if(countOpen > 0){ |
|
47 |
+ <span>@countOpen</span> |
|
48 |
+ <span class="gray-txt">/</span> |
|
49 |
+ } |
|
50 |
+ <span class="size total">@req.commentThreads.size</span> |
|
51 |
+ </a> |
|
45 | 52 |
} |
46 | 53 |
} |
47 | 54 |
</div> |
--- conf/messages
+++ conf/messages
... | ... | @@ -574,6 +574,8 @@ |
574 | 574 |
pullRequest.restore.frombranch.message = can be restored. |
575 | 575 |
pullRequest.reviewed = Reviewed |
576 | 576 |
pullRequest.review.participants = <strong>{0}</strong> participants |
577 |
+pullRequest.review.open = Review threads in Open |
|
578 |
+pullRequest.review.total = Total Review threads |
|
577 | 579 |
pullRequest.select.branch = Select Branch |
578 | 580 |
pullRequest.sender = Sender |
579 | 581 |
pullRequest.sent = Sent Code |
--- conf/messages.ko
+++ conf/messages.ko
... | ... | @@ -576,6 +576,8 @@ |
576 | 576 |
pullRequest.restore.frombranch.message = 브랜치를 복구할 수 있습니다. |
577 | 577 |
pullRequest.reviewed = 리뷰 완료 |
578 | 578 |
pullRequest.review.participants = 참여자 <strong>{0}</strong>명 |
579 |
+pullRequest.review.open = 열려있는 리뷰 |
|
580 |
+pullRequest.review.total = 전체 리뷰 |
|
579 | 581 |
pullRequest.select.branch = 브랜치를 선택하세요. |
580 | 582 |
pullRequest.sender = 보낸 사람 |
581 | 583 |
pullRequest.sent = 보낸 코드 |
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?