THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

Upgrade Play from 2.2.6 to 2.3.6

* Upgrade sbt from 0.13.0 to 0.13.5.
* Upgrade jsmessages from 1.6.1 to 1.6.2.
* Downgrade play-2-mail from 1.0.0 to 0.9.1.
* Split project/Build.scala into build.sbt and
  project/BuildConfig.scala.
* Introduce sbt-less.
* Introduce sbt-twirl, the new template engine for PlayFramework, and
  fix compile errors caused by it.
    * Import scala.collection.JavaConversions._ for conversion between
      Java and Scala collections.
    * Import java.lang_ and java.util._ to use java types.
    * Use implicitJavaLang imported from play.core.j.PlayMagicForJava._
      instead of lang.
    * Use requestHeader imported from play.core.j.PlayMagicForJava._
      instead of request.
    * Specify play.data.Form in full qualified name to avoid conflict
      with play.api.data.Form.
    * Fix the other template errors.
* Etc
    * Use Result instead of deprecated SimpleResult.
    * Use java.nio.file.NotDirectoryException instead of
      scalax.file.NotDirectoryException.
    * Update README to say use "acvitator" command instead of "play".
    * Add methods to PlayServlet to support Servlet 3.1

IMPORTANT NOTE: You should modify the version of h2database on which
Play depends from 1.3.175 to 1.3.176 in
~/.ivy2/cache/com.typesafe.play/play-jdbc_2.10/ivy-2.3.6.xml as follows:

        <dependency org="com.h2database" name="h2" rev="1.3.176" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>

to avoid org.h2.jdbc.JdbcSQLException because of the bug that h2database
1.3.175 cannot create or alter sequence.
pull/5/head
Yi EungJun 6 years ago
parent
commit
5016350de9
96 changed files with 494 additions and 421 deletions
  1. 49
      README.md
  2. 30
      app/Global.java
  3. 14
      app/actions/AbstractProjectCheckAction.java
  4. 6
      app/actions/AnonymousCheckAction.java
  5. 4
      app/actions/DefaultProjectCheckAction.java
  6. 8
      app/actions/IsAllowedAction.java
  7. 6
      app/actions/IsCreatableAction.java
  8. 6
      app/actions/IsOnlyGitAvailableAction.java
  9. 10
      app/actions/NullProjectCheckAction.java
  10. 2
      app/controllers/IssueApp.java
  11. 2
      app/controllers/PullRequestApp.java
  12. 2
      app/models/Attachment.java
  13. 10
      app/utils/AccessLogger.java
  14. 8
      app/utils/BasicAuthAction.java
  15. 2
      app/utils/ErrorViews.java
  16. 3
      app/utils/PlayServletContext.java
  17. 32
      app/utils/PlayServletRequest.java
  18. 16
      app/utils/PlayServletResponse.java
  19. 6
      app/utils/SiteManagerAuthAction.java
  20. 12
      app/utils/TemplateHelper.scala
  21. 10
      app/views/board/create.scala.html
  22. 4
      app/views/board/edit.scala.html
  23. 4
      app/views/board/view.scala.html
  24. 2
      app/views/code/branches.scala.html
  25. 4
      app/views/code/diff.scala.html
  26. 4
      app/views/code/history.scala.html
  27. 6
      app/views/code/nohead.scala.html
  28. 2
      app/views/common/commentForm.scala.html
  29. 2
      app/views/common/debug.scala.html
  30. 26
      app/views/common/scripts.scala.html
  31. 2
      app/views/common/select2.scala.html
  32. 187
      app/views/common/usermenu.scala.html
  33. 2
      app/views/error/forbidden.scala.html
  34. 2
      app/views/git/create.scala.html
  35. 2
      app/views/git/edit.scala.html
  36. 2
      app/views/git/fork.scala.html
  37. 4
      app/views/git/partial_list.scala.html
  38. 4
      app/views/git/partial_pull_request_event.scala.html
  39. 2
      app/views/git/partial_reviewlist.scala.html
  40. 2
      app/views/git/partial_state.scala.html
  41. 6
      app/views/git/viewChanges.scala.html
  42. 2
      app/views/help/keymap.scala.html
  43. 2
      app/views/index/partial_notifications.scala.html
  44. 2
      app/views/issue/create.scala.html
  45. 2
      app/views/issue/edit.scala.html
  46. 10
      app/views/issue/my_partial_list.scala.html
  47. 6
      app/views/issue/my_partial_list_quicksearch.scala.html
  48. 2
      app/views/issue/my_partial_search.scala.html
  49. 10
      app/views/issue/partial_list.scala.html
  50. 4
      app/views/issue/partial_list_quicksearch.scala.html
  51. 4
      app/views/issue/partial_list_wrap.scala.html
  52. 11
      app/views/issue/view.scala.html
  53. 2
      app/views/milestone/create.scala.html
  54. 2
      app/views/milestone/edit.scala.html
  55. 7
      app/views/organization/create.scala.html
  56. 2
      app/views/organization/partial_settingmenu.scala.html
  57. 2
      app/views/organization/setting.scala.html
  58. 2
      app/views/organization/view.scala.html
  59. 2
      app/views/project/change_vcs.scala.html
  60. 2
      app/views/project/create.scala.html
  61. 2
      app/views/project/delete.scala.html
  62. 2
      app/views/project/importing.scala.html
  63. 2
      app/views/project/list.scala.html
  64. 2
      app/views/project/partial_history.scala.html
  65. 2
      app/views/project/partial_settingmenu.scala.html
  66. 2
      app/views/project/setting.scala.html
  67. 2
      app/views/project/transfer.scala.html
  68. 5
      app/views/projectMenu.scala.html
  69. 4
      app/views/reviewthread/partial_list.scala.html
  70. 2
      app/views/search/partial_issue_comments.scala.html
  71. 2
      app/views/search/partial_issues.scala.html
  72. 2
      app/views/search/partial_milestones.scala.html
  73. 2
      app/views/search/partial_post_comments.scala.html
  74. 2
      app/views/search/partial_posts.scala.html
  75. 2
      app/views/search/partial_projects.scala.html
  76. 2
      app/views/search/partial_reviews.scala.html
  77. 2
      app/views/search/partial_users.scala.html
  78. 4
      app/views/site/mail.scala.html
  79. 2
      app/views/site/siteMngLayout.scala.html
  80. 2
      app/views/site/userList.scala.html
  81. 2
      app/views/user/edit.scala.html
  82. 2
      app/views/user/edit_emails.scala.html
  83. 2
      app/views/user/edit_notifications.scala.html
  84. 2
      app/views/user/edit_password.scala.html
  85. 2
      app/views/user/login.scala.html
  86. 10
      app/views/user/partial_issues.scala.html
  87. 8
      app/views/user/partial_projectlist.scala.html
  88. 2
      app/views/user/resetPassword.scala.html
  89. 2
      app/views/user/signup.scala.html
  90. 8
      app/views/user/view.scala.html
  91. 2
      app/views/welcome/secret.scala.html
  92. 75
      build.sbt
  93. 115
      project/Build.scala
  94. 45
      project/BuildConfig.scala
  95. 2
      project/build.properties
  96. 6
      project/plugins.sbt

