shop_detail func: update in base

This commit is contained in:
phyusin
2019-01-07 16:05:18 +06:30
parent cca350b264
commit ccd9855281
15 changed files with 20 additions and 94 deletions

View File

@@ -17,10 +17,6 @@ class ApplicationController < ActionController::Base
flash[:warning] = exception.message flash[:warning] = exception.message
redirect_to root_path redirect_to root_path
end end
def shop_detail
@shop = Shop.first
end
end end

View File

@@ -1,12 +1,5 @@
class BaseController < ActionController::Base class BaseController < ActionController::Base
layout "installation" layout "installation"
protect_from_forgery with: :exception protect_from_forgery with: :exception
helper_method :shop_detail
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end end

View File

@@ -7,8 +7,6 @@ class BaseCrmController < ActionController::Base
#before_action :check_installation #before_action :check_installation
protect_from_forgery with: :exception protect_from_forgery with: :exception
helper_method :shop_detail
rescue_from CanCan::AccessDenied do |exception| rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message flash[:warning] = exception.message
redirect_to root_path redirect_to root_path
@@ -29,9 +27,4 @@ class BaseCrmController < ActionController::Base
redirect_to root_path redirect_to root_path
end end
end end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end end

View File

@@ -7,8 +7,6 @@ class BaseInventoryController < ActionController::Base
#before_action :check_installation #before_action :check_installation
protect_from_forgery with: :exception protect_from_forgery with: :exception
helper_method :shop_detail
rescue_from CanCan::AccessDenied do |exception| rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message flash[:warning] = exception.message
redirect_to root_path redirect_to root_path
@@ -19,9 +17,4 @@ class BaseInventoryController < ActionController::Base
redirect_to root_path redirect_to root_path
end end
end end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end end

View File

@@ -6,8 +6,6 @@ class BaseOqsController < ActionController::Base
#before_action :check_installation #before_action :check_installation
protect_from_forgery with: :exception protect_from_forgery with: :exception
helper_method :shop_detail
rescue_from CanCan::AccessDenied do |exception| rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message flash[:warning] = exception.message
@@ -29,9 +27,4 @@ class BaseOqsController < ActionController::Base
redirect_to root_path redirect_to root_path
end end
end end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end end

View File

@@ -7,7 +7,7 @@ class BaseOrigamiController < ActionController::Base
#before_action :check_installation #before_action :check_installation
protect_from_forgery with: :exception protect_from_forgery with: :exception
helper_method :shop_detail, :current_token helper_method :current_token
rescue_from CanCan::AccessDenied do |exception| rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message flash[:warning] = exception.message
@@ -38,11 +38,6 @@ class BaseOrigamiController < ActionController::Base
@cashier = Employee.where("role = 'cashier' AND token_session <> ''") @cashier = Employee.where("role = 'cashier' AND token_session <> ''")
end end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
#check webview #check webview
def check_mobile def check_mobile
status = false status = false

View File

