summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-06-20 12:25:59 +0200
committerAzul <azul@leap.se>2013-06-20 12:25:59 +0200
commit3a89159d249c76ed7dbde3e51541ffc82b74ccdb (patch)
tree5813f43e1514d97c83db8d8a37319e57f4e63b31
parentf1d53b81bfcd9803d73b26ee025160b60f1965c6 (diff)
parent11c4155aff42fe3f8bbce858bc87cdb6a91f67a2 (diff)
Merge remote-tracking branch 'origin/js_cookie_warning' into master
-rw-r--r--users/app/views/sessions/new.html.haml5
-rw-r--r--users/app/views/users/_warnings.html.haml12
-rw-r--r--users/app/views/users/new.html.haml1
-rw-r--r--users/config/locales/en.yml2
4 files changed, 18 insertions, 2 deletions
diff --git a/users/app/views/sessions/new.html.haml b/users/app/views/sessions/new.html.haml
index a04f584..6743407 100644
--- a/users/app/views/sessions/new.html.haml
+++ b/users/app/views/sessions/new.html.haml
@@ -1,8 +1,9 @@
.span8.offset2
+ = render :partial => 'users/warnings'
%h2=t :login
= simple_form_for @session, :validate => true, :html => { :id => :new_session, :class => 'form-horizontal' } do |f|
%legend=t :login_message
= f.input :login, :input_html => { :id => :srp_username }
= f.input :password, :required => true, :input_html => { :id => :srp_password }
- = f.button :submit, :value => t(:login), :class => 'btn-primary'
- = link_to t(:cancel), root_url, :class => :btn
+ = f.button :submit, :value => t(:login), :class => 'btn-primary'
+ = link_to t(:cancel), root_url, :class => :btn \ No newline at end of file
diff --git a/users/app/views/users/_warnings.html.haml b/users/app/views/users/_warnings.html.haml
new file mode 100644
index 0000000..7e0b2ce
--- /dev/null
+++ b/users/app/views/users/_warnings.html.haml
@@ -0,0 +1,12 @@
+%noscript
+ %div.alert.alert-error=t :js_required
+#cookie_warning.alert.alert-error{:style => "display:none"}
+ =t :cookie_disabled_warning
+:javascript
+ document.cookie = "testing=cookies_enabled; path=/";
+ if(document.cookie.indexOf("testing=cookies_enabled") < 0)
+ {
+ document.getElementById('cookie_warning').style.display = 'block';
+ } else {
+ document.getElementById('cookie_warning').style.display = 'none';
+ } \ No newline at end of file
diff --git a/users/app/views/users/new.html.haml b/users/app/views/users/new.html.haml
index 98cccb0..80482b2 100644
--- a/users/app/views/users/new.html.haml
+++ b/users/app/views/users/new.html.haml
@@ -1,4 +1,5 @@
.span8.offset2
+ = render :partial => 'warnings'
%h2=t :signup
= user_form do |f|
%legend= t(:signup_message)
diff --git a/users/config/locales/en.yml b/users/config/locales/en.yml
index 2077858..dded88c 100644
--- a/users/config/locales/en.yml
+++ b/users/config/locales/en.yml
@@ -22,6 +22,8 @@ en:
use_ascii_key: "Use ASCII-armored PGP key"
can_retype_old_password: "Retype your old password if you would like to keep that"
associated_email: "The associated email address is"
+ cookie_disabled_warning: "You have cookies disabled. You will not be able to login until you enable cookies."
+ js_required: "We are sorry, but this doesn't work without javascript enabled. This is for security reasons."
activemodel:
models: