mozo-user connection changes
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
class PagesController < ::ApplicationController
|
class PagesController < ::ApplicationController
|
||||||
include Cmtool::Includes::PagesController
|
include Cmtool::Includes::PagesController
|
||||||
|
|
||||||
|
def show
|
||||||
|
if request.format.json?
|
||||||
|
render json: {}, status: :not_found
|
||||||
|
else
|
||||||
|
super
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ module Users
|
|||||||
user = User.find_by_authentication_token(params[:auth_token])
|
user = User.find_by_authentication_token(params[:auth_token])
|
||||||
sign_in user if user
|
sign_in user if user
|
||||||
sign_out current_user if current_user && !user # Other token attempt of logged in user
|
sign_out current_user if current_user && !user # Other token attempt of logged in user
|
||||||
else
|
elsif request.format.html?
|
||||||
return if Rails.env.test? and action_name == 'index'
|
return if Rails.env.test? and action_name == 'index'
|
||||||
authenticate_user!
|
authenticate_user!
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ module Users
|
|||||||
@list = List.find(params[:list_id])
|
@list = List.find(params[:list_id])
|
||||||
render json: {}, status: :not_found and return unless @list.present? && Array.wrap(@list.user_ids).include?(current_user.id)
|
render json: {}, status: :not_found and return unless @list.present? && Array.wrap(@list.user_ids).include?(current_user.id)
|
||||||
orders = @list.orders.include_relation(:product_orders)
|
orders = @list.orders.include_relation(:product_orders)
|
||||||
render json: JSONAPI::Serializer.serialize(orders, serializer: Users::OrderSerializer, include: %w[product_orders product_orders.order], is_collection: true)
|
render json: JSONAPI::Serializer.serialize(orders, serializer: Users::OrderSerializer, include: %w[list product_orders product_orders.order], is_collection: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Used by the user Ember app
|
# Used by the user Ember app
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
.row
|
.row
|
||||||
h1 data-t='obtain_token.title' = t('user.obtain_token.title')
|
h1 Obtain authentication token...
|
||||||
hr
|
hr
|
||||||
- if current_user.present?
|
- if current_user.present?
|
||||||
p Waiting for authentication to complete.....
|
p Waiting for authentication to complete.....
|
||||||
|
|||||||
Executable
+42
@@ -0,0 +1,42 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
#require 'pathname'
|
||||||
|
#require 'active_support/all'
|
||||||
|
#require 'yaml'
|
||||||
|
#require 'pry'
|
||||||
|
#$root = Pathname.new File.expand_path('../../', __FILE__)
|
||||||
|
class UserApp
|
||||||
|
def path
|
||||||
|
Pathname.new File.expand_path('../../../mozo-user', __FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
|
def user_translations
|
||||||
|
Dir.glob(Rails.root.join('config/user_locales/**/*.yml')).each_with_object({}) do |user_yaml, obj|
|
||||||
|
obj.deep_merge! YAML.load_file(user_yaml)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def all_translations
|
||||||
|
user_translations.deep_merge general_translations
|
||||||
|
end
|
||||||
|
|
||||||
|
def general_translations
|
||||||
|
Rails.application.config.i18n.available_locales.each_with_object({}) do |locale, obj|
|
||||||
|
obj[locale.to_s] = {
|
||||||
|
models: I18n.t('activemodel.models', locale: locale),
|
||||||
|
attributes: I18n.t('activemodel.attributes', locale: locale),
|
||||||
|
helpers: I18n.t('helpers', locale: locale),
|
||||||
|
pagination: I18n.t('views.pagination', locale: locale),
|
||||||
|
errors: I18n.t('errors', locale: locale),
|
||||||
|
date: {day_name: Hash[Date::DAYNAMES.map(&:downcase).zip(I18n.t('date.day_names', locale: locale))]}
|
||||||
|
}
|
||||||
|
end.deep_stringify_keys
|
||||||
|
end
|
||||||
|
|
||||||
|
def write_translations
|
||||||
|
File.open path.join('vendor/i18n/translations.js'), 'w+' do |f|
|
||||||
|
f.puts "$translations = #{JSON.pretty_generate all_translations}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
UserApp.new.write_translations
|
||||||
@@ -138,12 +138,13 @@ module Qwaiter
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#config.middleware.use Rack::Cors do
|
config.middleware.insert_before 0, "Rack::Cors" do
|
||||||
# allow do
|
allow do
|
||||||
# origins '*'
|
origins '*'
|
||||||
# resource '/user/*', :headers => '*,auth_token', :methods => '*' #[:get, :post, :options]
|
#resource '/user/*', :headers => '*', :methods => '*' #[:get, :post, :options]
|
||||||
# end
|
resource '*', headers: :any, methods: '*' #[:get, :post, :options]
|
||||||
#end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Version of your assets, change this if you want to expire all your assets
|
# Version of your assets, change this if you want to expire all your assets
|
||||||
config.assets.version = '1.0'
|
config.assets.version = '1.0'
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
api_mime_types = %W(
|
||||||
|
application/vnd.api+json
|
||||||
|
text/x-json
|
||||||
|
application/json
|
||||||
|
)
|
||||||
|
|
||||||
|
Mime::Type.unregister :json
|
||||||
|
Mime::Type.register 'application/json', :json, api_mime_types
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
en:
|
|
||||||
user:
|
|
||||||
total: Total
|
|
||||||
messages:
|
|
||||||
general_error: Something went wrong
|
|
||||||
cannot_order_on_non_active_list: You cannot place an order on a closed list
|
|
||||||
no_active_list: There is no active list
|
|
||||||
order_is_placed: Your order has been received in good order
|
|
||||||
new_list_created: A new ${models.list} has been created
|
|
||||||
the_list_has_been_closed: The list has been closed
|
|
||||||
illegal_history_list_attempt: The list you want to access is not yours
|
|
||||||
table_not_found: The requested table cannot be found or is not given
|
|
||||||
table_is_occupied: The table you want to sit on is already occupied
|
|
||||||
table_is_reserved: The table you want to sit on is reserved by someone else
|
|
||||||
table_is_closed: The table you want to sit on is not available for service
|
|
||||||
supplier_is_closed: The owner of this table is currently not handling orders
|
|
||||||
table_is_from_other_supplier: You cannot move to another table when you have an open list
|
|
||||||
moved_to_another_table: You successfully moved to another table
|
|
||||||
cannot_identify_table: The application cannot determine the table number
|
|
||||||
unknown_supplier_name: unknown
|
|
||||||
unauthorized: Unauthorized action detected
|
|
||||||
order_could_not_be_processed: 'The order could not be processed'
|
|
||||||
authenticated: Successfully authenticated
|
|
||||||
|
|
||||||
active_list:
|
|
||||||
title: Active list
|
|
||||||
needs_payment: Check please!
|
|
||||||
no_orders_explanation: You did not order anything yet
|
|
||||||
not_active:
|
|
||||||
message: At the moment there is no active list
|
|
||||||
home_button_text: Back
|
|
||||||
join_request:
|
|
||||||
existing_user:
|
|
||||||
title: '${models.plural.join_request}'
|
|
||||||
reject_request: Reject
|
|
||||||
approve_request: Approve
|
|
||||||
no_join_requests_message: No current join requests for your list
|
|
||||||
requestor:
|
|
||||||
join_this_table: Join this table
|
|
||||||
waiting_for_approval: Waiting for approval
|
|
||||||
join_request_rejected: Your request to join the table has been rejected
|
|
||||||
join_request_approved: Your request to join the table has been approved
|
|
||||||
|
|
||||||
list_products:
|
|
||||||
title: Order
|
|
||||||
history_list:
|
|
||||||
title: Closed list
|
|
||||||
list_history:
|
|
||||||
title: Closed lists
|
|
||||||
show_products:
|
|
||||||
# The title gets products: Product.model_name.human_plural that can be used: e.g.: Showing %{products}
|
|
||||||
title: Menu
|
|
||||||
join_occupied_table:
|
|
||||||
title: This table is occupied
|
|
||||||
show_the_products: Show me the menu
|
|
||||||
back: Back
|
|
||||||
home:
|
|
||||||
scan_qr: Scan qr code
|
|
||||||
show_active_list: Show my orders
|
|
||||||
show_active_list_products: Go to the menu
|
|
||||||
basket:
|
|
||||||
total: Total
|
|
||||||
product_category:
|
|
||||||
other_name: Overig
|
|
||||||
obtain_token:
|
|
||||||
title: Authenticate mozo.bar
|
|
||||||
obtain: Authenticate
|
|
||||||
invalid_combination: The email password combination is incorrect
|
|
||||||
move_table:
|
|
||||||
cannot_move_to_occupied_table: 'You cannot move to an occupied table'
|
|
||||||
moved_to_another_table: 'The table is changed.'
|
|
||||||
confirmation_title: 'Move to another table?'
|
|
||||||
confirmation_body: 'Do you want to move to table %{number}?'
|
|
||||||
confirm:
|
|
||||||
cancel: Cancel
|
|
||||||
confirm: 'Yes'
|
|
||||||
list_needs_help:
|
|
||||||
help_is_on_its_way: 'Help is already on its way'
|
|
||||||
title: 'Request a waiter'
|
|
||||||
content: 'Request a waiter to your table'
|
|
||||||
list_needs_payment:
|
|
||||||
payment_already_requested: 'You already asked for the bill'
|
|
||||||
title: 'Ask for the check'
|
|
||||||
content: 'Do you want to pay?'
|
|
||||||
product_orders:
|
|
||||||
order_button: Order
|
|
||||||
total: Total
|
|
||||||
no_orders: No products
|
|
||||||
state:
|
|
||||||
list:
|
|
||||||
active: 'Active'
|
|
||||||
closed: 'Closed'
|
|
||||||
lists:
|
|
||||||
show_more: Show more
|
|
||||||
app:
|
|
||||||
error:
|
|
||||||
title: There is a problem with the application
|
|
||||||
body: Please try to restart
|
|
||||||
errors:
|
|
||||||
404:
|
|
||||||
model:
|
|
||||||
message: Cannot find %{model} with id %{id}
|
|
||||||
general:
|
|
||||||
message: Cannot find resource
|
|
||||||
settings:
|
|
||||||
title: Settings
|
|
||||||
language: Language
|
|
||||||
reload_application: Reload application
|
|
||||||
about:
|
|
||||||
title: About Mozo
|
|
||||||
body: |
|
|
||||||
Mozo is an app that allows you to simply order products using your phone.<br>
|
|
||||||
The process is as follows:
|
|
||||||
<ul>
|
|
||||||
<li>Scan the QR-code on the table</li>
|
|
||||||
<li>Select the products you want</li>
|
|
||||||
<li>Click the order products button</li>
|
|
||||||
</ul>
|
|
||||||
Now your order is received behind the bar.<br><br>
|
|
||||||
Feedback of your order is given by one or two checks next to your order.
|
|
||||||
feedback:
|
|
||||||
title: Feedback
|
|
||||||
subtitle: We gladly improve our app using your feedback!
|
|
||||||
submit: Submit feedback
|
|
||||||
received: Thank you for your feedback. We appreciate your opinion!
|
|
||||||
empty_content: No feedback given
|
|
||||||
sign_in:
|
|
||||||
title: Sign in
|
|
||||||
introduction: |
|
|
||||||
In order to be recognizable for the place where you want to order you have to authenticate using
|
|
||||||
a well known identity platform. Your information will be handled with extreme care and not shared
|
|
||||||
with external parties.
|
|
||||||
<br>
|
|
||||||
footer: <br>
|
|
||||||
supplier_status_info:
|
|
||||||
title: "%{name} info"
|
|
||||||
header: |
|
|
||||||
The icons at the top right corner contain information about the place where you
|
|
||||||
are currently ordering. The number prefixed with # is your table number.
|
|
||||||
orders_placed_count_explanation: " means that there are %{count} orders placed and not yet processing or finished"
|
|
||||||
orders_in_process_count_explanation: " means that there are %{count} orders currently processing"
|
|
||||||
close: Got it
|
|
||||||
modal:
|
|
||||||
info:
|
|
||||||
close: Close
|
|
||||||
product_variant:
|
|
||||||
select_on_order:
|
|
||||||
title: "What variant of %{name} do you want?"
|
|
||||||
choose: Choose
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
nl:
|
|
||||||
user:
|
|
||||||
total: Totaal
|
|
||||||
messages:
|
|
||||||
general_error: Er is iets misgegaan
|
|
||||||
cannot_order_on_non_active_list: Je kan niet bestellen op een gesloten lijst
|
|
||||||
no_active_list: Er is momenteel geen lijst actief
|
|
||||||
order_is_placed: Je bestelling is in goede orde aangekomen
|
|
||||||
new_list_created: Een nieuwe ${models.list} is aangemaakt
|
|
||||||
the_list_has_been_closed: De lijst is afgesloten
|
|
||||||
illegal_history_list_attempt: Je probeert een lijst op te vragen die niet van jou is
|
|
||||||
table_not_found: De gezochte tafel kan niet worden gevonden of is niet opgegeven
|
|
||||||
table_is_occupied: De tafel waar je aan wil gaan zitten is reeds bezet
|
|
||||||
table_is_reserved: De tafel waar je aan wil gaan zitten is gereserveerd
|
|
||||||
table_is_closed: De tafel waar je aan wil gaan zitten is niet beschikbaar voor bediening
|
|
||||||
supplier_is_closed: De eigenaar van deze tafel is momenteel gesloten
|
|
||||||
table_is_from_other_supplier: Je kan geen lijst openen bij een andere zaak zolang je huidige lijst nog niet is afgesloten
|
|
||||||
moved_to_another_table: De tafel is gewijzigd
|
|
||||||
cannot_identify_table: De applicatie kan niet bepalen om welke tafel het gaat
|
|
||||||
unknown_supplier_name: onbekend
|
|
||||||
unauthorized: Niet toegestane actie
|
|
||||||
order_could_not_be_processed: 'De bestelling kan niet worden uitgevoerd'
|
|
||||||
authenticated: Succesvolle login
|
|
||||||
active_list:
|
|
||||||
title: Actieve lijst
|
|
||||||
needs_payment: Rekening vragen!
|
|
||||||
no_orders_explanation: Je hebt nog niks besteld
|
|
||||||
not_active:
|
|
||||||
message: Momenteel is er geen lijst actief
|
|
||||||
home_button_text: Terug
|
|
||||||
list_products:
|
|
||||||
title: Bestel
|
|
||||||
join_request:
|
|
||||||
existing_user:
|
|
||||||
title: '${models.plural.join_request}'
|
|
||||||
reject_request: Afwijzen
|
|
||||||
approve_request: Toestaan
|
|
||||||
no_join_requests_message: Geen deelname verzoeken voor de huidige ${models.list}
|
|
||||||
requestor:
|
|
||||||
waiting_for_approval: Wachten op toestemming
|
|
||||||
join_this_table: Ik wil ook bestellen bij deze tafel
|
|
||||||
join_request_rejected: Je verzoek om deel te nemen aan de ${models.list|downcase} is afgewezen
|
|
||||||
join_request_approved: Je verzoek om deel te nemen aan de ${models.list|downcase} is goedgekeurd
|
|
||||||
history_list:
|
|
||||||
title: Afgesloten lijst
|
|
||||||
list_history:
|
|
||||||
title: Afgesloten lijsten
|
|
||||||
show_products:
|
|
||||||
# The title gets products: Product.model_name.human_plural that can be used: e.g.: Showing %{products}
|
|
||||||
title: Menu
|
|
||||||
join_occupied_table:
|
|
||||||
title: Deze tafel is bezet
|
|
||||||
show_the_products: Laat me het menu zien
|
|
||||||
back: Terug
|
|
||||||
home:
|
|
||||||
scan_qr: Scan qr code
|
|
||||||
show_active_list: Toon mijn bestellingen
|
|
||||||
show_active_list_products: Ga naar het menu
|
|
||||||
basket:
|
|
||||||
total: Totaal
|
|
||||||
product_category:
|
|
||||||
other_name: Overig
|
|
||||||
obtain_token:
|
|
||||||
title: Aanmelden bij mozo.bar
|
|
||||||
obtain: Aanmelden
|
|
||||||
invalid_combination: De inloggegevens zijn onjuist
|
|
||||||
move_table:
|
|
||||||
cannot_move_to_occupied_table: 'Je kan niet verhuizen naar een tafel die reeds gebruikt wordt.'
|
|
||||||
moved_to_another_table: 'De tafel is gewijzigd.'
|
|
||||||
confirmation_title: 'Naar een andere tafel verhuizen?'
|
|
||||||
confirmation_body: 'Wil je verplaatsen naar tafel %{number}?'
|
|
||||||
confirm:
|
|
||||||
cancel: Annuleer
|
|
||||||
confirm: 'Ja'
|
|
||||||
list_needs_help:
|
|
||||||
help_is_on_its_way: 'Er wordt al iemand naar je tafel gestuurd'
|
|
||||||
title: 'Ik heb een vraag'
|
|
||||||
content: 'Wil je een vraag stellen?'
|
|
||||||
list_needs_payment:
|
|
||||||
payment_already_requested: 'De rekening is reeds gevraagd'
|
|
||||||
title: 'Vraag om de rekening'
|
|
||||||
content: 'Wil je betalen?'
|
|
||||||
product_orders:
|
|
||||||
order_button: Bestel
|
|
||||||
total: Totaal
|
|
||||||
no_orders: Geen bestellingen
|
|
||||||
state:
|
|
||||||
list:
|
|
||||||
active: 'Actief'
|
|
||||||
closed: 'Afgesloten'
|
|
||||||
lists:
|
|
||||||
show_more: Meer tonen
|
|
||||||
app:
|
|
||||||
error:
|
|
||||||
title: Er is een probleem met de applicatie
|
|
||||||
body: Herstart de applicatie om het op te lossen
|
|
||||||
|
|
||||||
errors:
|
|
||||||
404:
|
|
||||||
model:
|
|
||||||
message: '%{model} met id %{id} kan niet worden gevonden'
|
|
||||||
general:
|
|
||||||
message: Data niet beschikbaar
|
|
||||||
|
|
||||||
settings:
|
|
||||||
title: Settings
|
|
||||||
language: Taal
|
|
||||||
reload_application: Applicatie herstarten
|
|
||||||
about:
|
|
||||||
title: Over Mozo
|
|
||||||
body: |
|
|
||||||
Mozo is een app waarme je producten kan bestellen met je telefoon.<br>
|
|
||||||
Het proces is als volgt:
|
|
||||||
<ul>
|
|
||||||
<li>Scan de QR-code op de tafel</li>
|
|
||||||
<li>Selecteer de producten die je wilt</li>
|
|
||||||
<li>Klik op de bestelknop</li>
|
|
||||||
</ul>
|
|
||||||
Nu komt je bestelling achter de bar binnen.<br><br>
|
|
||||||
Feedback van je bestelling krijg je dmv een of twee vinkjes naast je bestelling.
|
|
||||||
feedback:
|
|
||||||
title: Feedback
|
|
||||||
subtitle: We verbeteren graag de app aan de hand van jouw feedback!
|
|
||||||
submit: Geef feedback
|
|
||||||
received: Dank je voor het meedenken!
|
|
||||||
empty_content: Geen feedback gegeven
|
|
||||||
sign_in:
|
|
||||||
title: Aanmelden
|
|
||||||
introduction: |
|
|
||||||
Om herkenbaar te zijn voor de horeca ondernemer is de aanmelding via een bekend identiteits platform.
|
|
||||||
Je gegevens worden niet gedeeld met andere partijen, behalve basisinformatie zoals je naam voor de
|
|
||||||
horeca onderneming waar je wat bestelt.
|
|
||||||
<br>
|
|
||||||
footer: <br>
|
|
||||||
supplier_status_info:
|
|
||||||
title: "%{name} info"
|
|
||||||
header: |
|
|
||||||
De icoontjes rechtsboven geven informatie over de plek waar je aan het bestellen bent.
|
|
||||||
Het getal met # is je tafelnummer.
|
|
||||||
orders_placed_count_explanation: " betekent dat er %{count} nog niet in behandeling of afgesloten bestellingen zijn"
|
|
||||||
orders_in_process_count_explanation: " betekent dat er %{count} bestellingen in behandeling zijn"
|
|
||||||
close: Got it
|
|
||||||
modal:
|
|
||||||
info:
|
|
||||||
close: Sluit
|
|
||||||
product_variant:
|
|
||||||
select_on_order:
|
|
||||||
title: "Selecteer welke variant %{name} je wilt"
|
|
||||||
choose: Kies
|
|
||||||
+14
-12
@@ -53,39 +53,41 @@ Qwaiter::Application.routes.draw do
|
|||||||
|
|
||||||
# USER
|
# USER
|
||||||
#default_url_options format: 'html'
|
#default_url_options format: 'html'
|
||||||
get '/user/index' => 'user#index', as: :user_root
|
#get '/user/index' => 'user#index', as: :user_root
|
||||||
get '/user' => 'user#index'
|
#get '/user' => 'user#index'
|
||||||
get '/user/active_list(.:format)' => 'user#active_list', as: :user_active_list
|
#get '/user/active_list(.:format)' => 'user#active_list', as: :user_active_list
|
||||||
get '/user/list_info' => 'user#list_info', as: :user_list_info, via: [:get, :options]
|
#get '/user/list_info' => 'user#list_info', as: :user_list_info, via: [:get, :options]
|
||||||
post '/user/needs_help' => 'user#needs_help', as: :user_needs_help
|
post '/user/needs_help' => 'user#needs_help', as: :user_needs_help
|
||||||
post '/user/list_needs_payment' => 'user#list_needs_payment', as: :user_list_needs_payment
|
post '/user/list_needs_payment' => 'user#list_needs_payment', as: :user_list_needs_payment
|
||||||
post '/user/create_list' => 'user#create_list', as: :user_create_list
|
#post '/user/create_list' => 'user#create_list', as: :user_create_list
|
||||||
get '/user/list_products' => 'user#list_products', as: :user_list_products
|
#get '/user/list_products' => 'user#list_products', as: :user_list_products
|
||||||
get '/user/list_products_for_table' => 'user#list_products_for_table', as: :user_list_products_for_table
|
#get '/user/list_products_for_table' => 'user#list_products_for_table', as: :user_list_products_for_table
|
||||||
get '/user/list_history' => 'user#list_history', as: :user_list_history
|
#get '/user/list_history' => 'user#list_history', as: :user_list_history
|
||||||
get '/user/history_list' => 'user#history_list', as: :user_history_list
|
#get '/user/history_list' => 'user#history_list', as: :user_history_list
|
||||||
post '/user/order_selected_products' => 'user#order_selected_products', as: :user_order_selected_products
|
#post '/user/order_selected_products' => 'user#order_selected_products', as: :user_order_selected_products
|
||||||
post '/user/move_table' => 'user#move_table', as: :user_move_table
|
post '/user/move_table' => 'user#move_table', as: :user_move_table
|
||||||
get '/user/table_info' => 'user#table_info', as: :user_table_info
|
get '/user/table_info' => 'user#table_info', as: :user_table_info
|
||||||
# get '/user/join_occupied_table' => 'user#join_occupied_table', as: :user_join_occupied_table
|
# get '/user/join_occupied_table' => 'user#join_occupied_table', as: :user_join_occupied_table
|
||||||
post '/user/join_occupied_table' => 'user#request_to_join_occupied_table'
|
post '/user/join_occupied_table' => 'user#request_to_join_occupied_table'
|
||||||
post '/user/reject_join_request' => 'user#reject_join_request'
|
post '/user/reject_join_request' => 'user#reject_join_request'
|
||||||
post '/user/approve_join_request' => 'user#approve_join_request'
|
post '/user/approve_join_request' => 'user#approve_join_request'
|
||||||
|
|
||||||
|
|
||||||
post '/user/check_table_join_status' => 'user#check_table_join_status'
|
post '/user/check_table_join_status' => 'user#check_table_join_status'
|
||||||
get '/user/obtain_token' => 'user#obtain_token', as: :user_obtain_token
|
get '/user/obtain_token' => 'user#obtain_token', as: :user_obtain_token
|
||||||
post '/user/obtain_token' => 'user#obtain_token', constraints: {format: :json}
|
post '/user/obtain_token' => 'user#obtain_token', constraints: {format: :json}
|
||||||
get '/close_window' => 'dashboard#close_window'
|
get '/close_window' => 'dashboard#close_window'
|
||||||
|
|
||||||
namespace :users, path: '/user' do
|
namespace :users, path: '/user/api/v1' do
|
||||||
resources :product_categories, only: [:index]
|
resources :product_categories, only: [:index]
|
||||||
resources :lists, only: [:index, :show] do
|
resources :lists, only: [:index, :show] do
|
||||||
collection do
|
collection do
|
||||||
get :current
|
get :current
|
||||||
end
|
end
|
||||||
resources :orders, only: [:index]
|
|
||||||
member do
|
member do
|
||||||
get :table
|
get :table
|
||||||
end
|
end
|
||||||
|
resources :orders, only: [:index]
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :orders, only: [:create]
|
resources :orders, only: [:create]
|
||||||
|
|||||||
@@ -0,0 +1,148 @@
|
|||||||
|
en:
|
||||||
|
total: Total
|
||||||
|
messages:
|
||||||
|
general_error: Something went wrong
|
||||||
|
cannot_order_on_non_active_list: You cannot place an order on a closed list
|
||||||
|
no_active_list: There is no active list
|
||||||
|
order_is_placed: Your order has been received in good order
|
||||||
|
new_list_created: A new ${models.list} has been created
|
||||||
|
the_list_has_been_closed: The list has been closed
|
||||||
|
illegal_history_list_attempt: The list you want to access is not yours
|
||||||
|
table_not_found: The requested table cannot be found or is not given
|
||||||
|
table_is_occupied: The table you want to sit on is already occupied
|
||||||
|
table_is_reserved: The table you want to sit on is reserved by someone else
|
||||||
|
table_is_closed: The table you want to sit on is not available for service
|
||||||
|
supplier_is_closed: The owner of this table is currently not handling orders
|
||||||
|
table_is_from_other_supplier: You cannot move to another table when you have an open list
|
||||||
|
moved_to_another_table: You successfully moved to another table
|
||||||
|
cannot_identify_table: The application cannot determine the table number
|
||||||
|
unknown_supplier_name: unknown
|
||||||
|
unauthorized: Unauthorized action detected
|
||||||
|
order_could_not_be_processed: 'The order could not be processed'
|
||||||
|
authenticated: Successfully authenticated
|
||||||
|
|
||||||
|
active_list:
|
||||||
|
title: Active list
|
||||||
|
needs_payment: Check please!
|
||||||
|
no_orders_explanation: You did not order anything yet
|
||||||
|
not_active:
|
||||||
|
message: At the moment there is no active list
|
||||||
|
home_button_text: Back
|
||||||
|
join_request:
|
||||||
|
existing_user:
|
||||||
|
title: '${models.plural.join_request}'
|
||||||
|
reject_request: Reject
|
||||||
|
approve_request: Approve
|
||||||
|
no_join_requests_message: No current join requests for your list
|
||||||
|
requestor:
|
||||||
|
join_this_table: Join this table
|
||||||
|
waiting_for_approval: Waiting for approval
|
||||||
|
join_request_rejected: Your request to join the table has been rejected
|
||||||
|
join_request_approved: Your request to join the table has been approved
|
||||||
|
|
||||||
|
list_products:
|
||||||
|
title: Order
|
||||||
|
history_list:
|
||||||
|
title: Closed list
|
||||||
|
list_history:
|
||||||
|
title: Closed lists
|
||||||
|
show_products:
|
||||||
|
# The title gets products: Product.model_name.human_plural that can be used: e.g.: Showing %{products}
|
||||||
|
title: Menu
|
||||||
|
join_occupied_table:
|
||||||
|
title: This table is occupied
|
||||||
|
show_the_products: Show me the menu
|
||||||
|
back: Back
|
||||||
|
home:
|
||||||
|
scan_qr: Scan qr code
|
||||||
|
show_active_list: Show my orders
|
||||||
|
show_active_list_products: Go to the menu
|
||||||
|
basket:
|
||||||
|
total: Total
|
||||||
|
product_category:
|
||||||
|
other_name: Overig
|
||||||
|
obtain_token:
|
||||||
|
title: Authenticate mozo.bar
|
||||||
|
obtain: Authenticate
|
||||||
|
invalid_combination: The email password combination is incorrect
|
||||||
|
move_table:
|
||||||
|
cannot_move_to_occupied_table: 'You cannot move to an occupied table'
|
||||||
|
moved_to_another_table: 'The table is changed.'
|
||||||
|
confirmation_title: 'Move to another table?'
|
||||||
|
confirmation_body: 'Do you want to move to table %{number}?'
|
||||||
|
confirm:
|
||||||
|
cancel: Cancel
|
||||||
|
confirm: 'Yes'
|
||||||
|
list_needs_help:
|
||||||
|
help_is_on_its_way: 'Help is already on its way'
|
||||||
|
title: 'Request a waiter'
|
||||||
|
content: 'Request a waiter to your table'
|
||||||
|
list_needs_payment:
|
||||||
|
payment_already_requested: 'You already asked for the bill'
|
||||||
|
title: 'Ask for the check'
|
||||||
|
content: 'Do you want to pay?'
|
||||||
|
product_orders:
|
||||||
|
order_button: Order
|
||||||
|
total: Total
|
||||||
|
no_orders: No products
|
||||||
|
state:
|
||||||
|
list:
|
||||||
|
active: 'Active'
|
||||||
|
closed: 'Closed'
|
||||||
|
lists:
|
||||||
|
show_more: Show more
|
||||||
|
app:
|
||||||
|
error:
|
||||||
|
title: There is a problem with the application
|
||||||
|
body: Please try to restart
|
||||||
|
errors:
|
||||||
|
404:
|
||||||
|
model:
|
||||||
|
message: Cannot find %{model} with id %{id}
|
||||||
|
general:
|
||||||
|
message: Cannot find resource
|
||||||
|
settings:
|
||||||
|
title: Settings
|
||||||
|
language: Language
|
||||||
|
reload_application: Reload application
|
||||||
|
about:
|
||||||
|
title: About Mozo
|
||||||
|
body: |
|
||||||
|
Mozo is an app that allows you to simply order products using your phone.<br>
|
||||||
|
The process is as follows:
|
||||||
|
<ul>
|
||||||
|
<li>Scan the QR-code on the table</li>
|
||||||
|
<li>Select the products you want</li>
|
||||||
|
<li>Click the order products button</li>
|
||||||
|
</ul>
|
||||||
|
Now your order is received behind the bar.<br><br>
|
||||||
|
Feedback of your order is given by one or two checks next to your order.
|
||||||
|
feedback:
|
||||||
|
title: Feedback
|
||||||
|
subtitle: We gladly improve our app using your feedback!
|
||||||
|
submit: Submit feedback
|
||||||
|
received: Thank you for your feedback. We appreciate your opinion!
|
||||||
|
empty_content: No feedback given
|
||||||
|
sign_in:
|
||||||
|
title: Sign in
|
||||||
|
introduction: |
|
||||||
|
In order to be recognizable for the place where you want to order you have to authenticate using
|
||||||
|
a well known identity platform. Your information will be handled with extreme care and not shared
|
||||||
|
with external parties.
|
||||||
|
<br>
|
||||||
|
footer: <br>
|
||||||
|
supplier_status_info:
|
||||||
|
title: "%{name} info"
|
||||||
|
header: |
|
||||||
|
The icons at the top right corner contain information about the place where you
|
||||||
|
are currently ordering. The number prefixed with # is your table number.
|
||||||
|
orders_placed_count_explanation: " means that there are %{count} orders placed and not yet processing or finished"
|
||||||
|
orders_in_process_count_explanation: " means that there are %{count} orders currently processing"
|
||||||
|
close: Got it
|
||||||
|
modal:
|
||||||
|
info:
|
||||||
|
close: Close
|
||||||
|
product_variant:
|
||||||
|
select_on_order:
|
||||||
|
title: "What variant of %{name} do you want?"
|
||||||
|
choose: Choose
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
nl:
|
||||||
|
total: Totaal
|
||||||
|
messages:
|
||||||
|
general_error: Er is iets misgegaan
|
||||||
|
cannot_order_on_non_active_list: Je kan niet bestellen op een gesloten lijst
|
||||||
|
no_active_list: Er is momenteel geen lijst actief
|
||||||
|
order_is_placed: Je bestelling is in goede orde aangekomen
|
||||||
|
new_list_created: Een nieuwe ${models.list} is aangemaakt
|
||||||
|
the_list_has_been_closed: De lijst is afgesloten
|
||||||
|
illegal_history_list_attempt: Je probeert een lijst op te vragen die niet van jou is
|
||||||
|
table_not_found: De gezochte tafel kan niet worden gevonden of is niet opgegeven
|
||||||
|
table_is_occupied: De tafel waar je aan wil gaan zitten is reeds bezet
|
||||||
|
table_is_reserved: De tafel waar je aan wil gaan zitten is gereserveerd
|
||||||
|
table_is_closed: De tafel waar je aan wil gaan zitten is niet beschikbaar voor bediening
|
||||||
|
supplier_is_closed: De eigenaar van deze tafel is momenteel gesloten
|
||||||
|
table_is_from_other_supplier: Je kan geen lijst openen bij een andere zaak zolang je huidige lijst nog niet is afgesloten
|
||||||
|
moved_to_another_table: De tafel is gewijzigd
|
||||||
|
cannot_identify_table: De applicatie kan niet bepalen om welke tafel het gaat
|
||||||
|
unknown_supplier_name: onbekend
|
||||||
|
unauthorized: Niet toegestane actie
|
||||||
|
order_could_not_be_processed: 'De bestelling kan niet worden uitgevoerd'
|
||||||
|
authenticated: Succesvolle login
|
||||||
|
active_list:
|
||||||
|
title: Actieve lijst
|
||||||
|
needs_payment: Rekening vragen!
|
||||||
|
no_orders_explanation: Je hebt nog niks besteld
|
||||||
|
not_active:
|
||||||
|
message: Momenteel is er geen lijst actief
|
||||||
|
home_button_text: Terug
|
||||||
|
list_products:
|
||||||
|
title: Bestel
|
||||||
|
join_request:
|
||||||
|
existing_user:
|
||||||
|
title: '${models.plural.join_request}'
|
||||||
|
reject_request: Afwijzen
|
||||||
|
approve_request: Toestaan
|
||||||
|
no_join_requests_message: Geen deelname verzoeken voor de huidige ${models.list}
|
||||||
|
requestor:
|
||||||
|
waiting_for_approval: Wachten op toestemming
|
||||||
|
join_this_table: Ik wil ook bestellen bij deze tafel
|
||||||
|
join_request_rejected: Je verzoek om deel te nemen aan de ${models.list|downcase} is afgewezen
|
||||||
|
join_request_approved: Je verzoek om deel te nemen aan de ${models.list|downcase} is goedgekeurd
|
||||||
|
history_list:
|
||||||
|
title: Afgesloten lijst
|
||||||
|
list_history:
|
||||||
|
title: Afgesloten lijsten
|
||||||
|
show_products:
|
||||||
|
# The title gets products: Product.model_name.human_plural that can be used: e.g.: Showing %{products}
|
||||||
|
title: Menu
|
||||||
|
join_occupied_table:
|
||||||
|
title: Deze tafel is bezet
|
||||||
|
show_the_products: Laat me het menu zien
|
||||||
|
back: Terug
|
||||||
|
home:
|
||||||
|
scan_qr: Scan qr code
|
||||||
|
show_active_list: Toon mijn bestellingen
|
||||||
|
show_active_list_products: Ga naar het menu
|
||||||
|
basket:
|
||||||
|
total: Totaal
|
||||||
|
product_category:
|
||||||
|
other_name: Overig
|
||||||
|
obtain_token:
|
||||||
|
title: Aanmelden bij mozo.bar
|
||||||
|
obtain: Aanmelden
|
||||||
|
invalid_combination: De inloggegevens zijn onjuist
|
||||||
|
move_table:
|
||||||
|
cannot_move_to_occupied_table: 'Je kan niet verhuizen naar een tafel die reeds gebruikt wordt.'
|
||||||
|
moved_to_another_table: 'De tafel is gewijzigd.'
|
||||||
|
confirmation_title: 'Naar een andere tafel verhuizen?'
|
||||||
|
confirmation_body: 'Wil je verplaatsen naar tafel %{number}?'
|
||||||
|
confirm:
|
||||||
|
cancel: Annuleer
|
||||||
|
confirm: 'Ja'
|
||||||
|
list_needs_help:
|
||||||
|
help_is_on_its_way: 'Er wordt al iemand naar je tafel gestuurd'
|
||||||
|
title: 'Ik heb een vraag'
|
||||||
|
content: 'Wil je een vraag stellen?'
|
||||||
|
list_needs_payment:
|
||||||
|
payment_already_requested: 'De rekening is reeds gevraagd'
|
||||||
|
title: 'Vraag om de rekening'
|
||||||
|
content: 'Wil je betalen?'
|
||||||
|
product_orders:
|
||||||
|
order_button: Bestel
|
||||||
|
total: Totaal
|
||||||
|
no_orders: Geen bestellingen
|
||||||
|
state:
|
||||||
|
list:
|
||||||
|
active: 'Actief'
|
||||||
|
closed: 'Afgesloten'
|
||||||
|
lists:
|
||||||
|
show_more: Meer tonen
|
||||||
|
app:
|
||||||
|
error:
|
||||||
|
title: Er is een probleem met de applicatie
|
||||||
|
body: Herstart de applicatie om het op te lossen
|
||||||
|
|
||||||
|
errors:
|
||||||
|
404:
|
||||||
|
model:
|
||||||
|
message: '%{model} met id %{id} kan niet worden gevonden'
|
||||||
|
general:
|
||||||
|
message: Data niet beschikbaar
|
||||||
|
|
||||||
|
settings:
|
||||||
|
title: Settings
|
||||||
|
language: Taal
|
||||||
|
reload_application: Applicatie herstarten
|
||||||
|
about:
|
||||||
|
title: Over Mozo
|
||||||
|
body: |
|
||||||
|
Mozo is een app waarme je producten kan bestellen met je telefoon.<br>
|
||||||
|
Het proces is als volgt:
|
||||||
|
<ul>
|
||||||
|
<li>Scan de QR-code op de tafel</li>
|
||||||
|
<li>Selecteer de producten die je wilt</li>
|
||||||
|
<li>Klik op de bestelknop</li>
|
||||||
|
</ul>
|
||||||
|
Nu komt je bestelling achter de bar binnen.<br><br>
|
||||||
|
Feedback van je bestelling krijg je dmv een of twee vinkjes naast je bestelling.
|
||||||
|
feedback:
|
||||||
|
title: Feedback
|
||||||
|
subtitle: We verbeteren graag de app aan de hand van jouw feedback!
|
||||||
|
submit: Geef feedback
|
||||||
|
received: Dank je voor het meedenken!
|
||||||
|
empty_content: Geen feedback gegeven
|
||||||
|
sign_in:
|
||||||
|
title: Aanmelden
|
||||||
|
introduction: |
|
||||||
|
Om herkenbaar te zijn voor de horeca ondernemer is de aanmelding via een bekend identiteits platform.
|
||||||
|
Je gegevens worden niet gedeeld met andere partijen, behalve basisinformatie zoals je naam voor de
|
||||||
|
horeca onderneming waar je wat bestelt.
|
||||||
|
<br>
|
||||||
|
footer: <br>
|
||||||
|
supplier_status_info:
|
||||||
|
title: "%{name} info"
|
||||||
|
header: |
|
||||||
|
De icoontjes rechtsboven geven informatie over de plek waar je aan het bestellen bent.
|
||||||
|
Het getal met # is je tafelnummer.
|
||||||
|
orders_placed_count_explanation: " betekent dat er %{count} nog niet in behandeling of afgesloten bestellingen zijn"
|
||||||
|
orders_in_process_count_explanation: " betekent dat er %{count} bestellingen in behandeling zijn"
|
||||||
|
close: Got it
|
||||||
|
modal:
|
||||||
|
info:
|
||||||
|
close: Sluit
|
||||||
|
product_variant:
|
||||||
|
select_on_order:
|
||||||
|
title: "Selecteer welke variant %{name} je wilt"
|
||||||
|
choose: Kies
|
||||||
@@ -9,6 +9,7 @@ module Qwaiter::UserBaseSerializer
|
|||||||
|
|
||||||
def base_url
|
def base_url
|
||||||
"/user"
|
"/user"
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_name(attribute_name)
|
def format_name(attribute_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user