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

Merge pull request #178 from kjkmadness/yobi refs/heads/bugfix/comments
@48b6b1db7da795831edfe2fb62ae0b341bebaa9c
--- app/controllers/PullRequestApp.java
+++ app/controllers/PullRequestApp.java
... | ... | @@ -503,13 +503,13 @@ |
503 | 503 |
|
504 | 504 |
Call call = routes.PullRequestApp.pullRequest(userName, projectName, pullRequestNumber); |
505 | 505 |
|
506 |
- addNotification(pullRequest, call); |
|
506 |
+ addNotification(pullRequest, call, State.OPEN, State.CLOSED); |
|
507 | 507 |
|
508 | 508 |
return redirect(call); |
509 | 509 |
} |
510 | 510 |
|
511 |
- private static void addNotification(PullRequest pullRequest, Call call) { |
|
512 |
- NotificationEvent notiEvent = NotificationEvent.addPullRequestUpdate(call, request(), pullRequest, State.OPEN, State.CLOSED); |
|
511 |
+ private static void addNotification(PullRequest pullRequest, Call call, State from, State to) { |
|
512 |
+ NotificationEvent notiEvent = NotificationEvent.addPullRequestUpdate(call, request(), pullRequest, from, to); |
|
513 | 513 |
PullRequestEvent.addEvent(notiEvent, pullRequest); |
514 | 514 |
} |
515 | 515 |
|
... | ... | @@ -536,7 +536,7 @@ |
536 | 536 |
|
537 | 537 |
Call call = routes.PullRequestApp.pullRequest(userName, projectName, pullRequestNumber); |
538 | 538 |
|
539 |
- addNotification(pullRequest, call); |
|
539 |
+ addNotification(pullRequest, call, State.OPEN, State.REJECTED); |
|
540 | 540 |
|
541 | 541 |
return redirect(call); |
542 | 542 |
} |
... | ... | @@ -564,7 +564,7 @@ |
564 | 564 |
|
565 | 565 |
Call call = routes.PullRequestApp.pullRequest(userName, projectName, pullRequestNumber); |
566 | 566 |
|
567 |
- addNotification(pullRequest, call); |
|
567 |
+ addNotification(pullRequest, call, State.REJECTED, State.OPEN); |
|
568 | 568 |
|
569 | 569 |
return redirect(call); |
570 | 570 |
} |
--- app/models/PullRequestComment.java
+++ app/models/PullRequestComment.java
... | ... | @@ -79,7 +79,7 @@ |
79 | 79 |
|
80 | 80 |
@Override |
81 | 81 |
public Project getProject() { |
82 |
- return null; |
|
82 |
+ return pullRequest.asResource().getProject(); |
|
83 | 83 |
} |
84 | 84 |
|
85 | 85 |
@Override |
--- app/views/git/list.scala.html
+++ app/views/git/list.scala.html
... | ... | @@ -1,4 +1,5 @@ |
1 | 1 |
@(project: Project, page: com.avaje.ebean.Page[PullRequest], requestType: String) |
2 |
+@import utils.AccessControl |
|
2 | 3 |
|
3 | 4 |
@projectLayout(Messages("menu.pullRequest"), project, utils.MenuType.PULL_REQUEST) { |
4 | 5 |
<div class="page"> |
... | ... | @@ -11,10 +12,20 @@ |
11 | 12 |
@Messages("pullRequest") |
12 | 13 |
</a> |
13 | 14 |
} |
15 |
+ |
|
16 |
+ @** 이 프로젝트가 복사본이 아니며, 현재 사용자가 복사본을 갖고 있고, 코드보내기 권한이 있는 경우 **@ |
|
17 |
+ @defining(Project.findByOwnerAndOriginalProject(UserApp.currentUser().loginId, project)){ myFork => |
|
18 |
+ @if(!project.isFork && myFork != null && AccessControl.isProjectResourceCreatable(UserApp.currentUser(), project, ResourceType.PULL_REQUEST)){ |
|
19 |
+ <a href="@routes.PullRequestApp.newPullRequestForm(myFork.owner, myFork.name)" class="ybtn ybtn-success"> |
|
20 |
+ <i class="yobicon-split yobicon-large"></i> |
|
21 |
+ @Messages("pullRequest.toHere") |
|
22 |
+ </a> |
|
23 |
+ } |
|
24 |
+ } |
|
14 | 25 |
</div> |
15 | 26 |
|
16 | 27 |
@if(project.hasForks() || project.isFork()) { |
17 |
- <ul class="nav nav-tabs cb"> |
|
28 |
+ <ul class="nav nav-tabs"> |
|
18 | 29 |
@if(project.hasForks()){ |
19 | 30 |
<li @if(requestType.equals("opened")){class="active"}> |
20 | 31 |
<a href="@routes.PullRequestApp.pullRequests(project.owner, project.name)"> |
--- conf/messages
+++ conf/messages
... | ... | @@ -495,6 +495,7 @@ |
495 | 495 |
pullRequest.title.required = Input title. |
496 | 496 |
pullRequest.to = To |
497 | 497 |
pullRequest.toBranch.required = Select a branch that will receives the sending code. |
498 |
+pullRequest.toHere = New PullRequest |
|
498 | 499 |
site = Site |
499 | 500 |
site.features.codeManagement = All your codes are stored in a version controlled system safely. |
500 | 501 |
site.features.codeReview = You can review all changes on code with your team before merging. Discussion makes your code better. |
--- conf/messages.ja
+++ conf/messages.ja
... | ... | @@ -496,6 +496,7 @@ |
496 | 496 |
pullRequest.title.required = タイトルを入力してください |
497 | 497 |
pullRequest.to = コード 受ける場所 |
498 | 498 |
pullRequest.toBranch.required = コードを受けてもらいたいブランチを選んでください |
499 |
+pullRequest.toHere = こちらへプルリクエスト |
|
499 | 500 |
site = サイト |
500 | 501 |
site.features.codeManagement = All your codes are stored in a version controlled system safely. |
501 | 502 |
site.features.codeReview = You can review all changes on code with your team before merging. Discussion makes your code better. |
--- conf/messages.ko
+++ conf/messages.ko
... | ... | @@ -496,6 +496,7 @@ |
496 | 496 |
pullRequest.title.required = 제목을 입력하세요. |
497 | 497 |
pullRequest.to = 코드 받을 곳 |
498 | 498 |
pullRequest.toBranch.required = 코드를 받을 브랜치를 선택하세요. |
499 |
+pullRequest.toHere = 이 프로젝트에 코드 보내기 |
|
499 | 500 |
site = 사이트 |
500 | 501 |
site.features.codeManagement = 작성한 코드는 모두 이력이 관리되는 형태로 안전하게 서버에 보관됩니다. |
501 | 502 |
site.features.codeReview = 변경된 코드를 보면서 팀원들과 토론해보세요. 코드의 완성도를 더욱 높일 수 있습니다. |
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?