49
README.md

@ -31,25 +31,25 @@ Copyright 2014 NAVER Corp. under the Apache License, Version 2.0
JDK version 7(1.7) is required.
### Download playframework
### Download Play Activator
curl -O http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
curl -O http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
or
wget http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
wget http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
or using web browser (for windows)
http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
### Unzip
unzip play-2.1.0.zip
unzip typesafe-activator-1.2.10-minimal.zip
### Change directory to unzipped directory
cd play-2.1.0
cd typesafe-activator-1.2.10-minimal
### Download Yobi
@ -66,19 +66,19 @@ If you want to download one of the stable releases, you can download a compresse
**Caution! in case2, You might come across troubles when you try to upgrade Yobi.**
> You can locate your own Yobi directory in any other place. Please note that you must add playframework home path to $PATH environment in that case.
> You can locate your own Yobi directory in any other place. Please note that you must add Play Activator home path to $PATH environment in that case.
### Change directory to cloned Yobi directory (or cd to your unzipped file directory)
cd yobi
### Run play framework
### Run Play Activator
../play
../activator
or (for windows)
..\play
..\activator
Required files will be download automatically. In the first time, it may take about 10 min or more.
@ -94,7 +94,7 @@ If you want to run Yobi in development mode, use **run**. You can see more detai
Also, you can configure start options.
If your system's memory is over than 4G, we recommend to use follow options.
_JAVA_OPTIONS="-Xmx2048m -Xms1024m" play "start -DapplyEvolutions.default=true -Dhttp.port=9000"
_JAVA_OPTIONS="-Xmx2048m -Xms1024m" activator "start -DapplyEvolutions.default=true -Dhttp.port=9000"
### Connect with browser
@ -102,7 +102,7 @@ If your system's memory is over than 4G, we recommend to use follow options.
If you want to change port, check your permission to use 80 port
See [http://www.playframework.com/documentation/2.1.1/Production](http://www.playframework.com/documentation/2.1.1/Production)
See [http://www.playframework.com/documentation/2.3.6/Production](http://www.playframework.com/documentation/2.3.6/Production)
### Upgrade Yobi
@ -166,26 +166,25 @@ Yobi는 Apache 2.0 라이선스로 제공됩니다.
JDK 7(1.7)이어야 합니다.
### playframework 내려 받기
### Play Activator 내려 받기
curl -O http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
curl -O http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
혹은
wget http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
wget http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
웹 브라우저에서 (이를테면, MS윈도우즈 사용자일 경우)
http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip
http://downloads.typesafe.com/typesafe-activator/1.2.10/typesafe-activator-1.2.10-minimal.zip
### 압축풀기
unzip play-2.1.0.zip
unzip typesafe-activator-1.2.10-minimal.zip
### 압축을 푼 다음 하위 디렉터리로 이동
cd play-2.1.0
cd typesafe-activator-1.2.10-minimal
### Yobi 소스 내려 받기
@ -199,20 +198,20 @@ case2. 단순히 최신 안정버전을 내려받고자 할 때는 아래 링크
주의! case2의 경우, 업그레이드를 할 때 문제가 생길 수 있습니다.
> 임의의 장소에 Yobi 디렉터리를 위치시킬 경우에는 play 실행파일이 있는 playframework 디렉터리를 $PATH 환경변수에 추가해 주세요.
> 임의의 장소에 Yobi 디렉터리를 위치시킬 경우에는 activator 실행파일이 있는 Play Activator 디렉터리를 $PATH 환경변수에 추가해 주세요.
### clone 받은 Yobi 디렉터리로 이동
(혹은 압축을 해제한 디렉터리로 이동)
cd yobi
### 상단에 있는 play 실행파일 실행
### 상단에 있는 activator 실행파일 실행
../play
../activator
혹은 (윈도우 사용자일 경우)
..\play
..\activator
실행하면 필요한 파일들을 web에서 내려받습니다. 첫 실행시 네트워크 상황에 따라 10여분 가까이 소요될 수 있습니다.
@ -226,7 +225,7 @@ case2. 단순히 최신 안정버전을 내려받고자 할 때는 아래 링크
시작 옵션은 조정가능합니다. 만약 시스템 메모리가 4기가 이상이라면
아래 옵션으로 실행하는걸 권장합니다.
_JAVA_OPTIONS="-Xmx2048m -Xms1024m" play "start -DapplyEvolutions.default=true -Dhttp.port=9000"
_JAVA_OPTIONS="-Xmx2048m -Xms1024m" activator "start -DapplyEvolutions.default=true -Dhttp.port=9000"
### 브라우저로 접속
@ -234,7 +233,7 @@ case2. 단순히 최신 안정버전을 내려받고자 할 때는 아래 링크
http://127.0.0.1:9000
80 포트 등으로 포트를 변경하고 싶을 경우에는 해당 포트가 사용가능한지 확인 한 다음 80 포트를 사용할 수 있는 계정으로 실행합니다.
관련해서는 [http://www.playframework.com/documentation/2.1.1/Production](http://www.playframework.com/documentation/2.1.1/Production) 부분을 확인해 주세요.
관련해서는 [http://www.playframework.com/documentation/2.3.6/Production](http://www.playframework.com/documentation/2.3.6/Production) 부분을 확인해 주세요.
### 업그레이드 하기

30
app/Global.java

@ -43,7 +43,7 @@ import play.api.mvc.Handler;
import play.data.Form;
import play.mvc.*;
import play.mvc.Http.RequestHeader;
import play.mvc.SimpleResult;
import play.mvc.Result;
import play.libs.F.Promise;
import utils.AccessControl;
@ -104,12 +104,12 @@ public class Global extends GlobalSettings {
private Action<Void> getDefaultAction(final Http.Request request) {
final long start = System.currentTimeMillis();
return new Action.Simple() {
public Promise<SimpleResult> call(Http.Context ctx) throws Throwable {
public Promise<Result> call(Http.Context ctx) throws Throwable {
UserApp.initTokenUser();
UserApp.updatePreferredLanguage();
ctx.response().setHeader("Date", DateUtils.formatDate(new Date()));
ctx.response().setHeader("Cache-Control", "no-cache");
Promise<SimpleResult> promise = delegate.call(ctx);
Promise<Result> promise = delegate.call(ctx);
AccessLogger.log(request, promise, start);
return promise;
}
@ -119,8 +119,8 @@ public class Global extends GlobalSettings {
private Action<Void> getRestartAction() {
return new Action.Simple() {
@Override
public Promise<SimpleResult> call(Http.Context ctx) throws Throwable {
return Promise.pure((SimpleResult) ok(restart.render()));
public Promise<Result> call(Http.Context ctx) throws Throwable {
return Promise.pure((Result) ok(restart.render()));
}
};
}
@ -128,20 +128,20 @@ public class Global extends GlobalSettings {
private Action<Void> getConfigSecretAction() {
return new Action.Simple() {
@Override
public Promise<SimpleResult> call(Http.Context ctx) throws Throwable {
public Promise<Result> call(Http.Context ctx) throws Throwable {
if( ctx.request().method().toLowerCase().equals("post") ) {
Form<User> newSiteAdminUserForm = form(User.class).bindFromRequest();
if (hasError(newSiteAdminUserForm)) {
return Promise.pure((SimpleResult) badRequest(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, newSiteAdminUserForm)));
return Promise.pure((Result) badRequest(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, newSiteAdminUserForm)));
}
User siteAdmin = SiteAdmin.updateDefaultSiteAdmin(newSiteAdminUserForm.get());
replaceSiteSecretKey(createSeed(siteAdmin.password));
isRestartRequired = true;
return Promise.pure((SimpleResult) ok(restart.render()));
return Promise.pure((Result) ok(restart.render()));
} else {
return Promise.pure((SimpleResult) ok(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, new Form<>(User.class))));
return Promise.pure((Result) ok(secret.render(SiteAdmin.SITEADMIN_DEFAULT_LOGINID, new Form<>(User.class))));
}
}
@ -211,26 +211,26 @@ public class Global extends GlobalSettings {
}
@Override
public Promise<SimpleResult> onHandlerNotFound(RequestHeader request) {
public Promise<Result> onHandlerNotFound(RequestHeader request) {
AccessLogger.log(request, null, Http.Status.NOT_FOUND);
return Promise.pure((SimpleResult) Results.notFound(ErrorViews.NotFound.render()));
return Promise.pure((Result) Results.notFound(ErrorViews.NotFound.render()));
}
@Override
public Promise<SimpleResult> onError(RequestHeader request, Throwable t) {
public Promise<Result> onError(RequestHeader request, Throwable t) {
AccessLogger.log(request, null, Http.Status.INTERNAL_SERVER_ERROR);
if (Play.isProd()) {
return Promise.pure((SimpleResult) Results.internalServerError(views.html.error.internalServerError_default.render("error.internalServerError")));
return Promise.pure((Result) Results.internalServerError(views.html.error.internalServerError_default.render("error.internalServerError")));
} else {
return super.onError(request, t);
}
}
@Override
public Promise<SimpleResult> onBadRequest(RequestHeader request, String error) {
public Promise<Result> onBadRequest(RequestHeader request, String error) {
AccessLogger.log(request, null, Http.Status.BAD_REQUEST);
return Promise.pure((SimpleResult) badRequest(ErrorViews.BadRequest.render()));
return Promise.pure((Result) badRequest(ErrorViews.BadRequest.render()));
}
}

14
app/actions/AbstractProjectCheckAction.java

@ -29,7 +29,7 @@ import play.i18n.Messages;
import play.mvc.Action;
import play.mvc.Http.Context;
import play.mvc.Result;
import play.mvc.SimpleResult;
import play.mvc.Result;
import play.libs.F.Promise;
import utils.AccessControl;
import utils.AccessLogger;
@ -48,21 +48,21 @@ import static play.mvc.Controller.flash;
*/
public abstract class AbstractProjectCheckAction<T> extends Action<T> {
@Override
public final Promise<SimpleResult> call(Context context) throws Throwable {
public final Promise<Result> call(Context context) throws Throwable {
PathParser parser = new PathParser(context);
String ownerLoginId = parser.getOwnerLoginId();
String projectName = parser.getProjectName();
Project project = Project.findByOwnerAndProjectName(ownerLoginId, projectName);
Promise<SimpleResult> promise;
Promise<Result> promise;
if (project == null) {
if (UserApp.currentUser() == User.anonymous){
flash("failed", Messages.get("error.auth.unauthorized.waringMessage"));
promise = Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
} else {
promise = Promise.pure((SimpleResult) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")));
promise = Promise.pure((Result) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")));
}
AccessLogger.log(context.request(), promise, null);
@ -72,7 +72,7 @@ public abstract class AbstractProjectCheckAction<T> extends Action<T> {
if (!AccessControl.isAllowed(UserApp.currentUser(), project.asResource(), Operation.READ)) {
flash("failed", Messages.get("error.auth.unauthorized.waringMessage"));
promise = Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
AccessLogger.log(context.request(), promise, null);
return promise;
}
@ -80,6 +80,6 @@ public abstract class AbstractProjectCheckAction<T> extends Action<T> {
return call(project, context, parser);
}
protected abstract Promise<SimpleResult> call(Project project, Context context, PathParser parser)
protected abstract Promise<Result> call(Project project, Context context, PathParser parser)
throws Throwable;
}

6
app/actions/AnonymousCheckAction.java

@ -26,7 +26,7 @@ import controllers.routes;
import play.mvc.Action;
import play.mvc.Http.Context;
import play.mvc.Result;
import play.mvc.SimpleResult;
import play.mvc.Result;
import play.libs.F.Promise;
import utils.AccessControl;
import utils.AccessLogger;
@ -42,7 +42,7 @@ import utils.Constants;
public class AnonymousCheckAction extends Action<AnonymousCheck> {
@Override
public Promise<SimpleResult> call(Context context) throws Throwable {
public Promise<Result> call(Context context) throws Throwable {
if ((AccessControl.isAnonymousNotAllowed() || configuration.requiresLogin()) &&
UserApp.currentUser().isAnonymous()) {
if (configuration.displaysFlashMessage()) {
@ -50,7 +50,7 @@ public class AnonymousCheckAction extends Action<AnonymousCheck> {
}
String loginFormUrl = routes.UserApp.loginForm().url();
loginFormUrl += "?redirectUrl=" + context.request().path();
Promise<SimpleResult> promise = Promise.pure(redirect(loginFormUrl));
Promise<Result> promise = Promise.pure(redirect(loginFormUrl));
AccessLogger.log(context.request(), promise, null);
return promise;
}

4
app/actions/DefaultProjectCheckAction.java

@ -24,7 +24,7 @@ import actions.support.PathParser;
import models.Project;
import play.mvc.Http.Context;
import play.mvc.Result;
import play.mvc.SimpleResult;
import play.mvc.Result;
import play.libs.F.Promise;
/**
@ -36,7 +36,7 @@ import play.libs.F.Promise;
*/
public class DefaultProjectCheckAction extends AbstractProjectCheckAction<Void> {
@Override
protected Promise<SimpleResult> call(Project project, Context context, PathParser parser) throws Throwable {
protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
return this.delegate.call(context);
}
}

8
app/actions/IsAllowedAction.java

@ -30,7 +30,7 @@ import models.resource.Resource;
import models.resource.ResourceConvertible;
import play.mvc.Http.Context;
import play.mvc.Result;
import play.mvc.SimpleResult;
import play.mvc.Result;
import play.libs.F.Promise;
import utils.AccessControl;
import utils.AccessLogger;
@ -49,19 +49,19 @@ import utils.ErrorViews;
*/
public class IsAllowedAction extends AbstractProjectCheckAction<IsAllowed> {
@Override
protected Promise<SimpleResult> call(Project project, Context context, PathParser parser) throws Throwable {
protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
ResourceType resourceType = this.configuration.resourceType();
ResourceConvertible resourceObject = Resource.getResourceObject(parser, project, resourceType);
Operation operation = this.configuration.value();
if(resourceObject == null) {
Promise<SimpleResult> promise = Promise.pure((SimpleResult) notFound(ErrorViews.NotFound.render("error.notfound", project, resourceType.resource())));
Promise<Result> promise = Promise.pure((Result) notFound(ErrorViews.NotFound.render("error.notfound", project, resourceType.resource())));
AccessLogger.log(context.request(), promise, null);
return promise;
}
if(!AccessControl.isAllowed(UserApp.currentUser(), resourceObject.asResource(), operation)) {
Promise<SimpleResult> promise = Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.forbidden", project)));
Promise<Result> promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden", project)));
AccessLogger.log(context.request(), promise, null);
return promise;
}

6
app/actions/IsCreatableAction.java

@ -24,7 +24,7 @@ import models.Project;
import models.User;
import play.mvc.Http.Context;
import play.mvc.Result;
import play.mvc.SimpleResult;
import play.mvc.Result;
import play.libs.F.Promise;
import utils.AccessControl;
import utils.AccessLogger;
@ -43,10 +43,10 @@ import controllers.annotation.IsCreatable;
*/
public class IsCreatableAction extends AbstractProjectCheckAction<IsCreatable> {
@Override
protected Promise<SimpleResult> call(Project project, Context context, PathParser parser) throws Throwable {
protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
User currentUser = UserApp.currentUser();
if (!AccessControl.isProjectResourceCreatable(currentUser, project, this.configuration.value())) {
Promise<SimpleResult> promise = Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.forbidden", project)));
Promise<Result> promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden", project)));
AccessLogger.log(context.request(), promise, null);
return promise;
}

6
app/actions/IsOnlyGitAvailableAction.java

@ -25,7 +25,7 @@ import controllers.annotation.IsOnlyGitAvailable;
import models.Project;
import play.mvc.Http.Context;
import play.mvc.Result;
import play.mvc.SimpleResult;
import play.mvc.Result;
import play.libs.F.Promise;
import utils.AccessLogger;
import utils.ErrorViews;
@ -40,9 +40,9 @@ import utils.ErrorViews;
*/
public class IsOnlyGitAvailableAction extends AbstractProjectCheckAction<IsOnlyGitAvailable> {
@Override
protected Promise<SimpleResult> call(Project project, Context context, PathParser parser) throws Throwable {
protected Promise<Result> call(Project project, Context context, PathParser parser) throws Throwable {
if(!project.isGit()) {
Promise<SimpleResult> promise = Promise.pure((SimpleResult) badRequest(ErrorViews.BadRequest.render("error.badrequest.only.available.for.git")));
Promise<Result> promise = Promise.pure((Result) badRequest(ErrorViews.BadRequest.render("error.badrequest.only.available.for.git")));
AccessLogger.log(context.request(), promise, null);
return promise;
}

10
app/actions/NullProjectCheckAction.java

@ -28,7 +28,7 @@ import play.i18n.Messages;
import play.mvc.Action;
import play.mvc.Http;
import play.mvc.Result;
import play.mvc.SimpleResult;
import play.mvc.Result;
import play.libs.F.Promise;
import utils.AccessLogger;
import utils.ErrorViews;
@ -45,7 +45,7 @@ import static play.mvc.Controller.flash;
public class NullProjectCheckAction extends Action<Void> {
@Override
public Promise<SimpleResult> call(Http.Context context) throws Throwable {
public Promise<Result> call(Http.Context context) throws Throwable {
PathParser parser = new PathParser(context);
String ownerLoginId = parser.getOwnerLoginId();
String projectName = parser.getProjectName();
@ -53,13 +53,13 @@ public class NullProjectCheckAction extends Action<Void> {
Project project = Project.findByOwnerAndProjectName(ownerLoginId, projectName);
if (project == null) {
Promise<SimpleResult> promise;
Promise<Result> promise;
if (UserApp.currentUser() == User.anonymous){
flash("failed", Messages.get("error.auth.unauthorized.waringMessage"));
promise = Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
promise = Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.forbidden.or.notfound", context.request().path())));
} else {
promise = Promise.pure((SimpleResult) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")));
promise = Promise.pure((Result) forbidden(ErrorViews.NotFound.render("error.forbidden.or.notfound")));
}
AccessLogger.log(context.request(), promise, null);

2
app/controllers/IssueApp.java

@ -34,7 +34,7 @@ import models.enumeration.State;
import org.apache.commons.lang3.StringUtils;
import org.apache.tika.Tika;
import com.fasterxml.jackson.databind.node.ObjectNode;
import play.api.templates.Html;
import play.twirl.api.Html;
import play.data.Form;
import play.data.validation.ValidationError;
import play.db.ebean.Transactional;

2
app/controllers/PullRequestApp.java

@ -47,7 +47,7 @@ import play.libs.F.Promise;
import play.libs.Json;
import play.mvc.Controller;
import play.mvc.Result;
import play.mvc.SimpleResult;
import play.mvc.Result;
import playRepository.GitBranch;
import playRepository.GitRepository;
import playRepository.RepositoryService;

2
app/models/Attachment.java

@ -54,7 +54,7 @@ import play.data.validation.*;
import play.db.ebean.Model;
import play.libs.Akka;
import scala.concurrent.duration.Duration;
import scalax.file.NotDirectoryException;
import java.nio.file.NotDirectoryException;
import utils.FileUtil;
import utils.JodaDateUtil;

10
app/utils/AccessLogger.java

@ -25,7 +25,7 @@ import org.apache.commons.lang3.StringEscapeUtils;
import play.libs.F.Callback;
import play.libs.F.Promise;
import play.mvc.Http;
import play.mvc.SimpleResult;
import play.mvc.Result;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -86,13 +86,13 @@ public class AccessLogger {
* @see <a href="http://httpd.apache.org/docs/2.2/en/logs.html#combined">Combined Log Format - Apache HTTP Server</a>
* @see <a href="http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#formats">Custom Log Formats - Apache HTTP Server</a>
*/
public static void log(final Http.Request request, final Promise<SimpleResult> promise,
public static void log(final Http.Request request, final Promise<Result> promise,
final Long startTimeMillis) {
final String username = UserApp.currentUser().loginId;
promise.onRedeem(new Callback<SimpleResult>() {
promise.onRedeem(new Callback<Result>() {
@Override
public void invoke(final SimpleResult result) throws Throwable {
log(request, username, result.getWrappedSimpleResult().header().status(),
public void invoke(final Result result) throws Throwable {
log(request, username, result.toScala().header().status(),
startTimeMillis);
}
});

8
app/utils/BasicAuthAction.java

@ -29,7 +29,7 @@ import play.mvc.Http.Context;
import play.mvc.Http.Request;
import play.mvc.Http.Response;
import play.mvc.Result;
import play.mvc.SimpleResult;
import play.mvc.Result;
import play.libs.F.Promise;
import java.io.UnsupportedEncodingException;
@ -98,16 +98,16 @@ public class BasicAuthAction extends Action<Object> {
}
@Override
public Promise<SimpleResult> call(Context context) throws Throwable {
public Promise<Result> call(Context context) throws Throwable {
User user;
try {
user = authenticate(context.request());
} catch (MalformedCredentialsException error) {
Promise<SimpleResult> promise = Promise.pure((SimpleResult) badRequest());
Promise<Result> promise = Promise.pure((Result) badRequest());
AccessLogger.log(context.request(), promise, null);
return promise;
} catch (UnsupportedEncodingException e) {
Promise<SimpleResult> promise = Promise.pure((SimpleResult) internalServerError());
Promise<Result> promise = Promise.pure((Result) internalServerError());
AccessLogger.log(context.request(), promise, null);
return promise;
}

2
app/utils/ErrorViews.java

@ -23,7 +23,7 @@ import controllers.UserApp;
import models.Organization;
import models.Project;
import models.User;
import play.api.templates.Html;
import play.twirl.api.Html;
import views.html.index.index;

3
app/utils/PlayServletContext.java

@ -302,4 +302,7 @@ public class PlayServletContext implements ServletContext {
throw new UnsupportedOperationException();
}
public String getVirtualServerName() {
throw new UnsupportedOperationException();
}
}

32
app/utils/PlayServletRequest.java

@ -115,6 +115,16 @@ public class PlayServletRequest implements HttpServletRequest {
return Integer.parseInt(contentLength);
}
public long getContentLengthLong() {
String contentLength = request.getHeader(Http.HeaderNames.CONTENT_LENGTH);
if (contentLength == null) {
return -1;
}
return Long.parseLong(contentLength);
}
@Override
public String getContentType() {
return request.getHeader(Http.HeaderNames.CONTENT_TYPE);
@ -173,6 +183,18 @@ public class PlayServletRequest implements HttpServletRequest {
close();
super.finalize();
}
public void setReadListener(javax.servlet.ReadListener readListener) {
throw new UnsupportedOperationException();
}
public boolean isReady() {
throw new UnsupportedOperationException();
}
public boolean isFinished() {
throw new UnsupportedOperationException();
}
};
}
@ -556,4 +578,14 @@ public class PlayServletRequest implements HttpServletRequest {
throw new UnsupportedOperationException();
}
public <T extends javax.servlet.http.HttpUpgradeHandler> T upgrade(java.lang.Class<T> httpUpgradeHandlerClass)
throws java.io.IOException,
ServletException {
throw new UnsupportedOperationException();
}
public String changeSessionId() {
throw new UnsupportedOperationException();
}
}

16
app/utils/PlayServletResponse.java

@ -101,6 +101,14 @@ public class PlayServletResponse implements HttpServletResponse {
target.close();
super.close();
}
public void setWriteListener(WriteListener writeListener) {
throw new UnsupportedOperationException();
}
public boolean isReady() {
throw new UnsupportedOperationException();
}
}
public PlayServletResponse(Response response) throws IOException {
@ -191,6 +199,10 @@ public class PlayServletResponse implements HttpServletResponse {
this.response.setHeader(Http.HeaderNames.CONTENT_LENGTH, Integer.toString(length));
}
public void setContentLengthLong(long length) {
this.response.setHeader(Http.HeaderNames.CONTENT_LENGTH, Long.toString(length));
}
@Override
public void setContentType(String type) {
this.response.setContentType(type);
@ -380,4 +392,8 @@ public class PlayServletResponse implements HttpServletResponse {
}
return (encoding.trim());
}
public String getVirtualServerName() {
throw new UnsupportedOperationException();
}
}

6
app/utils/SiteManagerAuthAction.java

@ -24,7 +24,7 @@ import controllers.UserApp;
import play.mvc.Action;
import play.mvc.Http.Context;
import play.mvc.Result;
import play.mvc.SimpleResult;
import play.mvc.Result;
import play.libs.F.Promise;
/**
@ -32,9 +32,9 @@ import play.libs.F.Promise;
*/
public class SiteManagerAuthAction extends Action.Simple {
@Override
public Promise<SimpleResult> call(Context context) throws Throwable {
public Promise<Result> call(Context context) throws Throwable {
if (!UserApp.currentUser().isSiteManager()) {
return Promise.pure((SimpleResult) forbidden(ErrorViews.Forbidden.render("error.auth.unauthorized.waringMessage")));
return Promise.pure((Result) forbidden(ErrorViews.Forbidden.render("error.auth.unauthorized.waringMessage")));
}
return delegate.call(context);
}

12
app/utils/TemplateHelper.scala

@ -25,7 +25,7 @@ import playRepository.FileDiff
import play.api.i18n.Lang
import models.CodeCommentThread
import models.CommentThread
import play.api.templates.Html
import play.twirl.api.Html
object TemplateHelper {
@ -364,12 +364,12 @@ object TemplateHelper {
def shortId(commitId: String) = commitId.substring(0, Math.min(7, commitId.size))
@tailrec
def renderNonRangedThreads(threads: List[models.CommentThread], commitId: String, html: play.api.templates.Html): play.api.templates.Html =
def renderNonRangedThreads(threads: List[models.CommentThread], commitId: String, html: play.twirl.api.Html): play.twirl.api.Html =
threads match {
case head :: tail =>
head match {
case (thread: models.NonRangedCodeCommentThread)
if commitId == null || commitId == thread.commitId => html += partial_comment_thread(thread)
if commitId == null || commitId == thread.commitId => new Html(List(html, partial_comment_thread(thread)))
case _ => ;
}
renderNonRangedThreads(tail, commitId, html)
@ -378,16 +378,16 @@ object TemplateHelper {
@tailrec
def _renderEventsOnPullRequest(pull: PullRequest, events: List[PullRequestEvent],
html: play.api.templates.Html): play.api.templates.Html =
html: play.twirl.api.Html): play.twirl.api.Html =
events match {
case head :: tail =>
html += partial_pull_request_event(pull, head)
new Html(List(html, partial_pull_request_event(pull, head)))
_renderEventsOnPullRequest(pull, tail, html)
case _ => html
}
def renderEventsOnPullRequest(pull: PullRequest) =
_renderEventsOnPullRequest(pull, pull.pullRequestEvents.toList, play.api.templates.Html(""))
_renderEventsOnPullRequest(pull, pull.pullRequestEvents.toList, play.twirl.api.Html(""))
def urlToCommentThread(thread: CommentThread) = {
urlToContainer(thread) + "#thread-" + thread.id

10
app/views/board/create.scala.html

@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, form:Form[Posting], project:Project, isAllowedToNotice:Boolean, preparedPostBody:String = "")
@(title:String, form: play.data.Form[Posting], project:Project, isAllowedToNotice:Boolean, preparedPostBody:String = "")
@import utils.AccessControl._
@import utils.TemplateHelper._
@ -27,7 +27,7 @@
@implicitField = @{ helper.FieldConstructor(simpleForm) }
@readmeUpdateMessage = @{
if( request().getQueryString("readme") != null ) {
if( requestHeader.getQueryString("readme") != null ) {
"Update README.md"
}
}
@ -66,7 +66,7 @@
@** end of fileUploader **@
<div class="right-txt mt10 mb10">
@if(isAllowedToNotice && !stringToBoolean(request().getQueryString("readme"))){
@if(isAllowedToNotice && !stringToBoolean(requestHeader.getQueryString("readme").get)){
<label class="checkbox">
<input type="checkbox" id="notice" name="notice">
@Messages("post.notice.label")
@ -74,9 +74,9 @@
}
@if(isProjectResourceCreatable(UserApp.currentUser(), project, ResourceType.COMMIT)){
@if(project.isGit && stringToBoolean(request().getQueryString("readme"))){
@if(project.isGit && stringToBoolean(requestHeader.getQueryString("readme").get)){
<label class="checkbox">
<input type="checkbox" id="readme" name="readme" @boolToCheckedString(request().getQueryString("readme"))>
<input type="checkbox" id="readme" name="readme" @boolToCheckedString(requestHeader.getQueryString("readme"))>
@Messages("post.readmefy")
</label>
}

4
app/views/board/edit.scala.html

@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, form:Form[Posting], posting:Posting, number:Long, project:Project, isAllowedToNotice:Boolean)
@(title:String, form: play.data.Form[Posting], posting:Posting, number:Long, project:Project, isAllowedToNotice:Boolean)
@import utils.AccessControl._
@import utils.TemplateHelper._
@ -60,7 +60,7 @@
@** end of fileUploader **@
<div class="right-txt mt10 mb10">
@if(isAllowedToNotice && !stringToBoolean(request().getQueryString("readme"))){
@if(isAllowedToNotice && !stringToBoolean(requestHeader.getQueryString("readme").get)){
@helper.input(form("notice")){(id, name, value, args) =>
<label class="checkbox">
<input type="checkbox" id="notice" name="notice" @toHtmlArgs(args) @(if(value.equals(Some("true"))) "checked" else "")/>

4
app/views/board/view.scala.html

@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(post:Posting, commentForm:Form[PostingComment], project:Project)
@(post:Posting, commentForm: play.data.Form[PostingComment], project:Project)
@import utils.JodaDateUtil
@import utils.TemplateHelper._
@ -28,7 +28,7 @@
@import utils.Markdown
@implicitField = @{ helper.FieldConstructor(simpleForm) }
@urlToPostings = @{ urlToList(request.getHeader("Referer"), routes.BoardApp.posts(project.owner, project.name).toString()) }
@urlToPostings = @{ urlToList(requestHeader.headers.get("Referer").get, routes.BoardApp.posts(project.owner, project.name).toString()) }
@projectLayout(post.title, project, utils.MenuType.BOARD){
@projectMenu(project, utils.MenuType.BOARD, "main-menu-only")

2
app/views/code/branches.scala.html

@ -57,7 +57,7 @@
<tbody>
@partial_branchrow(project, head, true)
@for(branch <- branches.iterator()) {
@for(branch <- branches.iterator) {
@partial_branchrow(project, branch, false)
}
</tbody>

4
app/views/code/diff.scala.html

@ -151,7 +151,7 @@ List[playRepository.FileDiff],path:String)
<p class="content">@thread.getFirstReviewComment().getContents()</p>
<span class="date" title="@utils.JodaDateUtil.getDateString(thread.createdDate)">
<span class="comments">
@if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size()}
@if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size}
</span>
<span class="avatar-wrap smaller margin-right-5">
<img src="@User.findByLoginId(thread.author.loginId).avatarUrl" alt="@thread.author.name" />
@ -170,7 +170,7 @@ List[playRepository.FileDiff],path:String)
<p class="content">@thread.getFirstReviewComment().getContents()</p>
<span class="date" title="@utils.JodaDateUtil.getDateString(thread.createdDate)">
<span class="comments">
@if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size()}
@if( thread.hasChildComments ){<i class="yobicon-comments"></i> @thread.reviewComments.size}
</span>
<span class="avatar-wrap smaller margin-right-5">
<img src="@User.findByLoginId(thread.author.loginId).avatarUrl" alt="@thread.author.name" />

4
app/views/code/history.scala.html

@ -77,7 +77,7 @@
}
@isHistoryExistAndHasParent(history: List[playRepository.Commit]) = @{
(history.size() > 0 && history.get(history.size() - 1).getParentCount() > 0)
(history.size > 0 && history.get(history.size - 1).getParentCount() > 0)
}
@projectLayout(Messages("title.commitHistory"), project, utils.MenuType.CODE) {
@ -137,7 +137,7 @@
@if(history.isEmpty()){
<tr><td colspan="5" class="warning-none">@Messages("code.nocommits")</td></tr>
}
@for(commit <- history.iterator()) {
@for(commit <- history.iterator) {
@defining(getShowCommitURL(project, commit, path)){ showCommitURL =>
<tr>
<td class="commit-id">

6
app/views/code/nohead.scala.html

@ -21,12 +21,12 @@
@(project: Project)
@getCodeURL(project: Project) = @{
if(session == null){
if(requestHeader.session == null){
CodeApp.getURL(project.owner, project.name)
} else {
defining(ProjectUser.roleOf(session.get("loginId"), project)) { role =>
defining(ProjectUser.roleOf(UserApp.currentUser.loginId, project)) { role =>
if(role == "manager" || role == "member"){
CodeApp.getURL(project.owner, project.name).replace("://", "://" + session.get("loginId") + "@")
CodeApp.getURL(project.owner, project.name).replace("://", "://" + UserApp.currentUser.loginId + "@")
} else {
CodeApp.getURL(project.owner, project.name)
}

2
app/views/common/commentForm.scala.html

@ -24,7 +24,7 @@
@import models.enumeration.ResourceType
@import utils.AccessControl._
@if(isResourceCreatable(User.findByLoginId(session.get("loginId")), container, resourceType)){
@if(isResourceCreatable(UserApp.currentUser, container, resourceType)){
<form id="comment-form" action="@action" method="post" enctype="multipart/form-data">
<div class="write-comment-box">

2
app/views/common/debug.scala.html

@ -22,5 +22,5 @@
@import play.api.Play.current
<div class="container">
lang = @lang.code
lang = @implicitJavaLang.code
</div>

26
app/views/common/scripts.scala.html

@ -101,7 +101,7 @@
// current language set!
if (typeof window.moment == "function" && typeof window.moment.lang == "function") {
moment.lang("@lang.language");
moment.lang("@implicitJavaLang.language");
}
// yobi.Dropdown
@ -120,10 +120,15 @@
$(htInfo.welTarget.parents("form").get(0)).submit();
}
});
@if(session.contains("loginId")){
yobi.ShortcutKey.setKeymapLink({
"P": "@routes.UserApp.userInfo(session.get("loginId"))"
});
@requestHeader.session.get("loginId") match {
case Some(loginId) => { }
case None => { }
}
@requestHeader.session.get("loginId") match {
case Some(v) => { yobi.ShortcutKey.setKeymapLink({
"P": "@routes.UserApp.userInfo(v)"
}); }
case None => { }
}
// yobi.Files
@ -168,14 +173,11 @@
}
// notify flash messages
@for(key <- flash.keys) {
@if(key != utils.Constants.TITLE &&
key != utils.Constants.DESCRIPTION){
$yobi.notify("@Messages(flash.get(key))", 3000);
@requestHeader.flash.get(utils.Constants.TITLE) match {
case Some(title) => { $yobi.alert("@Messages(title)", null, "@Messages(requestHeader.flash.get(utils.Constants.DESCRIPTION).get)"); }
case None => { @requestHeader.flash.data.foreach {
case (_, value) => { $yobi.notify("@Messages(value)", 3000); }
}
@if(key == utils.Constants.TITLE){
$yobi.alert("@Messages(flash.get(key))", null,
"@Messages(flash.get(utils.Constants.DESCRIPTION))");
}
}

2
app/views/common/select2.scala.html

@ -22,7 +22,7 @@
<script src="@routes.Assets.at("javascripts/lib/select2/select2.js")"></script>
<script src="@routes.Assets.at("javascripts/common/yobi.ui.Select2.js")"></script>
@{
lang.language match {
implicitJavaLang.language match {
case "ko" => {
Html("<script src=\"" + routes.Assets.at("javascripts/lib/select2/select2_locale_ko.js") + "\"></script>")
}

187
app/views/common/usermenu.scala.html

@ -22,105 +22,108 @@
@import utils.TemplateHelper._
@orderString = @{"createdDate DESC"}
<ul class="gnb-usermenu">
@if(session.contains("loginId")){
<li class="gnb-usermenu-dropdown">
<a href="javascript:void(0);" class="gnb-dropdown-toggle dropdwon-box-btn" data-toggle="dropdown">
<i class="yobicon-plus"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu flat right">
<li>
<a href="@routes.ProjectApp.newProjectForm()">
@Messages("button.newProject")
</a>
</li>
<li>
<a href="@routes.OrganizationApp.newForm()">
@Messages("title.newOrganization")
</a>
</li>
</ul>
</li>
@if(session.get("userId").equals("1")) {
<li class="gnb-usermenu-item">
<a href="@routes.SiteApp.userList()" data-toggle="tooltip" title="@Messages("menu.siteAdmin")" data-placement="bottom" class="usermenu-icon-button">
<i class="yobicon-wrench"></i>
</a>
</li>
}
<li class="gnb-usermenu-dropdown">
<a href="javascript:void(0);" class="gnb-dropdown-toggle" data-toggle="dropdown">
<span class="avatar-wrap smaller">
<img src="@User.findByLoginId(session.get("loginId")).avatarUrl" />
</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu flat right">
<li class="title">
@User.findByLoginId(session.get("loginId")).name <span class="disabled">@{"@"}@session.get("loginId")</span>
</li>
<li>
<a href="@routes.IssueApp.userIssues()">@Messages("issue.myIssue")</a>
</li>
<li>
<a href="@routes.UserApp.userInfo(session.get("loginId"))">@Messages("userinfo.profile")</a>
</li>
<li>
<a href="@routes.UserApp.editUserInfoForm()">
@Messages("userinfo.accountSetting")
</a>
</li>
<li>
<a href="@routes.UserApp.logout()">
@Messages("title.logout")
</a>
</li>
@defining(UserApp.currentUser.getOrganizations(5)) { groups =>
<li class="title">
@Messages("title.organization")
<span class="numberic">@groups.size</span>
@requestHeader.session.get("loginId") match {
case Some(loginId) => {
<li class="gnb-usermenu-dropdown">
<a href="javascript:void(0);" class="gnb-dropdown-toggle dropdwon-box-btn" data-toggle="dropdown">
<i class="yobicon-plus"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu flat right">
<li>
<a href="@routes.ProjectApp.newProjectForm()">
@Messages("button.newProject")
</a>
</li>
@if(groups.length > 0) {
@for(organization <- groups){
<li><a href="@routes.OrganizationApp.organization(organization.name)">@if(hasOrganizationLogo(organization)){<img src="@urlToOrganizationLogo(organization)">}else{<span class="dummy-25px"> </span>} <span class="bold">@organization.name</span></a></li>
}
} else {
<li class="empty">@Messages("organization.is.empty")</li>
}
}
@defining(UserApp.currentUser.getVisitedProjects(10)){ visitedProjects =>
<li>
<a href="@routes.OrganizationApp.newForm()">
@Messages("title.newOrganization")
</a>
</li>
</ul>
</li>
@if(requestHeader.session.get("userId").equals("1")) {
<li class="gnb-usermenu-item">
<a href="@routes.SiteApp.userList()" data-toggle="tooltip" title="@Messages("menu.siteAdmin")" data-placement="bottom" class="usermenu-icon-button">
<i class="yobicon-wrench"></i>
</a>
</li>
}
<li class="gnb-usermenu-dropdown">
<a href="javascript:void(0);" class="gnb-dropdown-toggle" data-toggle="dropdown">
<span class="avatar-wrap smaller">
<img src="@User.findByLoginId(loginId).avatarUrl" />
</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu flat right">
<li class="title">
@Messages("project.recently.visited")
<span class="numberic">@visitedProjects.size</span>
@User.findByLoginId(loginId).name <span class="disabled">@{"@"}@loginId</span>
</li>
<li>
<a href="@routes.IssueApp.userIssues()">@Messages("issue.myIssue")</a>
</li>
@if(visitedProjects.length > 0) {
@for(visited <- visitedProjects){
<li><a href="@routes.ProjectApp.project(visited.project.owner, visited.project.name)">@if(hasProjectLogo(visited.project)){<img src="@urlToProjectLogo(visited.project)">} else{<span class="dummy-25px"> </span>} <span class="bold">@visited.project.name</span> <span class="darkgray-txt small-font margin-right-15">of @visited.project.owner</span></a></li>
<li>
<a href="@routes.UserApp.userInfo(loginId)">@Messages("userinfo.profile")</a>
</li>
<li>
<a href="@routes.UserApp.editUserInfoForm()">
@Messages("userinfo.accountSetting")
</a>
</li>
<li>
<a href="@routes.UserApp.logout()">
@Messages("title.logout")
</a>
</li>
@defining(UserApp.currentUser.getOrganizations(5)) { groups =>
<li class="title">
@Messages("title.organization")
<span class="numberic">@groups.size</span>
</li>
@if(groups.size > 0) {
@for(organization <- groups){
<li><a href="@routes.OrganizationApp.organization(organization.name)">@if(hasOrganizationLogo(organization)){<img src="@urlToOrganizationLogo(organization)">}else{<span class="dummy-25px"> </span>} <span class="bold">@organization.name</span></a></li>
}
} else {
<li class="empty">@Messages("organization.is.empty")</li>
}
} else {
@defining(Project.findProjectsCreatedByUser(UserApp.currentUser.loginId, orderString)) { myProjects =>
@if(myProjects.length > 0) {
@for(project <- myProjects){
<li>@if(hasProjectLogo(project)){<img src="@urlToProjectLogo(project)">} <a href="@routes.ProjectApp.project(project.owner, project.name)"><span class="bold">@project.name</span> <span class="darkgray-txt small-font margin-right-15">of @project.owner</span></a></li>
}
@defining(UserApp.currentUser.getVisitedProjects(10)){ visitedProjects =>
<li class="title">
@Messages("project.recently.visited")
<span class="numberic">@visitedProjects.size</span>
</li>
@if(visitedProjects.size > 0) {
@for(visited <- visitedProjects){
<li><a href="@routes.ProjectApp.project(visited.project.owner, visited.project.name)">@if(hasProjectLogo(visited.project)){<img src="@urlToProjectLogo(visited.project)">} else{<span class="dummy-25px"> </span>} <span class="bold">@visited.project.name</span> <span class="darkgray-txt small-font margin-right-15">of @visited.project.owner</span></a></li>
}
} else {
@defining(Project.findProjectsCreatedByUser(UserApp.currentUser.loginId, orderString)) { myProjects =>
@if(myProjects.size > 0) {
@for(project <- myProjects){
<li>@if(hasProjectLogo(project)){<img src="@urlToProjectLogo(project)">} <a href="@routes.ProjectApp.project(project.owner, project.name)"><span class="bold">@project.name</span> <span class="darkgray-txt small-font margin-right-15">of @project.owner</span></a></li>
}
} else {
<li class="empty">@Messages("project.is.empty")</li>
}
} else {
<li class="empty">@Messages("project.is.empty")</li>
}
}
}
}
</ul>
</li>
} else {
<li>
<a href="@routes.UserApp.signupForm()" class="ybtn ybtn-success">
@Messages("title.signup")
</a>
</li>
<li class="gnb-usermenu-item">
<a href="@routes.UserApp.loginForm()" class="user-item-btn" data-login="required">
@Messages("title.login")
</a>
</li>
</ul>
</li>
}
case None => {
<li>
<a href="@routes.UserApp.signupForm()" class="ybtn ybtn-success">
@Messages("title.signup")
</a>
</li>
<li class="gnb-usermenu-item">
<a href="@routes.UserApp.loginForm()" class="user-item-btn" data-login="required">
@Messages("title.login")
</a>
</li>
}
}
</ul>

2
app/views/error/forbidden.scala.html

@ -28,7 +28,7 @@
<i class="ico ico-err2"></i>
<p>@Messages(messageKey)</p>
@if(UserApp.currentUser.isAnonymous){
<a href="@routes.UserApp.loginForm?redirectUrl=@request.uri" class="ybtn ybtn-primary" data-login="required">@Messages("title.login")</a>
<a href="@routes.UserApp.loginForm?redirectUrl=@requestHeader.uri" class="ybtn ybtn-primary" data-login="required">@Messages("title.login")</a>
}
</div>
</div>

2
app/views/git/create.scala.html

@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, form:Form[PullRequest], project:Project, projects:List[Project],
@(title:String, form: play.data.Form[PullRequest], project:Project, projects:List[Project],
fromProject:Project, toProject:Project,
fromBranches:List[playRepository.GitBranch], toBranches:List[playRepository.GitBranch],
pullRequest:models.PullRequest)

2
app/views/git/edit.scala.html

@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, form:Form[PullRequest], project:Project,
@(title:String, form: play.data.Form[PullRequest], project:Project,
fromBranches: List[playRepository.GitBranch], toBranches:List[playRepository.GitBranch],
pullRequest:models.PullRequest)

2
app/views/git/fork.scala.html

@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, project: Project, forkProject: Project, forkedProjects: List[Project], form: Form[Project], orgUserList:List[OrganizationUser])
@(title:String, project: Project, forkProject: Project, forkedProjects: List[Project], form: play.data.Form[Project], orgUserList:List[OrganizationUser])
@import utils.TemplateHelper._
@import controllers.UserApp

4
app/views/git/partial_list.scala.html

@ -25,8 +25,8 @@
@import org.apache.commons.lang3.StringUtils
<ul class="post-list-wrap">
@if(page.getList.size()> 0){
@for(req <- page.getList.iterator()) {
@if(page.getList.size> 0){
@for(req <- page.getList.iterator) {
@defining(User.findByLoginId(req.contributor.loginId)){ user =>
<li class="post-item">
<div class="span10">

4
app/views/git/partial_pull_request_event.scala.html

@ -55,7 +55,7 @@
@if(event.newValue == PullRequestReviewAction.DONE.name) {
<li class="event" id="comment-@event.id">
<span class="state changed">@Messages("pullRequest.review")</span>
@Html(Messages("notification.pullrequest.reviewed",linkToUser(user.loginId, user.name)))
@Html(Messages("notification.pullrequestHeader.reviewed",linkToUser(user.loginId, user.name)))
<span class="date">
<a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a>
</span>
@ -63,7 +63,7 @@
} else {
<li class="event" id="comment-@event.id">
<span class="state changed">@Messages("pullRequest.unreview")</span>
@Html(Messages("notification.pullrequest.unreviewed", linkToUser(user.loginId, user.name)))
@Html(Messages("notification.pullrequestHeader.unreviewed", linkToUser(user.loginId, user.name)))
<span class="date">
<a href="#event-@event.id" title="@getDateString(event.getDate())">@agoOrDateString(event.getDate())</a>
</span>

2
app/views/git/partial_reviewlist.scala.html

@ -32,7 +32,7 @@
@thread.getFirstReviewComment().getContents()
</p>
<p class="info">
@defining(thread.reviewComments.size()-1) { numberOfComments =>
@defining(thread.reviewComments.size-1) { numberOfComments =>
@if(numberOfComments > 0) {
<span class="comments pull-left">
<i class="yobicon-comments"></i> @numberOfComments