shop_detail func: update in base
This commit is contained in:
@@ -17,10 +17,6 @@ class ApplicationController < ActionController::Base
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
class BaseController < ActionController::Base
|
||||
layout "installation"
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -7,8 +7,6 @@ class BaseCrmController < ActionController::Base
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
@@ -29,9 +27,4 @@ class BaseCrmController < ActionController::Base
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,8 +7,6 @@ class BaseInventoryController < ActionController::Base
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
@@ -19,9 +17,4 @@ class BaseInventoryController < ActionController::Base
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,8 +6,6 @@ class BaseOqsController < ActionController::Base
|
||||
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
@@ -29,9 +27,4 @@ class BaseOqsController < ActionController::Base
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ class BaseOrigamiController < ActionController::Base
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail, :current_token
|
||||
helper_method :current_token
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
@@ -38,11 +38,6 @@ class BaseOrigamiController < ActionController::Base
|
||||
@cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
#check webview
|
||||
def check_mobile
|
||||
status = false
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
class BaseReportController < ActionController::Base
|
||||
include LoginVerification
|
||||
layout "application"
|
||||
layout "application"
|
||||
|
||||
before_action :check_user
|
||||
before_action :check_user
|
||||
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
end
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
PERIOD = {
|
||||
"today" => 0,
|
||||
@@ -90,9 +88,4 @@ class BaseReportController < ActionController::Base
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,16 +7,9 @@ class BaseWaiterController < ActionController::Base
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
def check_user
|
||||
if current_user.nil?
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ module LoginVerification
|
||||
|
||||
included do
|
||||
before_action :authenticate_session_token
|
||||
helper_method :current_company,:current_shop, :current_login_employee, :current_user, :get_cashier, :order_reservation, :bank_integration
|
||||
helper_method :current_company,:current_shop, :current_login_employee, :current_user, :get_cashier, :order_reservation, :bank_integration, :shop_detail
|
||||
end
|
||||
|
||||
#this is base api base controller to need to inherit.
|
||||
@@ -38,6 +38,12 @@ module LoginVerification
|
||||
@cashier = Employee.where("role = 'cashier' AND token_session <> ''")
|
||||
end
|
||||
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
#check order reservation used
|
||||
def order_reservation
|
||||
order_reserve = Lookup.collection_of('order_reservation')
|
||||
|
||||
@@ -4,8 +4,6 @@ class HomeController < ApplicationController
|
||||
|
||||
before_action :check_user, only: :dashboard
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
# Special check for only dashboard
|
||||
def check_user
|
||||
if current_user.nil?
|
||||
@@ -251,9 +249,4 @@ class HomeController < ApplicationController
|
||||
|
||||
return from, to, from_time, to_time
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,8 +3,6 @@ class InstallController < BaseController
|
||||
skip_before_action :verify_authenticity_token
|
||||
# before_action :check_license
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
@@ -77,9 +75,4 @@ class InstallController < BaseController
|
||||
# return nil
|
||||
# end
|
||||
# end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,8 +2,6 @@ class PrintSettingsController < ApplicationController
|
||||
load_and_authorize_resource except: [:create]
|
||||
before_action :set_print_setting, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
# GET /print_settings
|
||||
# GET /print_settings.json
|
||||
def index
|
||||
@@ -85,9 +83,4 @@ class PrintSettingsController < ApplicationController
|
||||
def print_setting_params
|
||||
params.require(:print_setting).permit(:name, :unique_code, :template, :printer_name, :font,:header_font_size, :item_font_size, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space)
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,8 +2,6 @@ class SymControlController < BaseController
|
||||
skip_before_action :verify_authenticity_token
|
||||
http_basic_authenticate_with name: "vip", password: "!abcABC01"
|
||||
|
||||
helper_method :shop_detail
|
||||
|
||||
def run
|
||||
sym_path = File.expand_path("~/symmetric/")
|
||||
check_sym_proc_str = `#{"sudo service SymmetricDS status"}`
|
||||
@@ -44,10 +42,4 @@ class SymControlController < BaseController
|
||||
flash[:notice] = "Not Get!"
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
def shop_detail
|
||||
@shop = Shop.first
|
||||
end
|
||||
|
||||
end
|
||||
@@ -23,8 +23,8 @@ class CreateOrderReservations < ActiveRecord::Migration[5.1]
|
||||
t.decimal :grand_total, :precision => 10, :scale => 2, :null => false, :default => 0.00
|
||||
t.decimal :transaction_fee, :precision => 10, :scale => 2, :null => false, :default => 0.00
|
||||
t.string :status, :null => false, :default => "new"
|
||||
t.string :order_remark
|
||||
t.string :remark
|
||||
t.longtext :order_remark
|
||||
t.longtext :remark
|
||||
t.json :action_times
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
@@ -5,10 +5,10 @@ class CreateDeliveries < ActiveRecord::Migration[5.1]
|
||||
t.string :provider, :null => false
|
||||
t.string :delivery_type, :null => false
|
||||
t.string :township
|
||||
t.string :address
|
||||
t.string :direction_address
|
||||
t.longtext :address
|
||||
t.longtext :direction_address
|
||||
t.string :delivery_fee
|
||||
t.string :remark
|
||||
t.longtext :remark
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user