diff options
author | azul <azul@riseup.net> | 2014-05-09 11:03:53 +0200 |
---|---|---|
committer | azul <azul@riseup.net> | 2014-05-09 11:03:53 +0200 |
commit | 726244f1c6bb72fb53a257c084dfbdf7b9c2b03c (patch) | |
tree | 1f4bf66497851265a62081124a4ff5b23d0cd09e /app/views | |
parent | cf6aa0a6c8852424e39e4785a1bd783ab475376b (diff) | |
parent | 616313b406e561b45a73e34f54fd5fc7595f9658 (diff) |
Merge pull request #156 from azul/bugfix/5548-hide-signup-forms-without-js0.5.1-rc2
hide srp forms when no js is available
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/sessions/new.html.haml | 4 | ||||
-rw-r--r-- | app/views/users/_warnings.html.haml | 2 | ||||
-rw-r--r-- | app/views/users/new.html.haml | 10 |
3 files changed, 10 insertions, 6 deletions
diff --git a/app/views/sessions/new.html.haml b/app/views/sessions/new.html.haml index 6f3b324..bb7e4bd 100644 --- a/app/views/sessions/new.html.haml +++ b/app/views/sessions/new.html.haml @@ -1,9 +1,9 @@ .span1 .span9 - = render :partial => 'users/warnings' %h2=t :login .lead=t :login_info - = simple_form_for [:api, @session], :validate => true, :html => { :id => :new_session, :class => 'form-horizontal' } do |f| + = render :partial => 'users/warnings' + = simple_form_for [:api, @session], validate: true, html: { id: :new_session, class: 'form-horizontal hidden js-show', style: "display:none;" } do |f| = f.input :login, :required => false, :label => t(:username), :input_html => { :id => :srp_username } = f.input :password, :required => false, :input_html => { :id => :srp_password } = f.button :wrapped, value: t(:login), cancel: home_path diff --git a/app/views/users/_warnings.html.haml b/app/views/users/_warnings.html.haml index 79ab103..baf80a4 100644 --- a/app/views/users/_warnings.html.haml +++ b/app/views/users/_warnings.html.haml @@ -9,4 +9,4 @@ document.getElementById('cookie_warning').style.display = 'block'; } else { document.getElementById('cookie_warning').style.display = 'none'; - }
\ No newline at end of file + } diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml index 3478989..bc36068 100644 --- a/app/views/users/new.html.haml +++ b/app/views/users/new.html.haml @@ -1,14 +1,18 @@ -# --# This form is handled entirely by javascript, so take care when changing element ids. +-# This form is handled entirely by javascript +-# Please take care when changing element ids. +-# +-# The form is hidden when no js is available +-# to prevent submission in the clear. -# -- form_options = {:url => '/not-used', :html => {:id => 'new_user', :class => user_form_class('form-horizontal')}, :validate => true} +- form_options = {url: '/not-used', html: {id: 'new_user', class: user_form_class('form-horizontal'), style: 'display:none'}, validate: true} .span1 .span9 - = render :partial => 'warnings' %h2=t :signup .lead=t :signup_info + = render :partial => 'warnings' = simple_form_for(@user, form_options) do |f| = f.input :login, :label => t(:username), :required => false, :input_html => { :id => :srp_username } = f.input :password, :required => false, :validate => true, :input_html => { :id => :srp_password } |