Add spanish locales and gravatar options

This commit is contained in:
2026-03-09 11:17:25 -05:00
parent 2711edb167
commit 4e1d3bd052
32 changed files with 640 additions and 106 deletions
+21 -6
View File
@@ -13,7 +13,20 @@ class ApplicationController < ActionController::Base
rescue_from SimplyStored::RecordNotFound, with: :show_404
private
# protected
#
# def after_sign_in_path_for(resource)
# case resource
# when 'user' then Mozo.user_url
# else
# main_app.root_path
# end
# # Customize the redirect path here
# # For example, redirect to a dashboard page
# dashboard_path || root_path
# end
#
private
def authenticate_employee!
if auth_token = params[:auth_token].presence || request.headers['HTTP_AUTH_TOKEN'].presence
@@ -67,8 +80,9 @@ private
end
def set_locale
#session[:locale] = (params[:locale].presence || session[:locale] || Rails.configuration.i18n.default_locale).to_sym
I18n.locale = params[:locale].presence.try(:to_sym) || Rails.configuration.i18n.default_locale
session[:locale] = (params[:locale].presence || session[:locale] || Rails.configuration.i18n.default_locale).to_sym
I18n.locale = session[:locale]
# I18n.locale = params[:locale].presence.try(:to_sym) || Rails.configuration.i18n.default_locale
end
def _render_with_renderer_json(resource, options)
@@ -98,9 +112,10 @@ private
def after_sign_in_path_for(resource)
case resource
when Employee then supplier_root_path
when Administrator then cmtool.root_path
else root_path
when User then Mozo.user_url
when Employee then Mozo.supplier_url
when Administrator then cmtool.root_path
else root_path
end
end
@@ -1,13 +0,0 @@
# class RegistrationsController < Devise::RegistrationsController
# protected
#
# #def after_sign_up_path(resource)
# #end
#
# private
#
# # override devise internal to allow name as sign_up param
# def sign_up_params
# params.require(resource_name).permit resource_class.authentication_keys + [:name, :password, :password_confirmation]
# end
# end
+20 -20
View File
@@ -1,20 +1,20 @@
# class WaiterController < ApplicationController
# layout 'waiter'
# def index
#
# end
#
# def product_categories
# respond_to do |format|
# format.html { redirect_to '/waiter'}
# format.json { render json: ProductCategory.all.include_relation(:product), root: 'product_categories', each_serializer: ProductCategorySerializer }
# end
# end
#
# def order_products
# @table= Table.find_by_supplier_id_and_id!(current_supplier.id, params[:table_id])
# @list = List.from_table_by_employee(@table, current_employee)
# @list.place_order products: params[:order], employee: current_employee
# render nothing: true
# end
# end
class WaiterController < ApplicationController
layout 'waiter'
def index
end
def product_categories
respond_to do |format|
format.html { redirect_to '/waiter'}
format.json { render json: ProductCategory.all.include_relation(:product), root: 'product_categories', each_serializer: ProductCategorySerializer }
end
end
def order_products
@table= Table.find_by_supplier_id_and_id!(current_supplier.id, params[:table_id])
@list = List.from_table_by_employee(@table, current_employee)
@list.place_order products: params[:order], employee: current_employee
render nothing: true
end
end