diff --git a/Gemfile.lock b/Gemfile.lock index 4619a5c..cdc4ff0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -161,6 +161,7 @@ GEM rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) rake (10.0.4) + rb-fsevent (0.9.3) rdoc (3.12.2) json (~> 1.4) rspec (2.8.0) @@ -245,6 +246,7 @@ DEPENDENCIES netzke-core (~> 0.8.0) pry (~> 0.9.8) rails (= 3.2.13) + rb-fsevent rspec-rails (~> 2.8.1) sass-rails (~> 3.2.3) shoulda-matchers (~> 1.0.0) diff --git a/app/assets/javascripts/custom_netzke_helpers.js b/app/assets/javascripts/custom_netzke_helpers.js index 443ea9e..912f2c9 100644 --- a/app/assets/javascripts/custom_netzke_helpers.js +++ b/app/assets/javascripts/custom_netzke_helpers.js @@ -38,11 +38,9 @@ Ext.define('Ext.ux.form.field.ColorCombo', { submitValue:false, readOnly: me.readOnly, onTriggerClick: function() { - //needs to be called twice because? - me.picker.alignTo(me.colorField.inputEl); + //show renders, so put first me.picker.show(); me.picker.alignTo(me.colorField.inputEl); - me.picker.show(); } }); me.items.push(me.colorField); diff --git a/app/assets/javascripts/devise/sessions.js b/app/assets/javascripts/devise/sessions.js index e69de29..e58270c 100644 --- a/app/assets/javascripts/devise/sessions.js +++ b/app/assets/javascripts/devise/sessions.js @@ -0,0 +1,45 @@ +$(document).ready(function(){ + $("#checkin_menu").show(); + $("#checkin").click( function(e){ + var username = $("#user_email").val(); + var password = $("#user_password").val(); + $.ajax({ + type: 'POST', + url: '/api/v1/checkin', + dataType: 'json', + contentType: 'application/json', + processData: false, + data: JSON.stringify({"username": username, "password": password }), + complete: function() { }, + success: function(data) { + alert("Checked IN!"); + $("#user_email").val(''); + $("#user_password").val(''); + }, + error: function(data,textStatus) { + alert( "Error: " + JSON.parse(data.responseText)["error"]); + } + }) + }); + $("#checkout").click( function(e){ + var username = $("#user_email").val(); + var password = $("#user_password").val(); + $.ajax({ + type: 'POST', + url: '/api/v1/checkout', + dataType: 'json', + contentType: 'application/json', + processData: false, + data: JSON.stringify({"username": username, "password": password }), + complete: function() { }, + success: function(data) { + alert("Checked OUT!"); + $("#user_email").val(''); + $("#user_password").val(''); + }, + error: function(data,textStatus) { + alert( "Error: " + JSON.parse(data.responseText)["error"]); + } + }) + }); +}); diff --git a/app/assets/javascripts/login.js b/app/assets/javascripts/login.js deleted file mode 100644 index 70a2f44..0000000 --- a/app/assets/javascripts/login.js +++ /dev/null @@ -1,43 +0,0 @@ -$("#checkin_menu").show(); -$("#checkin").click( function(e){ - var username = $("#user_email").val(); - var password = $("#user_password").val(); - $.ajax({ - type: 'POST', - url: '/api/v1/checkin', - dataType: 'json', - contentType: 'application/json', - processData: false, - data: JSON.stringify({"username": username, "password": password }), - complete: function() { }, - success: function(data) { - alert("Checked IN!"); - $("#user_email").val(''); - $("#user_password").val(''); - }, - error: function(data,textStatus) { - alert( "Error: " + JSON.parse(data.responseText)["error"]); - } - }) -}); -$("#checkout").click( function(e){ - var username = $("#user_email").val(); - var password = $("#user_password").val(); - $.ajax({ - type: 'POST', - url: '/api/v1/checkout', - dataType: 'json', - contentType: 'application/json', - processData: false, - data: JSON.stringify({"username": username, "password": password }), - complete: function() { }, - success: function(data) { - alert("Checked OUT!"); - $("#user_email").val(''); - $("#user_password").val(''); - }, - error: function(data,textStatus) { - alert( "Error: " + JSON.parse(data.responseText)["error"]); - } - }) -}); diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 3f64071..e396dc3 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -34,4 +34,3 @@ <% end %> <% end %> <% end %> - diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index 73df488..251fbbb 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -14,7 +14,7 @@ en: devise: failure: already_authenticated: 'You are already signed in.' - unauthenticated: 'You need to sign in or sign up before continuing.' + unauthenticated: 'You need to provide your username and password or sign in/sign up before continuing.' unconfirmed: 'You have to confirm your account before continuing.' locked: 'Your account is locked.' invalid: 'Invalid email or password.'