[Notice] Announcing the End of Demo Server [Read me]
이응준 2013-10-28
Merge pull request #178 from kjkmadness/yobi refs/heads/bugfix/comments
@48b6b1db7da795831edfe2fb62ae0b341bebaa9c
app/controllers/PullRequestApp.java
--- app/controllers/PullRequestApp.java
+++ app/controllers/PullRequestApp.java
@@ -503,13 +503,13 @@
 
         Call call = routes.PullRequestApp.pullRequest(userName, projectName, pullRequestNumber);
 
-        addNotification(pullRequest, call);
+        addNotification(pullRequest, call, State.OPEN, State.CLOSED);
 
         return redirect(call);
     }
 
-    private static void addNotification(PullRequest pullRequest, Call call) {
-        NotificationEvent notiEvent = NotificationEvent.addPullRequestUpdate(call, request(), pullRequest, State.OPEN, State.CLOSED);
+    private static void addNotification(PullRequest pullRequest, Call call, State from, State to) {
+        NotificationEvent notiEvent = NotificationEvent.addPullRequestUpdate(call, request(), pullRequest, from, to);
         PullRequestEvent.addEvent(notiEvent, pullRequest);
     }
 
@@ -536,7 +536,7 @@
 
         Call call = routes.PullRequestApp.pullRequest(userName, projectName, pullRequestNumber);
 
-        addNotification(pullRequest, call);
+        addNotification(pullRequest, call, State.OPEN, State.REJECTED);
 
         return redirect(call);
     }
@@ -564,7 +564,7 @@
 
         Call call = routes.PullRequestApp.pullRequest(userName, projectName, pullRequestNumber);
 
-        addNotification(pullRequest, call);
+        addNotification(pullRequest, call, State.REJECTED, State.OPEN);
 
         return redirect(call);
     }
app/models/PullRequestComment.java
--- app/models/PullRequestComment.java
+++ app/models/PullRequestComment.java
@@ -79,7 +79,7 @@
 
             @Override
             public Project getProject() {
-                return null;
+                return pullRequest.asResource().getProject();
             }
 
             @Override
app/views/git/list.scala.html
--- app/views/git/list.scala.html
+++ app/views/git/list.scala.html
@@ -1,4 +1,5 @@
 @(project: Project, page: com.avaje.ebean.Page[PullRequest], requestType: String)
+@import utils.AccessControl
 
 @projectLayout(Messages("menu.pullRequest"), project, utils.MenuType.PULL_REQUEST) {
 <div class="page">
@@ -11,10 +12,20 @@
             @Messages("pullRequest")
         </a>
         }
+        
+        @** 이 프로젝트가 복사본이 아니며, 현재 사용자가 복사본을 갖고 있고, 코드보내기 권한이 있는 경우 **@
+        @defining(Project.findByOwnerAndOriginalProject(UserApp.currentUser().loginId, project)){ myFork =>
+        @if(!project.isFork && myFork != null && AccessControl.isProjectResourceCreatable(UserApp.currentUser(), project, ResourceType.PULL_REQUEST)){
+        <a href="@routes.PullRequestApp.newPullRequestForm(myFork.owner, myFork.name)" class="ybtn ybtn-success">
+            <i class="yobicon-split yobicon-large"></i>
+            @Messages("pullRequest.toHere")
+        </a>
+        }
+        }
     </div>
 
     @if(project.hasForks() || project.isFork()) {
-    <ul class="nav nav-tabs cb">
+    <ul class="nav nav-tabs">
         @if(project.hasForks()){
             <li @if(requestType.equals("opened")){class="active"}>
                 <a href="@routes.PullRequestApp.pullRequests(project.owner, project.name)">
conf/messages
--- conf/messages
+++ conf/messages
@@ -495,6 +495,7 @@
 pullRequest.title.required = Input title.
 pullRequest.to = To
 pullRequest.toBranch.required = Select a branch that will receives the sending code.
+pullRequest.toHere = New PullRequest
 site = Site
 site.features.codeManagement = All your codes are stored in a version controlled system safely.
 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
+++ conf/messages.ja
@@ -496,6 +496,7 @@
 pullRequest.title.required = タイトルを入力してください
 pullRequest.to = コード 受ける場所
 pullRequest.toBranch.required = コードを受けてもらいたいブランチを選んでください
+pullRequest.toHere = こちらへプルリクエスト
 site = サイト
 site.features.codeManagement = All your codes are stored in a version controlled system safely.
 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
+++ conf/messages.ko
@@ -496,6 +496,7 @@
 pullRequest.title.required = 제목을 입력하세요.
 pullRequest.to = 코드 받을 곳
 pullRequest.toBranch.required = 코드를 받을 브랜치를 선택하세요.
+pullRequest.toHere = 이 프로젝트에 코드 보내기
 site = 사이트
 site.features.codeManagement = 작성한 코드는 모두 이력이 관리되는 형태로 안전하게 서버에 보관됩니다.
 site.features.codeReview = 변경된 코드를 보면서 팀원들과 토론해보세요. 코드의 완성도를 더욱 높일 수 있습니다.
Add a comment
List