doortts doortts 2017-07-24
login: Support custom login page messages
@dfb77bc163ac6373eb7683f5307325ae32915d8f
app/assets/stylesheets/less/_page.less
--- app/assets/stylesheets/less/_page.less
+++ app/assets/stylesheets/less/_page.less
@@ -1442,6 +1442,13 @@
     }
 
     .alert h4 { font-size:15px; }
+
+    .email-verification-help {
+        font-weight: bold;
+        padding: 5px;
+        margin-bottom: 10px;
+        font-size: 16px;
+    }
 }
 .login-form-wrap {
     margin-top: 54px;
app/controllers/Application.java
--- app/controllers/Application.java
+++ app/controllers/Application.java
@@ -35,6 +35,8 @@
     public static boolean HIDE_PROJECT_LISTING = play.Configuration.root().getBoolean("application.hide.project.listing", false);
     public static boolean SEND_YONA_USAGE =play.Configuration.root().getBoolean("application.send.yona.usage", true);
     public static String GUEST_USER_LOGIN_ID_PREFIX  = play.Configuration.root().getString("application.guest.user.login.id.prefix ", "");
+    public static String LOGIN_PAGE_LOGINID_PLACEHOLDER  = play.Configuration.root().getString("application.login.page.loginId.placeholder", "");
+    public static String LOGIN_PAGE_PASSWORD_PLACEHOLDER  = play.Configuration.root().getString("application.login.page.password.placeholder", "");
 
     @AnonymousCheck
     public static Result index() {
app/views/user/login.scala.html
--- app/views/user/login.scala.html
+++ app/views/user/login.scala.html
@@ -17,6 +17,22 @@
   allowedProviders.nonEmpty && StringUtils.isNotBlank(allowedProviders(0))
 }
 
+@loginIdPlaceHolder = @{
+  if(StringUtils.isNotBlank(Application.LOGIN_PAGE_LOGINID_PLACEHOLDER)){
+    Application.LOGIN_PAGE_LOGINID_PLACEHOLDER
+  } else {
+    Messages("user.login.key")
+  }
+}
+
+@passwordPlaceHolder = @{
+  if(StringUtils.isNotBlank(Application.LOGIN_PAGE_PASSWORD_PLACEHOLDER)){
+    Application.LOGIN_PAGE_PASSWORD_PLACEHOLDER
+  } else {
+    Messages("user.password")
+  }
+}
+
 @siteLayout(message, utils.MenuType.NONE) {
 <div class="page full">
   <div class="center-wrap tag-line-wrap login">
@@ -26,6 +42,9 @@
     <p class="tag-line">@Messages("app.description")</p>
   </div>
   <div class="login-form-wrap frm-wrap">
+    @if(UserApp.isUsingEmailVerification){
+      <div class="email-verification-help">@Messages("notification.confirm.mail.will.be.sent")</div>
+    }
     <form action="@routes.UserApp.login()" method="POST">
       <input type="hidden" name="redirectUrl" value="@redirectUrl" />
       @if(UserApp.useSocialLoginOnly){
@@ -35,10 +54,10 @@
       } else {
       <dl>
         <dd>
-          <input id="loginIdOrEmailD" name="loginIdOrEmail" type="text" class="text email" autocomplete="off" placeholder="@Messages("user.login.key")">
+          <input id="loginIdOrEmailD" name="loginIdOrEmail" type="text" class="text email" autocomplete="off" placeholder="@loginIdPlaceHolder">
         </dd>
         <dd>
-          <input id="password" name="password" type="password" class="text password" autocomplete="off" placeholder="@Messages("user.password")">
+          <input id="password" name="password" type="password" class="text password" autocomplete="off" placeholder="@passwordPlaceHolder">
         </dd>
       </dl>
 
conf/application.conf.default
--- conf/application.conf.default
+++ conf/application.conf.default
@@ -57,6 +57,10 @@
 #
 # application.use.email.verification = true
 
+# Login form custom input message
+# application.login.page.loginId.placeholder = "Use Emp. no as login id"
+# application.login.page.password.placeholder = ""
+
 # If you enable to use social login or email verification, set followings
 play-easymail {
   from {
conf/messages
--- conf/messages
+++ conf/messages
@@ -386,6 +386,7 @@
 milestone.state.open = Open
 milestone.title.duplicated = Same milestone title already exists. Please enter a different title.
 notification = Notification
+notification.confirm.mail.will.be.sent = If you are trying first login, confirmation mail will be sent.
 notification.help = You will receive notification, when following events occur.
 notification.help.new = when new posts, new issues, new pull-requests or comments on pull-requests are added.
 notification.help.new.comment = when comments are added to post, issue, or code.
conf/messages.ko-KR
--- conf/messages.ko-KR
+++ conf/messages.ko-KR
@@ -385,6 +385,7 @@
 milestone.state.open = 진행중
 milestone.title.duplicated = 마일스톤 제목이 다른것과 중복 됩니다. 다른 제목을 사용하세요.
 notification = 알림
+notification.confirm.mail.will.be.sent = 최초 로그인일 경우 확인 메일이 발송됩니다.
 notification.help = 다음 이벤트가 발생할 때 알림 메시지를 받습니다.
 notification.help.new = 새 글, 이슈, 코드 요청, 코드 요청에 댓글이 등록되었을 때
 notification.help.new.comment = 글, 이슈, 코드에 새 댓글이 등록되었을 때
Add a comment
List