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

+ 24
- 25
README.md View File

@@ -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) 부분을 확인해 주세요.

### 업그레이드 하기


+ 15
- 15
app/Global.java View File

@@ -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()));
}

}

+ 7
- 7
app/actions/AbstractProjectCheckAction.java View File

@@ -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;
}

+ 3
- 3
app/actions/AnonymousCheckAction.java View File

@@ -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;
}

+ 2
- 2
app/actions/DefaultProjectCheckAction.java View File

@@ -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);
}
}

+ 4
- 4
app/actions/IsAllowedAction.java View File

@@ -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;
}

+ 3
- 3
app/actions/IsCreatableAction.java View File

@@ -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;
}

+ 3
- 3
app/actions/IsOnlyGitAvailableAction.java View File

@@ -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;
}

+ 5
- 5
app/actions/NullProjectCheckAction.java View File

@@ -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);

+ 1
- 1
app/controllers/IssueApp.java View File

@@ -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;

+ 1
- 1
app/controllers/PullRequestApp.java View File

@@ -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;

+ 1
- 1
app/models/Attachment.java View File

@@ -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;


+ 5
- 5
app/utils/AccessLogger.java View File

@@ -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);
}
});

+ 4
- 4
app/utils/BasicAuthAction.java View File

@@ -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;
}

+ 1
- 1
app/utils/ErrorViews.java View File

@@ -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
- 0
app/utils/PlayServletContext.java View File

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

public String getVirtualServerName() {
throw new UnsupportedOperationException();
}
}

+ 32
- 0
app/utils/PlayServletRequest.java View File

@@ -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
- 0
app/utils/PlayServletResponse.java View File

@@ -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();
}
}

+ 3
- 3
app/utils/SiteManagerAuthAction.java View File

@@ -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);
}

+ 6
- 6
app/utils/TemplateHelper.scala View File

@@ -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

+ 5
- 5
app/views/board/create.scala.html View File

@@ -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>
}

+ 2
- 2
app/views/board/edit.scala.html View File

@@ -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 "")/>

+ 2
- 2
app/views/board/view.scala.html View File

@@ -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")

+ 1
- 1
app/views/code/branches.scala.html View File

@@ -57,7 +57,7 @@
<tbody>
@partial_branchrow(project, head, true)

@for(branch <- branches.iterator()) {
@for(branch <- branches.iterator) {
@partial_branchrow(project, branch, false)
}
</tbody>

+ 2
- 2
app/views/code/diff.scala.html View File

@@ -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" />

+ 2
- 2
app/views/code/history.scala.html View File

@@ -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">

+ 3
- 3
app/views/code/nohead.scala.html View File

@@ -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)
}

+ 1
- 1
app/views/common/commentForm.scala.html View File

@@ -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">

+ 1
- 1
app/views/common/debug.scala.html View File

@@ -22,5 +22,5 @@
@import play.api.Play.current

<div class="container">
lang = @lang.code
lang = @implicitJavaLang.code
</div>

+ 14
- 12
app/views/common/scripts.scala.html View File

@@ -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))");
}
}


+ 1
- 1
app/views/common/select2.scala.html View File

@@ -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>")
}

+ 95
- 92
app/views/common/usermenu.scala.html View File

@@ -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>

+ 1
- 1
app/views/error/forbidden.scala.html View File

@@ -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>

+ 1
- 1
app/views/git/create.scala.html View File

@@ -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)

+ 1
- 1
app/views/git/edit.scala.html View File

@@ -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)


+ 1
- 1
app/views/git/fork.scala.html View File

@@ -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

+ 2
- 2
app/views/git/partial_list.scala.html View File

@@ -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">

+ 2
- 2
app/views/git/partial_pull_request_event.scala.html View File

@@ -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>

+ 1
- 1
app/views/git/partial_reviewlist.scala.html View File

@@ -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

+ 1
- 1
app/views/git/partial_state.scala.html View File

@@ -28,7 +28,7 @@

@getCodeURL(project: Project) = @{
if(ProjectUser.isMember(project.id, UserApp.currentUser().id)){
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)
}

+ 3
- 3
app/views/git/viewChanges.scala.html View File

@@ -47,7 +47,7 @@
</div>
</div>

<div class="codediff-wrap mt10 @if(request.cookies.get("diffs-only") != null){diffs-only}">
<div class="codediff-wrap mt10 @if(requestHeader.cookies.get("diffs-only") != null){diffs-only}">
<button type="button" class="ybtn ybtn-default btn-show-reviewcards">
<i class="yobicon-restore"></i>
</button>
@@ -158,8 +158,8 @@
</button>