@@ -1,18 +1,16 @@
class BaseReportController < ActionController::Base class BaseReportController < ActionController::Base
include LoginVerification include LoginVerification
layout "application" layout "application"
before_action :check_user before_action :check_user
#before_action :check_installation #before_action :check_installation
protect_from_forgery with: :exception protect_from_forgery with: :exception
helper_method :shop_detail
rescue_from CanCan::AccessDenied do |exception| rescue_from CanCan::AccessDenied do |exception|
flash[:warning] = exception.message flash[:warning] = exception.message
redirect_to root_path redirect_to root_path
end end
PERIOD = { PERIOD = {
"today" => 0, "today" => 0,
@@ -90,9 +88,4 @@ class BaseReportController < ActionController::Base
redirect_to root_path redirect_to root_path
end end
end end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end end

View File

@@ -7,16 +7,9 @@ class BaseWaiterController < ActionController::Base
#before_action :check_installation #before_action :check_installation
protect_from_forgery with: :exception protect_from_forgery with: :exception
helper_method :shop_detail
def check_user def check_user
if current_user.nil? if current_user.nil?
redirect_to root_path redirect_to root_path
end end
end end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end end

View File

@@ -3,7 +3,7 @@ module LoginVerification
included do included do
before_action :authenticate_session_token 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 end
#this is base api base controller to need to inherit. #this is base api base controller to need to inherit.
@@ -38,6 +38,12 @@ module LoginVerification
@cashier = Employee.where("role = 'cashier' AND token_session <> ''") @cashier = Employee.where("role = 'cashier' AND token_session <> ''")
end end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
#check order reservation used #check order reservation used
def order_reservation def order_reservation
order_reserve = Lookup.collection_of('order_reservation') order_reserve = Lookup.collection_of('order_reservation')

View File

@@ -4,8 +4,6 @@ class HomeController < ApplicationController
before_action :check_user, only: :dashboard before_action :check_user, only: :dashboard
helper_method :shop_detail
# Special check for only dashboard # Special check for only dashboard
def check_user def check_user
if current_user.nil? if current_user.nil?
@@ -251,9 +249,4 @@ class HomeController < ApplicationController
return from, to, from_time, to_time return from, to, from_time, to_time
end end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end end

View File

@@ -3,8 +3,6 @@ class InstallController < BaseController
skip_before_action :verify_authenticity_token skip_before_action :verify_authenticity_token
# before_action :check_license # before_action :check_license
helper_method :shop_detail
def index def index
end end
@@ -77,9 +75,4 @@ class InstallController < BaseController
# return nil # return nil
# end # end
# end # end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end end

View File

@@ -2,8 +2,6 @@ class PrintSettingsController < ApplicationController
load_and_authorize_resource except: [:create] load_and_authorize_resource except: [:create]
before_action :set_print_setting, only: [:show, :edit, :update, :destroy] before_action :set_print_setting, only: [:show, :edit, :update, :destroy]
helper_method :shop_detail
# GET /print_settings # GET /print_settings
# GET /print_settings.json # GET /print_settings.json
def index def index
@@ -85,9 +83,4 @@ class PrintSettingsController < ApplicationController
def print_setting_params 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) 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 end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end end

View File

@@ -2,8 +2,6 @@ class SymControlController < BaseController
skip_before_action :verify_authenticity_token skip_before_action :verify_authenticity_token
http_basic_authenticate_with name: "vip", password: "!abcABC01" http_basic_authenticate_with name: "vip", password: "!abcABC01"
helper_method :shop_detail
def run def run
sym_path = File.expand_path("~/symmetric/") sym_path = File.expand_path("~/symmetric/")
check_sym_proc_str = `#{"sudo service SymmetricDS status"}` check_sym_proc_str = `#{"sudo service SymmetricDS status"}`
@@ -44,10 +42,4 @@ class SymControlController < BaseController
flash[:notice] = "Not Get!" flash[:notice] = "Not Get!"
end end
end end
#Shop Name in Navbor
def shop_detail
@shop = Shop.first
end
end end

View File

@@ -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 :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.decimal :transaction_fee, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.string :status, :null => false, :default => "new" t.string :status, :null => false, :default => "new"
t.string :order_remark t.longtext :order_remark
t.string :remark t.longtext :remark
t.json :action_times t.json :action_times
t.timestamps t.timestamps
end end

View File

@@ -5,10 +5,10 @@ class CreateDeliveries < ActiveRecord::Migration[5.1]
t.string :provider, :null => false t.string :provider, :null => false
t.string :delivery_type, :null => false t.string :delivery_type, :null => false
t.string :township t.string :township
t.string :address t.longtext :address
t.string :direction_address t.longtext :direction_address
t.string :delivery_fee t.string :delivery_fee
t.string :remark t.longtext :remark
t.timestamps t.timestamps
end end
end end