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

Merge pull request #137 from laziel/yobi refs/heads/yobi-401
@50ece880f795427ab4a7964e9806283bd8741b8d
--- app/controllers/ProjectApp.java
+++ app/controllers/ProjectApp.java
... | ... | @@ -339,13 +339,13 @@ |
339 | 339 |
if (AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.DELETE)) { |
340 | 340 |
RepositoryService.deleteRepository(loginId, projectName, project.vcs); |
341 | 341 |
project.delete(); |
342 |
- |
|
342 |
+ |
|
343 | 343 |
// XHR 호출에 의한 경우라면 204 No Content 와 Location 헤더로 응답한다 |
344 | 344 |
if(HttpUtil.isRequestedWithXHR(request())){ |
345 | 345 |
response().setHeader("Location", routes.Application.index().toString()); |
346 |
- return status(204); |
|
346 |
+ return status(204); |
|
347 | 347 |
} |
348 |
- |
|
348 |
+ |
|
349 | 349 |
return redirect(routes.Application.index()); |
350 | 350 |
} else { |
351 | 351 |
flash(Constants.WARNING, "project.member.isManager"); |
... | ... | @@ -511,7 +511,12 @@ |
511 | 511 |
if(!commitId.isEmpty()) { |
512 | 512 |
addCommitAuthor(RepositoryService.getRepository(pullRequest.fromProject).getCommit(commitId), userList); |
513 | 513 |
} |
514 |
- userList.add(pullRequest.contributor); |
|
514 |
+ |
|
515 |
+ User contributor = pullRequest.contributor; |
|
516 |
+ if(!userList.contains(contributor)) { |
|
517 |
+ userList.add(contributor); |
|
518 |
+ } |
|
519 |
+ |
|
515 | 520 |
userList.remove(UserApp.currentUser()); |
516 | 521 |
|
517 | 522 |
List<Map<String, String>> mentionList = new ArrayList<>(); |
--- app/models/Issue.java
+++ app/models/Issue.java
... | ... | @@ -344,9 +344,11 @@ |
344 | 344 |
public boolean assignedUserEquals(Assignee otherAssignee) { |
345 | 345 |
if (assignee == null || assignee.user == null || assignee.user.isAnonymous()) { |
346 | 346 |
return otherAssignee == null || otherAssignee.user == null || otherAssignee.user.isAnonymous(); |
347 |
- } else { |
|
348 |
- return assignee.equals(otherAssignee) || assignee.user.equals(otherAssignee.user); |
|
349 | 347 |
} |
348 |
+ if (otherAssignee == null || otherAssignee.user == null || otherAssignee.user.isAnonymous()) { |
|
349 |
+ return assignee == null || assignee.user == null || assignee.user.isAnonymous(); |
|
350 |
+ } |
|
351 |
+ return assignee.equals(otherAssignee) || assignee.user.equals(otherAssignee.user); |
|
350 | 352 |
} |
351 | 353 |
|
352 | 354 |
/** |
--- app/models/PullRequestComment.java
+++ app/models/PullRequestComment.java
... | ... | @@ -152,16 +152,18 @@ |
152 | 152 |
path = path.substring(1); |
153 | 153 |
} |
154 | 154 |
|
155 |
+ Repository mergedRepository = pullRequest.getMergedRepository(); |
|
156 |
+ |
|
155 | 157 |
if (commitId.equals(commitA)) { |
156 | 158 |
_isOutdated = !noChangesBetween(GitRepository.buildGitRepository(pullRequest.toProject), |
157 |
- pullRequest.toBranch, commitId, path, line); |
|
159 |
+ pullRequest.toBranch, mergedRepository, commitId, path, line); |
|
158 | 160 |
} else { |
159 | 161 |
if (!commitId.equals(commitB)) { |
160 | 162 |
play.Logger.warn( |
161 | 163 |
"Invalid PullRequestComment.commitId: It must equal to commitA or commitB."); |
162 | 164 |
} |
163 | 165 |
_isOutdated = !noChangesBetween(GitRepository.buildGitRepository(pullRequest.fromProject), |
164 |
- pullRequest.fromBranch, commitId, path, line); |
|
166 |
+ pullRequest.fromBranch, mergedRepository, commitId, path, line); |
|
165 | 167 |
} |
166 | 168 |
|
167 | 169 |
return _isOutdated; |
... | ... | @@ -210,10 +212,11 @@ |
210 | 212 |
* @return |
211 | 213 |
* @throws IOException |
212 | 214 |
*/ |
213 |
- static private boolean noChangesBetween(Repository gitRepo, String rev1, String rev2, |
|
215 |
+ static private boolean noChangesBetween(Repository repoA, String rev1, |
|
216 |
+ Repository repoB, String rev2, |
|
214 | 217 |
String path, Integer line) throws IOException { |
215 |
- String a = getLastChangedCommitUntil(gitRepo, rev1, path, line); |
|
216 |
- String b = getLastChangedCommitUntil(gitRepo, rev2, path, line); |
|
218 |
+ String a = getLastChangedCommitUntil(repoA, rev1, path, line); |
|
219 |
+ String b = getLastChangedCommitUntil(repoB, rev2, path, line); |
|
217 | 220 |
|
218 | 221 |
return a.equals(b); |
219 | 222 |
} |
--- app/utils/TemplateHelper.scala
+++ app/utils/TemplateHelper.scala
... | ... | @@ -16,6 +16,8 @@ |
16 | 16 |
import views.html.partial_diff_line |
17 | 17 |
import models.PullRequestComment |
18 | 18 |
import models.TimelineItem |
19 |
+import models.Project |
|
20 |
+import java.net.URLEncoder |
|
19 | 21 |
|
20 | 22 |
object TemplateHelper { |
21 | 23 |
|
... | ... | @@ -100,6 +102,56 @@ |
100 | 102 |
} |
101 | 103 |
} |
102 | 104 |
|
105 |
+ def branchItemType(branch: String) = { |
|
106 |
+ var names = branch.split('/'); |
|
107 |
+ |
|
108 |
+ if(names(0).equals("refs") && names.length >= 3){ |
|
109 |
+ names(1) match { |
|
110 |
+ case "heads" => "branch" |
|
111 |
+ case "tags" => "tag" |
|
112 |
+ case _ => names(1) |
|
113 |
+ } |
|
114 |
+ } else { |
|
115 |
+ branch |
|
116 |
+ } |
|
117 |
+ } |
|
118 |
+ |
|
119 |
+ def branchItemName(branch: String) = { |
|
120 |
+ var names = branch.split('/'); |
|
121 |
+ |
|
122 |
+ if(names(0).equals("refs") && names.length >= 3){ |
|
123 |
+ names.slice(2, names.length).mkString("/"); |
|
124 |
+ } else { |
|
125 |
+ branch |
|
126 |
+ } |
|
127 |
+ } |
|
128 |
+ |
|
129 |
+ def branchInHTML(branch: String) = { |
|
130 |
+ var names = branch.split('/'); |
|
131 |
+ var branchType = branchItemType(branch); |
|
132 |
+ var branchName = branchItemName(branch); |
|
133 |
+ |
|
134 |
+ if(names(0).equals("refs") && names.length >= 3){ |
|
135 |
+ "<span class=\"label " + branchType + "\">" + branchType + "</span>" + branchName |
|
136 |
+ } else { |
|
137 |
+ branch |
|
138 |
+ } |
|
139 |
+ } |
|
140 |
+ |
|
141 |
+ def getBranchURL(project:Project, branchName:String, viewType:String, path:String) = { |
|
142 |
+ viewType match { |
|
143 |
+ case "history" => { |
|
144 |
+ routes.CodeHistoryApp.history(project.owner, project.name, URLEncoder.encode(branchName, "UTF-8"), null) |
|
145 |
+ } |
|
146 |
+ case "code" => { |
|
147 |
+ routes.CodeApp.codeBrowserWithBranch(project.owner, project.name, URLEncoder.encode(branchName, "UTF-8"), path) |
|
148 |
+ } |
|
149 |
+ case _ => { |
|
150 |
+ "#" |
|
151 |
+ } |
|
152 |
+ } |
|
153 |
+ } |
|
154 |
+ |
|
103 | 155 |
object DiffRenderer { |
104 | 156 |
|
105 | 157 |
def removedWord(word: String) = "<span class='remove'>" + word + "</span>" |
--- app/views/code/diff.scala.html
+++ app/views/code/diff.scala.html
... | ... | @@ -6,31 +6,9 @@ |
6 | 6 |
@import utils.JodaDateUtil._ |
7 | 7 |
@import utils.AccessControl._ |
8 | 8 |
|
9 |
-@branchItemType(itemType:String) = @{ |
|
10 |
- if(itemType == "heads"){ |
|
11 |
- "branch" |
|
12 |
- } else { |
|
13 |
- itemType |
|
14 |
- } |
|
15 |
-} |
|
16 |
- |
|
17 |
-@makeBranchItem(project:Project, branch:String) = { |
|
18 |
- @defining(branch.split('/')){ names => |
|
19 |
- @if(names(0).equals("refs") && names.length == 3){ |
|
20 |
- <li data-value="@branch"><a href="@routes.CodeHistoryApp.history(project.owner, project.name, URLEncoder.encode(names(2), "UTF-8"), null)"><!-- |
|
21 |
- --><span class="label @branchItemType(names(1))">@branchItemType(names(1))</span><!-- |
|
22 |
- -->@names(2) |
|
23 |
- </a></li> |
|
24 |
- } else { |
|
25 |
- <li data-value="@branch"><a href="@routes.CodeHistoryApp.history(project.owner, project.name, URLEncoder.encode(branch, "UTF-8"), null)">@branch</a></li> |
|
26 |
- } |
|
27 |
- } |
|
28 |
-} |
|
29 |
- |
|
30 | 9 |
@projectLayout(Messages("code.commits") + " @" + commit.getId, project, utils.MenuType.CODE) { |
31 | 10 |
|
32 | 11 |
<div class="page"> |
33 |
- |
|
34 | 12 |
@projectMenu(project, utils.MenuType.CODE, "main-menu-only") |
35 | 13 |
|
36 | 14 |
<div class="code-browse-wrap"> |
... | ... | @@ -42,7 +20,7 @@ |
42 | 20 |
<ul class="dropdown-menu"> |
43 | 21 |
@defining(RepositoryService.getRepository(project).getBranches()) { branches => |
44 | 22 |
@for(branch <- branches){ |
45 |
- @makeBranchItem(project, branch) |
|
23 |
+ @partial_branchitem(project, branch, "history", "") |
|
46 | 24 |
} |
47 | 25 |
} |
48 | 26 |
</ul> |
... | ... | @@ -173,12 +151,12 @@ |
173 | 151 |
<script type="text/javascript"> |
174 | 152 |
$(document).ready(function(){ |
175 | 153 |
$yobi.loadModule("code.Diff", { |
176 |
- "welDiff": $("#commit"), |
|
177 |
- "bCommentable" : @if(isProjectResourceCreatable(UserApp.currentUser, project, ResourceType.COMMIT_COMMENT)){true}else{false}, |
|
178 |
- "sWatchUrl" : "@routes.WatchApp.watch(commit.asResource(project).asParameter)", |
|
179 |
- "sUnwatchUrl" : "@routes.WatchApp.unwatch(commit.asResource(project).asParameter)", |
|
180 |
- "sTplFileURL" : "@routes.CodeApp.codeBrowserWithBranch(project.owner, project.name, "${commitId}", "${path}")", |
|
181 |
- "sTplRawURL" : "@routes.CodeApp.showRawFile(project.owner, project.name, "${commitId}", "${path}")" |
|
154 |
+ "welDiff" : $("#commit"), |
|
155 |
+ "bCommentable": @if(isProjectResourceCreatable(UserApp.currentUser, project, ResourceType.COMMIT_COMMENT)){true}else{false}, |
|
156 |
+ "sWatchUrl" : "@routes.WatchApp.watch(commit.asResource(project).asParameter)", |
|
157 |
+ "sUnwatchUrl" : "@routes.WatchApp.unwatch(commit.asResource(project).asParameter)", |
|
158 |
+ "sTplFileURL" : "@routes.CodeApp.codeBrowserWithBranch(project.owner, project.name, "${commitId}", "${path}")", |
|
159 |
+ "sTplRawURL" : "@routes.CodeApp.showRawFile(project.owner, project.name, "${commitId}", "${path}")" |
|
182 | 160 |
}); |
183 | 161 |
|
184 | 162 |
yobi.Mention({ |
--- app/views/code/partial_branchitem.scala.html
+++ app/views/code/partial_branchitem.scala.html
... | ... | @@ -1,40 +1,7 @@ |
1 | 1 |
@(project:Project, branch:String, viewType:String, path:String) |
2 | 2 |
|
3 |
-@import java.net.URLEncoder |
|
3 |
+@import utils.TemplateHelper._ |
|
4 | 4 |
|
5 |
-@branchItemType(itemType:String) = @{ |
|
6 |
- if(itemType == "heads"){ |
|
7 |
- "branch" |
|
8 |
- } else if(itemType == "tags") { |
|
9 |
- "tag" |
|
10 |
- } else { |
|
11 |
- itemType |
|
12 |
- } |
|
13 |
-} |
|
14 |
- |
|
15 |
-@getBranchURL(project:Project, branchName:String, viewType:String) = @{ |
|
16 |
- viewType match { |
|
17 |
- case "history" => { |
|
18 |
- routes.CodeHistoryApp.history(project.owner, project.name, URLEncoder.encode(branchName, "UTF-8"), null) |
|
19 |
- } |
|
20 |
- case "code" => { |
|
21 |
- routes.CodeApp.codeBrowserWithBranch(project.owner, project.name, URLEncoder.encode(branchName, "UTF-8"), path) |
|
22 |
- } |
|
23 |
- case _ => { |
|
24 |
- "#" |
|
25 |
- } |
|
26 |
- } |
|
27 |
-} |
|
28 |
- |
|
29 |
-@defining(branch.split('/')){ names => |
|
30 |
- @defining(names.slice(2, names.length).mkString("/")){ branchName => |
|
31 |
- @if(names(0).equals("refs") && names.length >= 3){ |
|
32 |
- <li data-value="@branch"><a href="@getBranchURL(project, branchName, viewType)"><!-- |
|
33 |
- --><span class="label @branchItemType(names(1))">@branchItemType(names(1))</span><!-- |
|
34 |
- -->@branchName |
|
35 |
- </a></li> |
|
36 |
- } else { |
|
37 |
- <li data-value="@branch"><a href="@getBranchURL(project, branch, viewType)">@branch</a></li> |
|
38 |
- } |
|
39 |
- } |
|
5 |
+@defining(branchItemName(branch)){ branchName => |
|
6 |
+ <li data-value="@branch"><a href="@getBranchURL(project, branchName, viewType, path)">@Html(branchInHTML(branch))</a></li> |
|
40 | 7 |
}(No newline at end of file) |
--- app/views/git/partial_comments.scala.html
+++ app/views/git/partial_comments.scala.html
... | ... | @@ -131,7 +131,7 @@ |
131 | 131 |
<div class="media-body"> |
132 | 132 |
<div class="meta-info"> |
133 | 133 |
<span class="comment_author pull-left"> |
134 |
- <i class="yobicon-comment"></i> |
|
134 |
+ <i class="yobicon-push"></i> |
|
135 | 135 |
<a href="@routes.UserApp.userInfo(comment.authorLoginId)" data-toggle="tooltip" data-placement="top" title="@comment.authorName"> |
136 | 136 |
<strong>@comment.authorLoginId </strong> |
137 | 137 |
</a> |
--- app/views/help/toc.scala.html
+++ app/views/help/toc.scala.html
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 |
<div class="answer-wrap"> |
13 | 13 |
<i class="yobicon-a a"></i> |
14 | 14 |
<div class="answer" style="width:100%"> |
15 |
- @Messages("app.name")를 설치하고자 하면 <a href="http://repo.yobi.io/dlab/yobi#korean">http://repo.yobi.io/dlab/yobi#korean</a>를 참고해 주세요. |
|
15 |
+ @Messages("app.name")를 설치하고자 하면 <a href="http://github/nforge/yobi#korean">http://github/nforge/yobi#korean</a>를 참고해 주세요. |
|
16 | 16 |
</div> |
17 | 17 |
</div> |
18 | 18 |
</li> |
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?