<ul class="nav nav-tabs" style="margin-bottom:10px;">
<li class="active"><a href="#reviewcards-open" data-toggle="tab">@Messages("issue.state.open") @pull.getCommentThreadsByState(CommentThread.ThreadState.OPEN).size()</a></li>
<li><a href="#reviewcards-closed" data-toggle="tab">@Messages("issue.state.closed") @pull.getCommentThreadsByState(CommentThread.ThreadState.CLOSED).size()</a></li>
<li class="active"><a href="#reviewcards-open" data-toggle="tab">@Messages("issue.state.open") @pull.getCommentThreadsByState(CommentThread.ThreadState.OPEN).size</a></li>
<li><a href="#reviewcards-closed" data-toggle="tab">@Messages("issue.state.closed") @pull.getCommentThreadsByState(CommentThread.ThreadState.CLOSED).size</a></li>
</ul>

<div class="tab-content review-list">

+ 1
- 1
app/views/help/keymap.scala.html View File

@@ -20,7 +20,7 @@
**@
@(section:String, project:Project)(implicit request: play.api.mvc.RequestHeader)

@isMac = @{request.headers.get("User-Agent").getOrElse("").contains("Macintosh")}
@isMac = @{requestHeader.headers.get("User-Agent").getOrElse("").contains("Macintosh")}
@ctrl = @{if(isMac){"⌘"}else{"CTRL"}}

<div class="pull-right" style="padding:10px 0;">

+ 1
- 1
app/views/index/partial_notifications.scala.html View File

@@ -51,7 +51,7 @@
}

@defining(NotificationEvent.findByReceiver(UserApp.currentUser, from, size)){ notifications =>
@if(notifications.size() == 0){
@if(notifications.size == 0){
<div class="warning-none">
<i class="yobicon-danger"></i> @Messages("notification.none")
</div>

+ 1
- 1
app/views/issue/create.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, issueForm:Form[Issue], project:Project)
@(title:String, issueForm: play.data.Form[Issue], project:Project)
@import helper._
@import scala.collection.mutable.Map
@import models.enumeration.ResourceType

+ 1
- 1
app/views/issue/edit.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, issueForm:Form[Issue], issue:Issue, project:Project)
@(title:String, issueForm: play.data.Form[Issue], issue:Issue, project:Project)
@import helper._
@import scala.collection.mutable.Map
@import models.enumeration.ResourceType

+ 5
- 5
app/views/issue/my_partial_list.scala.html View File

@@ -70,13 +70,13 @@
</span>
}

@if(issue.comments.size()>0 || issue.voters.size()>0) {
@if(issue.comments.size>0 || issue.voters.size>0) {
<span class="infos-item item-count-groups">
@if(issue.comments.size()>0){
@countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size() )
@if(issue.comments.size>0){
@countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size )
}
@if(issue.voters.size()>0){
@countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size(), "strong" )
@if(issue.voters.size>0){
@countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size, "strong" )
}
</span>
}

+ 3
- 3
app/views/issue/my_partial_list_quicksearch.scala.html View File

@@ -25,7 +25,7 @@
<li @if(param.assigneeId == UserApp.currentUser().id){ class="active"}>
<a pjax-filter href="#"
data-author-id=""
data-assignee-id="@User.findByLoginId(session.get("loginId")).id"
data-assignee-id="@UserApp.currentUser.id"
data-milestone-id="@param.milestoneId"
data-mention-id="">
@Messages("issue.list.assignedToMe")
@@ -33,7 +33,7 @@
</li>
<li @if(param.authorId == UserApp.currentUser().id){ class="active"}>
<a pjax-filter href="#"
data-author-id="@User.findByLoginId(session.get("loginId")).id"
data-author-id="@UserApp.currentUser.id"
data-assignee-id=""
data-milestone-id="@param.milestoneId"
data-mention-id="">
@@ -45,7 +45,7 @@
data-author-id=""
data-assignee-id=""
data-milestone-id="@param.milestoneId"
data-mention-id="@User.findByLoginId(session.get("loginId")).id">
data-mention-id="@UserApp.currentUser.id">
@Messages("issue.list.mentionedOfMe")
</a>
</li>

+ 1
- 1
app/views/issue/my_partial_search.scala.html View File

