Implement close window on server level

This commit is contained in:
2014-09-05 16:00:44 +02:00
parent 0c49a9fa4d
commit ad7b396dd1
5 changed files with 15 additions and 3 deletions
+4
View File
@@ -12,6 +12,10 @@ class DashboardController < ApplicationController
log.save
end
def close_window
render layout: false
end
# Testing action
def select_qrcode
#@tables = Table.all.sample(2) | List.active.map(&:table)
@@ -0,0 +1,7 @@
<!doctype html>
<html>
<head>
<script>localStorage.setItem('auth_token', '<%= params[:authentication_token] %>'); localStorage.setItem('user_id', '<%= params[:user_id] %>');window.close()</script>
</head>
<body></body>
</html>
+1
View File
@@ -71,6 +71,7 @@ Qwaiter::Application.routes.draw do
post '/user/check_table_join_status' => 'user#check_table_join_status'
get '/user/obtain_token' => 'user#obtain_token', as: :user_obtain_token
post '/user/obtain_token' => 'user#obtain_token', constraints: {format: :json}
get '/close_window' => 'dashboard#close_window'
namespace :users, path: '/user' do
resources :product_categories, only: [:index]
@@ -7,7 +7,7 @@ step "There is no user information stored in the local storage" do
end
step "I visit the user obtain token path" do
visit user_obtain_token_path
visit user_root_path # obtain token through ember application
end
step "I am signed in as a user" do
+2 -2
View File
@@ -16,7 +16,7 @@ User
----
- test met veel producten
- Only show join requests menu when there actually are join requests
- splash screen
Bugs
----
@@ -71,5 +71,5 @@ User
Integrations
------------
- Payleven? Payment
- Bonnetjes machine
- Payleven? Payment