summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-12-27 19:47:21 -0800
committerStan Hu <stanhu@gmail.com>2015-12-27 19:47:21 -0800
commit4c6591c9220676c97ddf2dda36e8e855d3196a74 (patch)
tree0d1326a8ca69e60e9c851d9e6f4c6b83f92877bd
parent6f0ee5c9089d469a59879fbc0ffd6a2f3d69687e (diff)
downloadgitlab-ce-4c6591c9220676c97ddf2dda36e8e855d3196a74.tar.gz
Make sign-up form retain fields after failed CAPTCHA test
-rw-r--r--app/views/devise/shared/_signup_box.html.haml9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml
index 3c079d7e2f8..49fab016bfa 100644
--- a/app/views/devise/shared/_signup_box.html.haml
+++ b/app/views/devise/shared/_signup_box.html.haml
@@ -6,17 +6,18 @@
.login-heading
%h3 Create an account
.login-body
+ - user = params[:user].present? ? params[:user] : {}
= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
.devise-errors
= devise_error_messages!
%div
- = f.text_field :name, class: "form-control top", placeholder: "Name", required: true
+ = f.text_field :name, class: "form-control top", value: user[:name], placeholder: "Name", required: true
%div
- = f.text_field :username, class: "form-control middle", placeholder: "Username", required: true
+ = f.text_field :username, class: "form-control middle", value: user[:username], placeholder: "Username", required: true
%div
- = f.email_field :email, class: "form-control middle", placeholder: "Email", required: true
+ = f.email_field :email, class: "form-control middle", value: user[:email], placeholder: "Email", required: true
.form-group.append-bottom-20#password-strength
- = f.password_field :password, class: "form-control bottom", id: "user_password_sign_up", placeholder: "Password", required: true
+ = f.password_field :password, class: "form-control bottom", value: user[:password], id: "user_password_sign_up", placeholder: "Password", required: true
%div
- if Gitlab.config.recaptcha.enabled
= recaptcha_tags