Skip to content

Commit

Permalink
settings to change placeholders in login form - closes #2204
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Feb 22, 2016
1 parent 127a16b commit 0e6c175
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@
"Password_Change_Disabled" : "Your Rocket.Chat administrator has disabled the changing of passwords",
"Password_changed_successfully" : "Password changed successfully",
"People" : "People",
"Placeholder_for_email_or_username_login_field" : "Placeholder for email or username login field",
"Placeholder_for_password_login_field" : "Placeholder for password login field",
"Please_enter_value_for_url" : "Please enter a value for the url of your avatar.",
"Please_enter_your_new_password_below" : "Please enter your new password below:",
"Please_wait" : "Please wait",
Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-lib/server/startup/settings.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ RocketChat.settings.addGroup 'Accounts', ->
@add 'Accounts_RequireNameForSignUp', true, { type: 'boolean', public: true }
@add 'Accounts_LoginExpiration', 90, { type: 'int', public: true }
@add 'Accounts_ShowFormLogin', true, { type: 'boolean', public: true }
@add 'Accounts_EmailOrUsernamePlaceholder', '', { type: 'string', public: true, i18nLabel: 'Placeholder_for_email_or_username_login_field' }
@add 'Accounts_PasswordPlaceholder', '', { type: 'string', public: true, i18nLabel: 'Placeholder_for_password_login_field' }

@section 'Registration', ->
@add 'Accounts_EmailVerification', false, { type: 'boolean', public: true }
Expand Down
6 changes: 6 additions & 0 deletions packages/rocketchat-ui-login/login/form.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ Template.loginForm.helpers
passwordresetAllowed: ->
return RocketChat.settings.get 'Accounts_PasswordReset'

emailOrUsernamePlaceholder: ->
return RocketChat.settings.get('Accounts_EmailOrUsernamePlaceholder') or t("Email_or_username")

passwordPlaceholder: ->
return RocketChat.settings.get('Accounts_PasswordPlaceholder') or t("Password")

Template.loginForm.events
'submit #login-card': (event, instance) ->
event.preventDefault()
Expand Down
4 changes: 2 additions & 2 deletions packages/rocketchat-ui-login/login/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ <h2>{{{_ "Registration_Succeeded"}}}</h2>
<input type="text" name='name' placeholder='{{namePlaceholder}}' dir="auto" />
</div>
<div class='input-text active {{showEmailOrUsername}}'>
<input type="text" name='emailOrUsername' placeholder='{{_ "Email_or_username"}}' autocapitalize="off" autocorrect="off" />
<input type="text" name='emailOrUsername' placeholder='{{emailOrUsernamePlaceholder}}' autocapitalize="off" autocorrect="off" />
</div>
<div class='input-text active {{showEmail}}'>
<input type="email" name='email' placeholder='{{_ "Email"}}' />
</div>
<div class='input-text active {{showPassword}}'>
<input type="password" name='pass' placeholder='{{_ "Password"}}' />
<input type="password" name='pass' placeholder='{{passwordPlaceholder}}' />
</div>
<div class='input-text active {{showConfirmPassword}}'>
<input type="password" name='confirm-pass' placeholder='{{_ "Confirm_password"}}' />
Expand Down

0 comments on commit 0e6c175

Please sign in to comment.