@@ -78,7 +78,7 @@
</ul>
@if(!currentPage.getList.isEmpty){
<div class="filter-wrap small-heights">
@if(currentPage.getList.size() > 1){
@if(currentPage.getList.size > 1){

<div class="filters pull-right">
@makeFilterLink("dueDate", param.orderBy, param.orderDir, Messages("common.order.dueDate"))

+ 5
- 5
app/views/issue/partial_list.scala.html View File

@@ -73,13 +73,13 @@
</span>
}

@if(issue.comments.size()>0 || issue.voters.size()>0) {
@if(issue.comments.size>0 || issue.voters.size>0) {
<span class="infos-item item-count-groups">
@if(issue.comments.size()>0){
@countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size() )
@if(issue.comments.size>0){
@countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size )
}
@if(issue.voters.size()>0){
@countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size(), "strong" )
@if(issue.voters.size>0){
@countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size, "strong" )
}
</span>
}

+ 2
- 2
app/views/issue/partial_list_quicksearch.scala.html View File

@@ -37,7 +37,7 @@
@if(!UserApp.currentUser().isAnonymous){
<li @if(param.assigneeId == UserApp.currentUser().id){ class="active"}>
<a pjax-filter href="#"
data-assignee-id="@User.findByLoginId(session.get("loginId")).id"
data-assignee-id="@UserApp.currentUser.id"
data-author-id=""
data-milestone-id="@param.milestoneId">
@Messages("issue.list.assignedToMe")
@@ -47,7 +47,7 @@
<li @if(param.authorId == UserApp.currentUser().id){ class="active"}>
<a pjax-filter href="#"
data-assignee-id=""
data-author-id="@User.findByLoginId(session.get("loginId")).id"
data-author-id="@UserApp.currentUser.id"
data-milestone-id="@param.milestoneId">
@Messages("issue.list.authoredByMe")
<span class="num-badge pull-right">@Issue.countIssuesBy(project.id, paramForIssuesAuthoredByMe)</span>

+ 2
- 2
app/views/issue/partial_list_wrap.scala.html View File

@@ -70,7 +70,7 @@
@partial_massupdate(project, param)
}

@if(currentPage.getList.size() > 1){
@if(currentPage.getList.size > 1){
<div class="filters pull-right">
@makeFilterLink("dueDate", param.orderBy, param.orderDir, Messages("common.order.dueDate"))
@makeFilterLink("updatedDate", param.orderBy, param.orderDir, Messages("common.order.updatedDate"))
@@ -83,7 +83,7 @@
@partial_list(project, currentPage.getList, param, currentPage.getPageIndex, currentPage.getTotalPageCount)

<div class="pull-left" style="padding:10px;">
<a href="@addQueryString(removeQueryString(request.uri, "pageNum"), "format=xls")" class="ybtn small">
<a href="@addQueryString(removeQueryString(requestHeader.uri, "pageNum"), "format=xls")" class="ybtn small">
<i class="yobicon-file-excel"></i> @Messages("issue.downloadAsExcel")
</a>
</div>

+ 8
- 3
app/views/issue/view.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, issue:Issue, issueForm:Form[Issue], commentForm:Form[Comment],project:Project)
@(title:String, issue:Issue, issueForm: play.data.Form[Issue], commentForm: play.data.Form[Comment],project:Project)
@import org.apache.commons.lang.StringUtils
@import helper._
@import scala.collection.mutable.Map
@@ -39,7 +39,12 @@

@isFirstState(state:State) = {@if(issue.state.state == Issue.availableStates.get(0).state()){dirty}}

@urlToIssues = @{ urlToList(request.getHeader("Referer"), routes.IssueApp.issues(project.owner, project.name, "open").toString()) }
@urlToIssues = @{
requestHeader.headers.get("Referer") match {
case Some(u) => urlToList(u, routes.IssueApp.issues(project.owner, project.name, "open").toString())
case _ => routes.IssueApp.issues(project.owner, project.name, "open").toString()
}
}

@urlToVote = @{
if(issue.isVotedBy(UserApp.currentUser)){
@@ -113,7 +118,7 @@
}

<div id="vote" class="vote-wrap">
@if(isResourceCreatable(User.findByLoginId(session.get("loginId")), issue.asResource(), ResourceType.ISSUE_COMMENT)) {
@if(isResourceCreatable(UserApp.currentUser, issue.asResource(), ResourceType.ISSUE_COMMENT)) {
<a href="@urlToVote" class="ybtn @if(issue.isVotedBy(UserApp.currentUser)){ybtn-watching}" title="@getVoteButtonTitle"
data-request-method="post" data-toggle="tooltip">
<span class="heart"><i class="yobicon-hearts"></i></span>

+ 1
- 1
app/views/milestone/create.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, form: Form[Milestone], project: Project)
@(title:String, form: play.data.Form[Milestone], project: Project)

@import utils.TemplateHelper._
@import models.enumeration._

+ 1
- 1
app/views/milestone/edit.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title: String, form: Form[Milestone], milestoneId: Long, project: Project)
@(title: String, form: play.data.Form[Milestone], milestoneId: Long, project: Project)

@import utils.TemplateHelper._
@import models.enumeration._

+ 5
- 2
app/views/organization/create.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, form: Form[Organization])
@(title:String, form: play.data.Form[Organization])

@siteLayout("app.name", utils.MenuType.NONE) {
<div class="page-wrap-outer">
@@ -32,7 +32,10 @@
<dt>
<div class="n-alert" data-errType="name">
<div class="orange-txt">
@if(flash.get("warning") != null) { <span class="warning">@Messages(flash.get("warning"))</span> }
@requestHeader.flash.get("warning") match {
case Some(msg) => { <span class="warning">@Messages(msg)</span> }
case None => { }
}
<span class="msg wrongName" style="display: none;"></span>
</div>
</div>

+ 1
- 1
app/views/organization/partial_settingmenu.scala.html View File

@@ -23,7 +23,7 @@
@isActiveSubMenu(calls: Call*) = @{
var menuState = ""
for(call <- calls) {
if(call.toString().equals(request().path().toString())) {
if(call.toString().equals(requestHeader.path.toString())) {
menuState = "active"
}
}

+ 1
- 1
app/views/organization/setting.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(organization:Organization, organizationForm: Form[Organization])
@(organization:Organization, organizationForm: play.data.Form[Organization])

@import utils.TemplateHelper._


+ 1
- 1
app/views/organization/view.scala.html View File

@@ -114,7 +114,7 @@
}
</ul>
<p>
@Html(Messages("project.onmember", User.findUsersByProject(project.id).length))
@Html(Messages("project.onmember", User.findUsersByProject(project.id).size))
<i class="yobicon-eye yobicon-middle"></i> @Html(Messages("project.onwatching", project.getWatchingCount))
</p>
</div>

+ 1
- 1
app/views/project/change_vcs.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(message: String)(projectForm: Form[Project], project:Project)
@(message: String)(projectForm: play.data.Form[Project], project:Project)

@import helper._
@import utils.TemplateHelper._

+ 1
- 1
app/views/project/create.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, newProjectForm:Form[Project], orgUserList:List[OrganizationUser])
@(title:String, newProjectForm: play.data.Form[Project], orgUserList:List[OrganizationUser])

@import utils.TemplateHelper._
@import playRepository.RepositoryService

+ 1
- 1
app/views/project/delete.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(message: String)(projectForm: Form[Project], project:Project)
@(message: String)(projectForm: play.data.Form[Project], project:Project)

@import helper._
@import utils.TemplateHelper._

+ 1
- 1
app/views/project/importing.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, newProjectForm:Form[Project], orgUserList:List[OrganizationUser])
@(title:String, newProjectForm: play.data.Form[Project], orgUserList:List[OrganizationUser])

@import utils.TemplateHelper._
@import playRepository.RepositoryService

+ 1
- 1
app/views/project/list.scala.html View File

@@ -89,7 +89,7 @@
}
</ul>
<p>
@Html(Messages("project.onmember", User.findUsersByProject(project.id).length))
@Html(Messages("project.onmember", User.findUsersByProject(project.id).size))
<i class="yobicon-eye yobicon-middle"></i> @Html(Messages("project.onwatching", project.getWatchingCount))
</p>
</div>

+ 1
- 1
app/views/project/partial_history.scala.html View File

@@ -47,7 +47,7 @@
<div class="content-container nm">
<div class="main-stream" style="width:100%;">
<ul class="activity-streams unstyled">
@for(history <- histories.iterator()) {
@for(history <- histories.iterator) {
<li class="activity-stream">
<a href="@userPageUrlOnHistory(history)" class="avatar-wrap pull-left mr10">
<img src="@userAvatarUrlOnHistory(history)" width="32" height="32">

+ 1
- 1
app/views/project/partial_settingmenu.scala.html View File

@@ -27,7 +27,7 @@
@isActiveSubMenu(calls: Call*) = @{
var menuState = ""
for(call <- calls) {
if(call.toString().equals(request().path())) {
if(call.toString().equals(requestHeader.path)) {
menuState = "active"
}
}

+ 1
- 1
app/views/project/setting.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(message: String)(projectForm: Form[Project], project: Project, branches: List[String])
@(message: String)(projectForm: play.data.Form[Project], project: Project, branches: List[String])

@import helper._
@import utils.TemplateHelper._

+ 1
- 1
app/views/project/transfer.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(message: String)(projectForm: Form[Project], project:Project)
@(message: String)(projectForm: play.data.Form[Project], project:Project)

@import helper._
@import utils.TemplateHelper._

+ 3
- 2
app/views/projectMenu.scala.html View File

@@ -131,8 +131,9 @@ $(document).ready(function(){
@if(project.menuSetting.pullRequest && project.vcs.equals("GIT")){
,"F": "@getPullRequestURL(project)"
}
@if(ProjectUser.roleOf(session.get("loginId"), project).equals("manager")){
,"Q": "@routes.ProjectApp.settingForm(project.owner, project.name)"
@requestHeader.session.get("loginId") match {
case Some(role) if role.equals("manager") => { "Q": "@routes.ProjectApp.settingForm(project.owner, project.name)" }
case _ => { }
}
};


+ 2
- 2
app/views/reviewthread/partial_list.scala.html View File

@@ -24,7 +24,7 @@
@import utils.TemplateHelper._
@import utils.JodaDateUtil

@if(page.getList().size() > 0){
@if(page.getList().size > 0){
<ul class="post-list-wrap">
@for(thread <- page.getList()) {
@defining(User.find.byId(thread.getFirstReviewComment.author.id)){ user =>
@@ -54,7 +54,7 @@
<span class="infos-item" title="@JodaDateUtil.getDateString(thread.createdDate)">
@agoOrDateString(thread.createdDate)
</span>
@defining(thread.reviewComments.size()-1) { numberOfComments =>
@defining(thread.reviewComments.size-1) { numberOfComments =>

@if(numberOfComments > 0) {
<span class="infos-item item-count-groups">

+ 1
- 1
app/views/search/partial_issue_comments.scala.html View File

@@ -25,7 +25,7 @@
@import utils.JodaDateUtil

@defining(searchResult.getIssueComments) { page =>
@if(page.getList.length > 0) {
@if(page.getList.size > 0) {
<ul class="search-list-wrap">
@for(comment <- page.getList) {
@defining(User.findByLoginId(comment.authorLoginId)){ user =>

+ 1
- 1
app/views/search/partial_issues.scala.html View File

@@ -27,7 +27,7 @@
@urlToList(project:Project, state:String) = {@routes.IssueApp.issues(project.owner, project.name, "open", "html", 1)}

@defining(searchResult.getIssues) { page =>
@if(page.getList.length > 0) {
@if(page.getList.size > 0) {
<ul class="search-list-wrap">
@for(issue <- page.getList) {
@defining(User.findByLoginId(issue.authorLoginId)){ user =>

+ 1
- 1
app/views/search/partial_milestones.scala.html View File

@@ -34,7 +34,7 @@
}

@defining(searchResult.getMilestones) { page =>
@if(page.getList.length > 0) {
@if(page.getList.size > 0) {
<ul class="search-list-wrap">
@for(milestone <- page.getList) {
<li class="search-list-item">

+ 1
- 1
app/views/search/partial_post_comments.scala.html View File

@@ -25,7 +25,7 @@
@import utils.JodaDateUtil

@defining(searchResult.getPostComments) { page =>
@if(page.getList.length > 0) {
@if(page.getList.size > 0) {
<ul class="search-list-wrap">
@for(comment <- page.getList) {
@defining(User.findByLoginId(comment.authorLoginId)){ user =>

+ 1
- 1
app/views/search/partial_posts.scala.html View File

@@ -25,7 +25,7 @@
@import utils.JodaDateUtil

@defining(searchResult.getPosts) { page =>
@if(page.getList.length > 0) {
@if(page.getList.size > 0) {
<ul class="search-list-wrap">
@for(post <- page.getList) {
@defining(User.findByLoginId(post.authorLoginId)){ user =>

+ 1
- 1
app/views/search/partial_projects.scala.html View File

@@ -25,7 +25,7 @@
@import utils.JodaDateUtil._

@defining(searchResult.getProjects) { page =>
@if(page.getList.length > 0) {
@if(page.getList.size > 0) {
<ul class="search-list-wrap">
@for(project <- page.getList) {
@defining(User.findByLoginId(project.owner)){ user =>

+ 1
- 1
app/views/search/partial_reviews.scala.html View File

@@ -26,7 +26,7 @@
@import utils.TemplateHelper.DiffRenderer._

@defining(searchResult.getReviews) { page =>
@if(page.getList.length > 0) {
@if(page.getList.size > 0) {
<ul class="search-list-wrap">
@for(review <- page.getList) {
<li class="search-list-item">

+ 1
- 1
app/views/search/partial_users.scala.html View File

@@ -25,7 +25,7 @@
@import utils.JodaDateUtil

@defining(searchResult.getUsers) { page =>
@if(page.getList.length > 0) {
@if(page.getList.size > 0) {
<ul class="search-list-wrap">
@for(user <- page.getList) {
<li class="search-list-item project">

+ 2
- 2
app/views/site/mail.scala.html View File

@@ -37,11 +37,11 @@
</div>
}

@if(notConfiguredItems != null && notConfiguredItems.size() > 0) {
@if(notConfiguredItems != null && notConfiguredItems.size > 0) {
<div class="alert alert-error">
<p>@Html(Messages("site.mail.notConfigured", "/admin/mailconf"))</p>
<ul>
@for(item <- notConfiguredItems.iterator()) {
@for(item <- notConfiguredItems.iterator) {
<li>@item</li>
}
</ul>

+ 1
- 1
app/views/site/siteMngLayout.scala.html View File

@@ -23,7 +23,7 @@
@isActiveMenu(calls: Call*) = @{
var menuState = ""
for(call <- calls) {
if(call.toString().equals(request().path())) {
if(call.toString().equals(requestHeader.path)) {
menuState = "active"
}
}

+ 1
- 1
app/views/site/userList.scala.html View File

@@ -179,7 +179,7 @@
<script type="text/x-jquery-tmpl" id="dismissable-alerts-request">
<div class="alert alert-fail">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<h4>sending request...</h4>
<h4>sending requestHeader...</h4>
</div>
</script>


+ 1
- 1
app/views/user/edit.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(userForm:Form[User], user:User)
@(userForm: play.data.Form[User], user:User)

@import helper._
@import utils.TemplateHelper._

+ 1
- 1
app/views/user/edit_emails.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(userForm:Form[User], user:User)
@(userForm: play.data.Form[User], user:User)

@import helper._
@import utils.TemplateHelper._

+ 1
- 1
app/views/user/edit_notifications.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(userForm:Form[User], user:User)
@(userForm: play.data.Form[User], user:User)

@import helper._
@import utils.TemplateHelper._

+ 1
- 1
app/views/user/edit_password.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(userForm:Form[User], user:User)
@(userForm: play.data.Form[User], user:User)

@import helper._
@import utils.TemplateHelper._

+ 1
- 1
app/views/user/login.scala.html View File

@@ -18,7 +18,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(message:String, authInfoForm:Form[AuthInfo], redirectUrl:String)
@(message:String, authInfoForm: play.data.Form[AuthInfo], redirectUrl:String)

@siteLayout(message, utils.MenuType.NONE) {
<div class="page full">

+ 5
- 5
app/views/user/partial_issues.scala.html View File

@@ -64,13 +64,13 @@
</span>
}

@if(issue.comments.size()>0 || issue.voters.size()>0) {
@if(issue.comments.size>0 || issue.voters.size>0) {
<span class="infos-item item-count-groups">
@if(issue.comments.size()>0){
@countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size() )
@if(issue.comments.size>0){
@countHtml("comments",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#comments", issue.comments.size )
}
@if(issue.voters.size()>0){
@countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size(), "strong" )
@if(issue.voters.size>0){
@countHtml("hearts",routes.IssueApp.issue(issue.project.owner, issue.project.name, issue.getNumber).toString() + "#vote", issue.voters.size, "strong" )
}
</span>
}

+ 4
- 4
app/views/user/partial_projectlist.scala.html View File

@@ -68,9 +68,9 @@
</div>

<div class="stats">
@Html(Messages("project.onmember", User.findUsersByProject(project.id).length))<br/>
@Html(Messages("project.onmember", User.findUsersByProject(project.id).size))<br/>

@if(session.get("loginId") != project.owner ){
@if(UserApp.currentUser.loginId != project.owner ){
@if(User.isWatching(project)){
<a href="@routes.WatchProjectApp.unwatch(project.owner, project.name)" class="nbtn blue medium watchBtn">
<i class="yobicon-eye-open yobicon-middle yobicon-white"></i>
@@ -87,7 +87,7 @@